Text processing method, legal instrument processing method, abstract generation model training method, computing device, computer readable storage medium and computer program product
By obtaining the guide text of the pending text and inputting it into the summary generation model, and generating text summary and keywords, the problem of insufficient flexibility in text summary generation in the prior art is solved, and the readability and flexibility of text summary are improved.
Patent Information
- Application Number
- CN202410172130.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, the flexibility of text summary generation is low, unable to meet the reading needs of different users, and manual summary requires a lot of time and effort.
By obtaining the pending text and determining the guidance text associated with it, inputting it into the summary generation model, generating text summary and keywords, and using the guidance text to guide the summary generation process, improve the readability and flexibility of text summary.
It improves the readability of text summary, reduces the probability of information loss, and meets the text summary generation needs of different users.
Smart Images

Figure CN120470116A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular to text processing methods, legal document processing methods, summary generation model training methods, computing devices, computer-readable storage media, and computer program products. Background Art
[0002] With the development of internet technology, the amount of text content, including news, academic papers, and legal documents, has grown exponentially, causing significant inconvenience for readers. Manual summarization requires significant time, effort, and cost, becoming impractical when the amount of text is large. Automatically generating text summaries is becoming increasingly important.
[0003] In the existing technology, an "extraction-generation" summary model is typically used to generate text summaries. The model consists of two parts: an extraction model and a generation model. The extraction model extracts the original text clauses that are important for the summary from the original paragraph. The generation model uses the output clauses of the extraction model as input to further refine and summarize the extraction results. However, this method of text summarization generates summaries containing fixed keywords, which reduces the flexibility of text summarization and cannot meet the reading needs of different users. Therefore, a more effective text processing method is urgently needed to solve the above problems. 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 device, a legal document processing method, a legal document processing device, a summary generation model training method, a summary generation model training device, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a text processing method is provided, including:
[0006] Acquire a text to be processed, and determine a guidance text associated with the text to be processed;
[0007] The text to be processed and the guidance text are input into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary.
[0008] According to a second aspect of the embodiments of this specification, there is provided a text processing apparatus, comprising:
[0009] An acquisition module is configured to acquire a text to be processed and determine a guidance text associated with the text to be processed;
[0010] The output module is configured to input the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary.
[0011] According to a third aspect of the embodiments of this specification, a text processing method is provided, including:
[0012] Receive text processing requests submitted by the client;
[0013] Parsing the text processing request to obtain a text to be processed, and determining a guidance text associated with the text to be processed;
[0014] Inputting the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary;
[0015] A text summary and at least one text keyword corresponding to the text to be processed are sent to the client as feedback of the text processing request.
[0016] According to a fourth aspect of the embodiments of this specification, there is provided a text processing apparatus, comprising:
[0017] A receiving module is configured to receive a text processing request submitted by a client;
[0018] a parsing module configured to parse the text processing request to obtain a text to be processed, and determine a guidance text associated with the text to be processed;
[0019] an output module configured to input the text to be processed and the guidance text into a summary generation model, obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary;
[0020] The feedback module is configured to send a text summary and at least one text keyword corresponding to the text to be processed to the client as feedback of the text processing request.
[0021] According to a fifth aspect of the embodiments of this specification, a method for processing legal documents is provided, including:
[0022] Obtaining a pending legal document and determining a guiding legal document associated with the pending legal document;
[0023] The legal document to be processed and the guiding legal document are input into a summary generation model to obtain a legal document summary and at least one legal document keyword corresponding to the legal document to be processed, wherein each legal document keyword is determined in the legal document to be processed based on the guiding legal document, and the legal document summary is generated based on the legal document to be processed and each legal document keyword, and the guiding legal document is a text that guides the generation of the legal document summary.
[0024] According to a sixth aspect of the embodiments of this specification, a legal document processing device is provided, comprising:
[0025] an acquisition module configured to acquire a pending legal document and determine a guiding legal document associated with the pending legal document;
[0026] The output module is configured to input the legal document to be processed and the guiding legal document into a summary generation model to obtain a legal document summary and at least one legal document keyword corresponding to the legal document to be processed, wherein each legal document keyword is determined in the legal document to be processed based on the guiding legal document, the legal document summary is generated based on the legal document to be processed and each legal document keyword, and the guiding legal document is a text that guides the generation of the legal document summary.
[0027] According to a seventh aspect of the embodiments of this specification, a summary generation model training method is provided, which is applied to the cloud side and includes:
[0028] The training sample set submitted by the receiving end;
[0029] Acquire a training sample from a training sample set, and determine the sample text, sample guidance text, reference keywords, and reference summary text contained in the training sample;
[0030] Inputting the sample text and the sample guidance text into an initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model;
[0031] Calculating a loss value based on the predicted keywords, the predicted summary text, the reference keywords, and the reference summary text, and adjusting parameters of the initial summary generation model based on the loss value until a summary generation model that meets a training stop condition is obtained;
[0032] Determine model parameters of the summary generation model that meet the training stop condition, and feed the model parameters back to the terminal side.
[0033] According to an eighth aspect of the embodiments of this specification, a summary generation model training device is provided, which is applied to the cloud side and includes:
[0034] A receiving module configured to receive a training sample set submitted by a terminal side;
[0035] an acquisition module configured to acquire a training sample from a training sample set and determine the sample text, sample guidance text, reference keywords, and reference summary text contained in the training sample;
[0036] An input module configured to input the sample text and the sample guidance text into an initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model;
[0037] a training module configured to calculate a loss value based on the predicted keywords, the predicted summary text, the reference keywords, and the reference summary text, and adjust parameters of the initial summary generation model based on the loss value until a summary generation model that meets a training stop condition is obtained;
[0038] The feedback module is configured to determine model parameters of the summary generation model that meet the training stop condition and feed back the model parameters to the terminal side.
[0039] According to a ninth aspect of the embodiments of this specification, a computing device is provided, including:
[0040] memory and processor;
[0041] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned text processing method are implemented.
[0042] According to a tenth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned text processing method are implemented.
[0043] According to an eleventh aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned text processing method.
[0044] According to the twelfth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the above-mentioned text processing method when executed by a processor.
[0045] One embodiment of this specification obtains a text to be processed and determines a guidance text associated with the text to be processed; inputs the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, so that the guidance text is used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is an architectural diagram of a text processing system provided by one embodiment of this specification;
[0047] Figure 2 is a flowchart of a text processing method provided by one embodiment of this specification;
[0048] Figure 3 This is a flowchart of a text processing method provided by one embodiment of this specification;
[0049] Figure 4 This is an application flow chart of a text processing method provided by an embodiment of this specification;
[0050] Figure 5 This is a structural diagram of a text processing device provided by an embodiment of this specification;
[0051] Figure 6 is a flowchart of another text processing method provided by an embodiment of this specification;
[0052] Figure 7 is a structural diagram of another text processing device provided by an embodiment of this specification;
[0053] Figure 8This is a flowchart of a legal document processing method provided by one embodiment of this specification;
[0054] Figure 9 This is a schematic diagram of the structure of a legal document processing device provided by one embodiment of this specification;
[0055] Figure 10 This is a flowchart of a summary generation model training method provided by one embodiment of this specification;
[0056] Figure 11 This is a schematic diagram of the structure of a summary generation model training device provided by one embodiment of this specification;
[0057] Figure 12 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0058] The following description sets forth many specific details to facilitate a thorough 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 generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0059] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" 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.
[0060] 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 the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0061] In addition, 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, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0062] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. A large model can also be called a cornerstone model / foundation model. It is pre-trained on a large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks and has good generalization capabilities, such as a large language model (LLM) and a multi-modal pre-training model.
[0063] When large models are used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. Large models can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, they can be applied to computer vision tasks such as visual question answering (VQA), image caption (IC), and image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0064] First, the terms involved in one or more embodiments of this specification are explained.
[0065] Chain-of-Thought (CoT): An improved prompting strategy for improving the performance of LLMs (Large Language Models) in complex reasoning tasks such as arithmetic reasoning, commonsense reasoning, and symbolic reasoning. It combines intermediate reasoning steps that can lead to the final output in the prompt.
[0066] SFT (Supervised Fine-tuning) is a common strategy in deep learning, often used on large pre-trained language models. By fine-tuning the pre-trained model using labeled data, the model's weights are adjusted based on the difference from the true labels, allowing the model to capture task-specific patterns and characteristics in the labeled data.
[0067] Figure 1 This is an architecture diagram of a text processing system provided in one embodiment of this specification. The text processing system may include a client 100 and a server 200;
[0068] The client 100 is configured to send a text to be processed and a guidance text associated with the text to be processed to the server 200;
[0069] The server 200 is configured to input the text to be processed and the guidance text into a summary generation model, obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary; and feed back the text summary and at least one text keyword corresponding to the text to be processed to the client;
[0070] The client 100 is further configured to receive a text summary and at least one text keyword corresponding to the text to be processed sent by the server 200 .
[0071] The solution of the embodiment of this specification is applied by obtaining a text to be processed and determining a guidance text associated with the text to be processed; inputting the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, so that the guidance text is used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users.
[0072] The text processing system may include multiple clients 100 and a server 200. The clients 100 may be referred to as client devices, and the server 200 may be referred to as server devices. The multiple clients 100 may establish a communication connection through the server 200. In the text summarization scenario, the server 200 is used to provide a text summarization service between the multiple clients 100. The multiple clients 100 may act as either senders or receivers, communicating through the server 200.
[0073] Users can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the text summarization scenario, users can publish data streams to the server 200 through the client 100. The server 200 generates model parameters based on the data stream and pushes the model parameters to other clients with which communication has been established.
[0074] The client 100 and the server 200 are connected via a network. The network provides a medium for the communication link between the client 100 and the server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, or other processing before being released to the server 200.
[0075] The client 100 is a client, which can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application. The client 100 can be based on the software development kit (SDK) of the corresponding service provided by the server 200, such as developed based on the real-time communication (RTC) SDK. The client 100 can be deployed in an electronic device and needs to rely on the device to run or certain APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, tablet computer, personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0076] Server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers that support background training for models used on clients, and servers that process data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server for a distributed system, or a server integrated with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0077] It is worth noting that the text processing methods provided in the embodiments of this specification are generally executed by the server. However, in other embodiments of this specification, the client may also have similar functions to the server and thus execute the text processing methods provided in the embodiments of this specification. In other embodiments, the text processing methods provided in the embodiments of this specification may also be executed jointly by the client and the server.
[0078] In this specification, a text processing method is provided. This specification also relates to a text processing device, a legal document processing method, a legal document processing device, a summary generation model training method, a summary generation model training device, a computing device, and a computer-readable storage medium, a computer program product, which are described in detail one by one in the following embodiments.
[0079] See also Figure 2 , Figure 2 A flowchart of a text processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0080] Step 202: Acquire a text to be processed, and determine a guidance text associated with the text to be processed.
[0081] Specifically, the text to be processed can be text content such as news, academic papers, legal documents, consulting dialogue texts, etc.; the guidance text refers to the indicator words or indicator sentences associated with the text to be processed; it is used to provide indicator information in the keyword dimension and semantic dimension during the summary prediction process.
[0082] Based on this, the text to be processed is obtained, and a guidance text associated with the text to be processed is selected; or a guidance text associated with the text to be processed is constructed based on the text to be processed.
[0083] Furthermore, considering that the text to be processed can be of various types, the guidance text can be flexibly set according to the text type of the text to be processed, and the specific implementation is as follows:
[0084] A text to be processed is acquired, and a text type of the text to be processed is determined; and a guidance text associated with the text to be processed is determined according to the text type.
[0085] Specifically, the text type is used to indicate the classification method of the text to be processed, which can be determined based on the field and function corresponding to the text to be processed. If the text to be processed is a legal document, the text type can be the case type of the legal case in the text to be processed, such as civil case, criminal case, etc.; if the text to be processed is a business document, the text type can be a business plan, marketing plan, cooperation agreement, business contract, etc.
[0086] Based on this, a text to be processed is obtained. The text type of the text to be processed is determined based on the text content in the text to be processed or the text label of the text to be processed. The guidance text associated with the text to be processed is determined based on the text type.
[0087] For example, if the document to be processed is a legal document related to a criminal case, the guidance text could be, "Please extract the time, location, tools, and perpetrators of the crime from the above legal document, and generate a case summary based on this information."
[0088] In summary, the guiding text associated with the text to be processed is determined according to the text type, so that when the summary is generated subsequently, a text summary that meets the user's needs can be generated, thereby improving the flexibility of text summary generation.
[0089] Furthermore, considering that it is rather cumbersome to generate guidance text after determining the text to be processed, the text types of the text to be processed can be counted, and guidance text corresponding to each text type can be pre-generated and stored in a guidance text list. The specific implementation is as follows:
[0090] A guide text list is searched based on the text type; and a guide text associated with the text to be processed is determined according to the search result.
[0091] Specifically, the guidance text list is used to store guidance texts corresponding to text types; the search result is the text type-guidance text relationship pair obtained by searching in the guidance text list based on the text type of the text to be processed; the guidance text corresponding to the text type can be determined based on the relationship pair.
[0092] Based on this, a guide text list is searched based on the text type; a search result is obtained, and a guide text corresponding to the text type is determined in the search result as the guide text associated with the text to be processed.
[0093] Continuing with the above example, the guidance text list stores multiple data pairs such as "Civil Case - Please extract the individuals involved, the cause of the case, and the conclusion from the above legal documents, and generate a case summary based on this information." When searching the guidance text list, you can determine the guidance text for the document to be processed based on its type.
[0094] In summary, by searching the guidance text list, the guidance text associated with the text to be processed is determined, thereby improving the efficiency of determining the guidance text pair.
[0095] Step 204: Input the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary.
[0096] Specifically, after obtaining the text to be processed and determining the guidance text associated with the text to be processed, the text to be processed and the guidance text can be input into the summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword; wherein the summary generation model can be a large-scale language model, which is used to predict the text summary corresponding to the text to be processed when the text to be processed is input; the text summary refers to the outline and content summary of the text to be processed, which is a brief overview of the text to be processed; text keywords refer to words contained in the text to be processed that are used to express elements such as subject, time, and place.
[0097] Based on this, after obtaining the text to be processed as mentioned above and determining the guidance text associated with the text to be processed, the text to be processed and the guidance text can be input into the summary generation model, and the summary generation model is used to predict text keywords and text summaries. The summary generation model outputs the predicted text summary and at least one text keyword corresponding to the text to be processed. The obtained text keywords are determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword.
[0098] In practical applications, a chain of thought approach can be used when a summary generation model generates a summary of a processed text. After extracting keywords from the processed text, the summary generation model combines these keywords to generate a summary that is as close to the original text as possible.
[0099] Furthermore, considering that the summary generation model needs to output both the text keywords corresponding to the to-be-processed text and the text summary corresponding to the to-be-processed text, the generation of the text summary and the determination of the text keywords can be implemented separately by two processing units in the summary generation model, as follows:
[0100] The text to be processed and the guidance text are input into the summary generation model, and at least one text keyword corresponding to the guidance text is extracted using the summary generation model; the summary generation unit included in the summary generation model is used to process the text to be processed and the at least one text keyword in the keyword dimension and the semantic dimension to obtain a text summary corresponding to the text to be processed.
[0101] Specifically, the summary generation model includes a keyword extraction unit and a summary generation unit; the keyword extraction unit is used to identify text keywords in the text to be processed, and extract text keywords corresponding to the guidance elements in the text to be processed according to the guidance elements contained in the guidance text; for example, the guidance elements in the guidance text are the time of the crime, the place of the crime, and the perpetrator, and accordingly, the text keywords are January 1, 20**, City A, and Zhang*; the summary generation unit is used to combine the determined text keywords and the guidance text to generate a brief overview of the text to be processed, that is, a text summary; the keyword dimension is the text keywords output by the keyword extraction unit, and the text keywords are used to guide the generation of text summaries; the semantic dimension includes but is not limited to the degree of sentence coherence and the logical relationship between each sentence.
[0102] Based on this, the text to be processed and the guidance text are input into the summary generation model. The text to be processed and the guidance text are input into the keyword extraction unit included in the summary generation model. The keyword extraction unit extracts the text keywords corresponding to each guidance element in the guidance text to obtain at least one text keyword corresponding to the text to be processed. The text to be processed and the at least one text keyword are input into the summary generation unit included in the summary generation model. The summary generation unit processes the text to be processed and the at least one text keyword in the keyword dimension and the semantic dimension to generate a text summary corresponding to the text to be processed.
[0103] Continuing with the above example, the legal documents of the criminal case and the guidance text related to the legal documents of the criminal case, "Please extract the time, location, tools, and perpetrators of the crime from the above legal documents, and generate a case summary based on this." are input into the summary generation model. The keyword extraction unit of the summary generation model extracts text keywords from the text to be processed based on the guidance elements such as the time, location, tools, and perpetrators in the guidance text; the text keyword text to be processed and the guidance text are input into the summary generation unit, and a text summary is generated after the case is sorted out and the language is organized based on the text keywords.
[0104] In summary, the keyword extraction unit and summary generation unit of the summary generation model sequentially process the target text and the guidance text to obtain the corresponding text keywords and text summary of the target text. The guidance text is then used to guide the generation of text summaries, improving the flexibility of text summary generation.
[0105] Furthermore, the training process of the summary generation model is specifically implemented as follows:
[0106] A training sample is obtained from a training sample set, and a sample text, a sample guidance text, a reference keyword, and a reference summary text contained in the training sample are determined; the sample text and the sample guidance text are input into an initial summary generation model to obtain a predicted keyword and a predicted summary text output by the initial summary generation model; a loss value is calculated based on the predicted keyword, the predicted summary text, the reference keyword, and the reference summary text, and parameters of the initial summary generation model are adjusted based on the loss value until a summary generation model that meets a training stop condition is obtained.
[0107] Specifically, the training sample set includes training samples for training the initial summary generation model; the training samples are composed of sample text, sample guidance text, reference keywords and reference summary text; the sample text is the text content of legal documents, papers, etc.; the sample guidance text is the instruction text corresponding to the sample text; the reference keyword refers to the keyword extracted from the sample text in advance based on the sample guidance text; the reference summary text is the summary obtained by pre-summarizing the sample text; the initial summary generation model refers to an untrained machine learning model, or refers to a trained summary generation model that requires supervised fine-tuning; the loss value represents the degree of difference between the predicted keywords, predicted summary text and the reference keywords, reference summary text.
[0108] Based on this, a training sample is obtained from the training sample set, and the sample text, sample guidance text, reference keywords and reference summary text contained in the training sample are determined. The sample text and sample guidance text are input into the initial summary generation model for prediction, and the predicted keywords and predicted summary text output by the initial summary generation model are obtained. The loss value is calculated based on the predicted keywords, predicted summary text, reference keywords and reference summary text, and the parameters of the initial summary generation model are adjusted based on the loss value. The next training sample is selected from the training sample set, and the initial summary generation model after parameter adjustment is trained until a summary generation model that meets the training stop condition is obtained. The training stop condition can be that the loss value reaches a preset loss value threshold, or it can be that the training of the initial summary generation model reaches a preset training round. This embodiment does not impose any limitation on the training stop condition.
[0109] In summary, the initial summary generation model is trained by the training samples in the training sample set, and then a summary generation model that meets the training stop condition is obtained, which is used for subsequent text summary generation to improve the efficiency of text summary generation.
[0110] Furthermore, considering that the training samples contain reference keywords and reference summary texts, and manually extracting reference keywords from the sample texts and determining the reference summary texts of the sample texts requires a lot of human resources, a large language model can be used to determine the reference keywords and reference summary texts. The specific implementation is as follows:
[0111] Determine the sample text and the sample guidance text associated with the sample text; input the sample text into a large language model to obtain initial keywords and initial summary text; correct the initial keywords and the initial summary text based on the sample text to obtain the reference keywords and the reference summary text; construct a training sample corresponding to the sample text based on the sample text, the sample guidance text, the reference keywords and the reference summary text.
[0112] Specifically, the large language model is a large-scale language model. The large language model takes sample text as input and outputs initial keywords and initial summary text corresponding to the sample text. It is used to extract the initial keywords contained in the sample text and generate the initial summary text corresponding to the sample text; correcting the initial keywords and initial summary text refers to adjusting the initial keywords and initial summary text output by the large language model according to the sample text, so that the corrected initial keywords and initial summary text have a higher matching degree with the sample text; the reference keyword is the keyword obtained after correcting the initial keyword; the reference summary text is the summary text obtained after correcting the initial summary text.
[0113] Based on this, a sample text and sample guidance text associated with the sample text are determined. The sample text is input into the large language model to obtain initial keywords and initial summary text output by the large language model. The initial keywords and initial summary text are corrected based on the sample text, and the sentences in the initial summary text are adjusted. The sample text is then aggregated to add, delete, and modify the obtained initial keywords to obtain corrected reference keywords and reference summary text. A training sample corresponding to the sample text is constructed based on the sample text, sample guidance text, reference keywords, and reference summary text.
[0114] Continuing with the previous example, after obtaining a legal document from a civil case, the document is fed into the large language model as sample text to predict keywords and summaries. After the large language model outputs the predicted initial keywords and initial summary, adjustments are made to the initial keywords by adding, deleting, or modifying them based on the keywords contained in the legal document. The output initial summary is also adjusted for semantics and sentence order. This constitutes the training sample for the legal document from the civil case.
[0115] In summary, the large language model is used to predict the initial keywords and initial summary text of the sample text, thereby improving the efficiency of constructing training samples.
[0116] Furthermore, considering that during the training of the initial summary generation model, in order to determine the progress of the model training, the initial summary generation model can be evaluated in real time. The specific implementation is as follows:
[0117] The sample text and the predicted summary text are respectively input into the evaluation model to obtain a first evaluation keyword corresponding to the sample text and a second evaluation keyword corresponding to the predicted summary text; the similarity between the first evaluation keyword and the second evaluation keyword is calculated, and similarity evaluation information of the initial summary generation model is determined based on the similarity.
[0118] Specifically, the evaluation model is used to extract keywords from the sample text and the predicted summary text respectively; the first evaluation keyword is the keyword obtained by extracting keywords from the sample text using the evaluation model; the second evaluation keyword is the keyword obtained by extracting keywords from the predicted summary text using the evaluation model; the similarity between the first evaluation keyword and the second evaluation keyword represents the similarity calculated in terms of the number of keywords and / or keyword content dimensions; the similarity evaluation information is used to indicate the predictive ability of the initial summary generation model to predict summary text and keywords; the similarity evaluation information can be a prediction score, and a higher prediction score indicates a stronger predictive ability of the summary generation model to predict summary text and keywords. The similarity evaluation information can also be text content.
[0119] Based on this, the sample text and predicted summary text are respectively input into the evaluation model. The evaluation model is used to extract keywords from the sample text and the predicted summary text, obtaining the first evaluation keyword corresponding to the sample text and the second evaluation keyword corresponding to the predicted summary text. The similarity between the first evaluation keyword and the second evaluation keyword is calculated in terms of keyword quantity and / or keyword content. Based on this similarity, similarity evaluation information for the initial summary generation model is determined.
[0120] Continuing with the above example, the sample text and the predicted summary text are input into the evaluation model respectively to obtain keywords 1, keyword 2, and keyword 3 corresponding to the sample text, as well as keywords 1, keyword 2, and keyword 3 corresponding to the predicted summary text; since the keywords corresponding to the sample text are the same as those corresponding to the predicted summary text, the similarity evaluation information can be scored as 10 points.
[0121] In summary, similarity evaluation information of the initial summary generation model is determined based on the sample text and the predicted summary text, thereby ensuring that the predicted summary text output by the initial summary generation model has a high degree of matching with the sample text.
[0122] Furthermore, considering that the sample guidance text is determined based on the sample text, the evaluation of the initial summary generation model can also be implemented based on the sample guidance text. The specific implementation is as follows:
[0123] Determining predicted summary keywords in the predicted summary text; calculating a matching degree between the predicted summary keywords and the sample guidance text; and determining matching evaluation information of the initial summary generation model based on the matching degree.
[0124] Specifically, the predicted summary keywords are the keywords contained in the predicted summary text; the matching evaluation information is used to indicate the predictive ability of the initial summary generation model in predicting the summary text; the matching evaluation information can be a prediction score, and a higher prediction score indicates a stronger predictive ability of the summary generation model in predicting the summary text. The matching evaluation information can also be text content.
[0125] Based on this, predictive summary keywords with representative attributes such as time, location, and person are extracted from the predicted summary text. The matching degree between the predicted summary keywords and the sample guidance elements in the sample guidance text is calculated. A high matching degree between the predicted summary keywords and the sample guidance text indicates a high degree of match between the predicted summary text and the sample text, and the generated predicted summary text is more suitable for summary generation requirements. Based on the matching degree, matching evaluation information for the initial summary generation model is determined.
[0126] Continuing with the previous example, we extract predictive summary keywords with representative attributes such as time, location, and person from the predicted summary text, obtaining the following: 18:00, February 2, 20**, District B, and Wang*. We then determine the sample guidance elements in the sample guidance text: time of crime, location of crime, and perpetrator. If the match between the predicted summary keywords and the sample guidance text is calculated as 10, the matching evaluation information for the initial summary generation model can be 10.
[0127] In summary, by calculating the matching degree between the predicted summary keywords and the sample guidance text, the matching evaluation information of the initial summary generation model is determined, thereby evaluating the initial summary generation model in the keyword dimension and improving the prediction ability of the initial summary generation model.
[0128] One embodiment of this specification obtains a text to be processed and determines a guidance text associated with the text to be processed; inputs the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, so that the guidance text is used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users.
[0129] The following combined Figure 3 , taking the application of the text processing method provided in this specification in the generation of legal document abstracts as an example, the text processing method is further explained. Figure 3 A flowchart of a text processing method provided in an embodiment of this specification is shown, which specifically includes the following steps.
[0130] Step 302: Determine a sample legal text and a sample guidance text associated with the sample legal text.
[0131] In legal contexts, legal professionals face a wide variety of legal documents and legal consultations, resulting in a significant amount of text processing. Furthermore, the focus of attention on the same text may vary depending on the context. Therefore, summarization in legal contexts can significantly improve the efficiency of legal professionals. By fine-tuning the original initial legal model, the model's flexibility in generating legal text summaries can be enhanced to meet the needs of diverse users.
[0132] In practical applications, such as Figure 4 As shown, before training the initial legal model, training samples must be generated. The legal documents or legal consultation conversations used to construct the training samples, as well as sample guidance text to assist in model training, are determined. The sample guidance text is the indicator text, for example: "Please extract the time, location, tools, and perpetrators of the case from the above judgment, and generate a case summary based on this information."
[0133] Step 304: Input the legal sample text into the large language model to obtain initial keywords and initial summary text.
[0134] Input the specified legal sample texts such as legal documents or legal consultation dialogues into the large language model for prediction, and predict the legal elements and legal summaries.
[0135] Step 306: Correct the initial keywords and the initial summary text based on the legal sample text to obtain reference keywords and reference summary text.
[0136] The legal elements and legal summaries predicted by the large language model are proofread manually or using a proofreading model to obtain corrected reference keywords and reference summary texts.
[0137] Step 308: Construct a training sample corresponding to the legal sample text based on the legal sample text, the sample guidance text, the reference keywords, and the reference summary text.
[0138] Step 310: Input the legal sample text and the sample guidance text into the initial legal model to obtain the predicted keywords and predicted summary text output by the initial legal model.
[0139] A chain of thought (CoT) approach is used to generate summaries. While generating the summaries, the values of corresponding legal elements are extracted from the legal sample text. This allows the initial legal model to better understand the user-selected sample guidance text and generate summaries that are as close to the actual situation in the legal sample text as possible.
[0140] Step 312: Input the legal sample text and the predicted summary text into the evaluation model respectively to obtain the first evaluation keyword corresponding to the legal sample text and the second evaluation keyword corresponding to the predicted summary text.
[0141] Step 314: Calculate the similarity between the first evaluation keyword and the second evaluation keyword, and determine the evaluation information of the initial legal model based on the similarity.
[0142] If the first and second evaluation keywords are identical, the element completeness is high. In addition to using the evaluation model, manual evaluation can also be performed to compare the first evaluation keyword in the legal sample text with the second evaluation keyword in the predicted summary text to determine if they are identical. The element completeness is then determined based on the comparison results.
[0143] Step 316: Adjust the parameters of the initial legal model based on the evaluation information until a legal model that meets the training stop conditions is obtained.
[0144] The initial legal model is trained using different training samples until a legal model that meets the training stop conditions is obtained.
[0145] In summary, when training the model, a training sample is constructed that includes legal sample text, sample guidance text, reference keywords, and reference summary text. Before predicting the summary text, the reference keywords are first determined based on the sample guidance text, and the sample guidance text is used to guide the generation of the text summary, thereby improving the accuracy of summary generation. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the legal model together with the text to be processed, so that the guidance text can be used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users.
[0146] Corresponding to the above method embodiment, this specification also provides a text processing device embodiment, Figure 5 FIG1 shows a schematic diagram of the structure of a text processing device provided by an embodiment of this specification. Figure 5 As shown, the device includes:
[0147] An acquisition module 502 is configured to acquire a text to be processed and determine a guidance text associated with the text to be processed;
[0148] The output module 504 is configured to input the text to be processed and the guidance text into the summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary.
[0149] In an optional embodiment, the output module 504 is further configured to:
[0150] The text to be processed and the guidance text are input into the summary generation model, and at least one text keyword corresponding to the guidance text is extracted by the keyword extraction unit included in the summary generation model; the summary generation unit included in the summary generation model is used to process the text to be processed and the at least one text keyword in the keyword dimension and the semantic dimension to obtain a text summary corresponding to the text to be processed.
[0151] In an optional embodiment, the output module 504 is further configured to:
[0152] A training sample is obtained from a training sample set, and a sample text, a sample guidance text, a reference keyword, and a reference summary text contained in the training sample are determined; the sample text and the sample guidance text are input into an initial summary generation model to obtain a predicted keyword and a predicted summary text output by the initial summary generation model; a loss value is calculated based on the predicted keyword, the predicted summary text, the reference keyword, and the reference summary text, and parameters of the initial summary generation model are adjusted based on the loss value until a summary generation model that meets a training stop condition is obtained.
[0153] In an optional embodiment, the output module 504 is further configured to:
[0154] Determine the sample text and the sample guidance text associated with the sample text; input the sample text into a large language model to obtain initial keywords and initial summary text; correct the initial keywords and the initial summary text based on the sample text to obtain the reference keywords and the reference summary text; construct a training sample corresponding to the sample text based on the sample text, the sample guidance text, the reference keywords and the reference summary text.
[0155] In an optional embodiment, the output module 504 is further configured to:
[0156] Inputting the sample text and the predicted summary text into the evaluation model respectively to obtain a first evaluation keyword corresponding to the sample text and a second evaluation keyword corresponding to the predicted summary text;
[0157] A similarity between the first evaluation keyword and the second evaluation keyword is calculated, and similarity evaluation information of the initial summary generation model is determined based on the similarity.
[0158] In an optional embodiment, the output module 504 is further configured to:
[0159] Determining predicted summary keywords in the predicted summary text; calculating a matching degree between the predicted summary keywords and the sample guidance text; and determining matching evaluation information of the initial summary generation model based on the matching degree.
[0160] In an optional embodiment, the acquisition module 502 is further configured to:
[0161] A text to be processed is acquired, and a text type of the text to be processed is determined; and a guidance text associated with the text to be processed is determined according to the text type.
[0162] In an optional embodiment, the acquisition module 502 is further configured to: search a guidance text list based on the text type; and determine the guidance text associated with the text to be processed according to the search result.
[0163] In summary, one embodiment of the present specification obtains a text to be processed and determines a guidance text associated with the text to be processed; the text to be processed and the guidance text are input into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, thereby using the guidance text to guide the generation of the text summary, improving the flexibility of text summary generation, and meeting the text summary generation needs of different users.
[0164] The above is a schematic diagram of a text processing device according to this embodiment. It should be noted that the technical solution of the text processing device and the technical solution of the above-mentioned text processing method are based on 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-mentioned text processing method.
[0165] See also Figure 6 , Figure 6 A flowchart of another text processing method provided according to an embodiment of this specification is shown, which specifically includes the following steps.
[0166] Step 602: Receive a text processing request submitted by the client;
[0167] Step 604: parsing the text processing request to obtain a text to be processed, and determining a guidance text associated with the text to be processed;
[0168] Step 606: Input the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary;
[0169] Step 608: Sending the text summary and at least one text keyword corresponding to the text to be processed to the client as feedback of the text processing request.
[0170] In actual applications, the law receives a text processing request submitted by a client; parses the text processing request to obtain the text to be processed, and determines the guidance text associated with the text to be processed; inputs the text to be processed and the guidance text into the summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary; the text summary and at least one text keyword corresponding to the text to be processed are sent to the client as feedback of the text processing request.
[0171] One embodiment of this specification obtains a text to be processed and determines a guidance text associated with the text to be processed; inputs the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, so that the guidance text is used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users.
[0172] Corresponding to the above method embodiment, this specification also provides a text processing device embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of another text processing device provided by an embodiment of this specification. Figure 7 As shown, the device includes:
[0173] The receiving module 702 is configured to receive a text processing request submitted by a client;
[0174] The parsing module 704 is configured to parse the text processing request to obtain a text to be processed, and determine a guidance text associated with the text to be processed;
[0175] An output module 706 is configured to input the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary;
[0176] The feedback module 708 is configured to send the text summary and at least one text keyword corresponding to the text to be processed to the client as feedback of the text processing request.
[0177] One embodiment of this specification obtains a text to be processed and determines a guidance text associated with the text to be processed; inputs the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, and the text summary is generated based on the text to be processed and each text keyword, and the guidance text is the text generated by the guidance text summary. While generating the text summary corresponding to the text to be processed, the text keywords corresponding to the text to be processed are output, thereby improving the readability of the text summary and reducing the probability of information loss during the text summary generation process; the guidance text associated with the text to be processed is input into the summary generation model along with the text to be processed, so that the guidance text is used to guide the generation of the text summary, thereby improving the flexibility of text summary generation and meeting the text summary generation needs of different users.
[0178] The above is a schematic diagram of another 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-mentioned text processing method are based on 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-mentioned text processing method.
[0179] See also Figure 8 , Figure 8 A flowchart of a legal document processing method provided according to an embodiment of this specification is shown, which specifically includes the following steps.
[0180] Step 802: Obtain a legal document to be processed, and determine a guiding legal document associated with the legal document to be processed;
[0181] Step 804: Input the legal document to be processed and the guiding legal document into the summary generation model to obtain the legal document summary and at least one legal document keyword corresponding to the legal document to be processed, wherein each legal document keyword is determined in the legal document to be processed based on the guiding legal document, and the legal document summary is generated based on the legal document to be processed and each legal document keyword, and the guiding legal document is a text that guides the generation of the legal document summary.
[0182] In practical applications, legal summaries can be generated for legal documents. The legal document or legal consultation dialogue for which summary generation is required is identified, along with the corresponding guiding legal document, i.e., the indicator word. The legal document and the guiding legal document are input into a summary generation model, which outputs a legal document summary and at least one legal document keyword. During the legal document summary generation process, the legal document keywords are first identified based on the guiding legal document. A legal document summary is then generated by combining the legal document keywords, the guiding legal document, and the legal document.
[0183] Furthermore, after generating a legal document summary and at least one legal document keyword corresponding to the pending legal document, the legal document summary and the at least one legal document keyword may be sent to a corresponding user. If the user has adjustment requirements, the legal document summary and the at least one legal document keyword corresponding to the pending legal document may be further adjusted according to the user's adjustment requirements. The specific implementation is as follows:
[0184] Receive adjustment information submitted by the user for the legal document summary and at least one legal document keyword corresponding to the legal document to be processed; adjust the legal document summary and the at least one legal document keyword based on the adjustment information, and feed back the adjustment results to the user.
[0185] In actual applications, after generating a legal document summary and at least one legal document keyword corresponding to the legal document to be processed, due to the influence of factors such as the processing capacity of the summary generation model, the generated legal document summary and at least one legal document keyword may be inaccurate and may not meet user needs. At this time, adjustment information submitted by the user for the legal document summary and at least one legal document keyword can be received, and the legal document summary and at least one legal document keyword can be adjusted according to the adjustment information, or the legal document summary can be adjusted according to the adjustment information, or at least one legal document keyword can be adjusted according to the adjustment information, so that the adjusted legal document summary and / or the at least one legal document keyword are fed back to the user as adjustment results. This achieves the adjustment of the legal document summary and / or the at least one legal document keyword according to user needs, improves the flexibility of processing the legal documents to be processed, and improves the user experience.
[0186] One embodiment of this specification obtains a pending legal document and determines a guiding legal document associated with the pending legal document; inputs the pending legal document and the guiding legal document into a summary generation model to obtain a legal document summary and at least one legal document keyword corresponding to the pending legal document, wherein each legal document keyword is determined in the pending legal document based on the guiding legal document, the legal document summary is generated based on the pending legal document and each legal document keyword, and the guiding legal document is the text generated by the guiding legal document summary. While generating the legal document summary corresponding to the pending legal document, the legal document keywords corresponding to the pending legal document are output, thereby improving the readability of the legal document summary and reducing the probability of information loss during the legal document summary generation process; the guiding legal document associated with the pending legal document is input into the summary generation model along with the pending legal document, thereby using the guiding legal document to guide the generation of the legal document summary, improving the flexibility of legal document summary generation, and meeting the legal document summary generation needs of different users.
[0187] The legal document summary and at least one legal document keyword are adjusted based on the adjustment information, or the legal document summary is adjusted based on the adjustment information, or at least one legal document keyword is adjusted based on the adjustment information, and the adjusted legal document summary and / or the at least one legal document keyword are fed back to the user as the adjustment result. This allows the legal document summary and / or the at least one legal document keyword to be adjusted based on user needs, improves the flexibility of processing pending legal documents, and enhances the user experience.
[0188] Corresponding to the above method embodiment, this specification also provides a legal document processing device embodiment, Figure 9 FIG1 shows a schematic diagram of the structure of a legal document processing device provided by an embodiment of this specification. Figure 9 As shown, the device includes:
[0189] An acquisition module 902 is configured to acquire a pending legal document and determine a guiding legal document associated with the pending legal document;
[0190] The output module 904 is configured to input the legal document to be processed and the guiding legal document into the summary generation model to obtain the legal document summary and at least one legal document keyword corresponding to the legal document to be processed, wherein each legal document keyword is determined in the legal document to be processed based on the guiding legal document, and the legal document summary is generated based on the legal document to be processed and each legal document keyword, and the guiding legal document is a text that guides the generation of the legal document summary.
[0191] One embodiment of this specification obtains a pending legal document and determines a guiding legal document associated with the pending legal document; inputs the pending legal document and the guiding legal document into a summary generation model to obtain a legal document summary and at least one legal document keyword corresponding to the pending legal document, wherein each legal document keyword is determined in the pending legal document based on the guiding legal document, the legal document summary is generated based on the pending legal document and each legal document keyword, and the guiding legal document is the text generated by the guiding legal document summary. While generating the legal document summary corresponding to the pending legal document, the legal document keywords corresponding to the pending legal document are output, thereby improving the readability of the legal document summary and reducing the probability of information loss during the legal document summary generation process; the guiding legal document associated with the pending legal document is input into the summary generation model along with the pending legal document, thereby using the guiding legal document to guide the generation of the legal document summary, improving the flexibility of legal document summary generation, and meeting the legal document summary generation needs of different users.
[0192] The above is a schematic diagram of a legal document processing device according to this embodiment. It should be noted that the technical solution of the legal document processing device and the technical solution of the aforementioned legal document processing method are based on the same concept. For details not described in detail in the technical solution of the legal document processing device, please refer to the description of the technical solution of the aforementioned legal document processing method.
[0193] See also Figure 10 , Figure 10 A flowchart of a summary generation model training method provided according to an embodiment of this specification is shown. The summary generation model training method is applied on the cloud side and specifically includes the following steps.
[0194] Step 1002: receiving a training sample set submitted by the receiving end;
[0195] Step 1004: obtaining a training sample from the training sample set, and determining the sample text, sample guidance text, reference keywords, and reference summary text contained in the training sample;
[0196] Step 1006: Input the sample text and the sample guidance text into the initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model;
[0197] Step 1008: Calculating a loss value based on the predicted keywords, the predicted summary text, the reference keywords, and the reference summary text, and adjusting parameters of the initial summary generation model based on the loss value until a summary generation model that meets a training stop condition is obtained;
[0198] Step 1010: Determine model parameters of the summary generation model that meet the training stop condition, and feed the model parameters back to the terminal side.
[0199] After the cloud side receives the training sample set submitted by the client side, it uses the training sample set to train the initial summary generation model until a summary generation model that meets the training stop conditions is obtained. The model parameters of the summary generation model that meets the training stop conditions are fed back to the client side, thereby providing the client side with summary generation model services.
[0200] Corresponding to the above method embodiment, this specification also provides an embodiment of a summary generation model training device, Figure 11 FIG1 shows a schematic diagram of a structure of a summary generation model training device provided by an embodiment of this specification. Figure 11 As shown, the device includes:
[0201] The receiving module 1102 is configured to receive a training sample set submitted by the terminal side;
[0202] The acquisition module 1104 is configured to acquire a training sample from the training sample set and determine the sample text, sample guidance text, reference keywords and reference summary text contained in the training sample;
[0203] An input module 1106 is configured to input the sample text and the sample guidance text into an initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model;
[0204] A training module 1108 is configured to calculate a loss value based on the predicted keywords, the predicted summary text, the reference keywords, and the reference summary text, and adjust parameters of the initial summary generation model based on the loss value until a summary generation model that meets a training stop condition is obtained;
[0205] The feedback module 1110 is configured to determine model parameters of the summary generation model that meet the training stop condition and feed back the model parameters to the terminal side.
[0206] After the cloud side receives the training sample set submitted by the client side, it uses the training sample set to train the initial summary generation model until a summary generation model that meets the training stop conditions is obtained. The model parameters of the summary generation model that meets the training stop conditions are fed back to the client side, thereby providing the client side with summary generation model services.
[0207] The above is a schematic diagram of a summary generation model training device according to this embodiment. It should be noted that the technical solution of this summary generation model training device and the technical solution of the summary generation model training method described above are based on the same concept. For details not described in detail in the technical solution of the summary generation model training device, please refer to the description of the technical solution of the summary generation model training method described above.
[0208] Figure 12 The following is a block diagram of a computing device 1200 according to one embodiment of the present disclosure. Components of the computing device 1200 include, but are not limited to, a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and a database 1250 is used to store data.
[0209] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1240 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.
[0210] In one embodiment of the present specification, the above components of the computing device 1200 and Figure 12 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 12 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0211] Computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1200 may also be a mobile or stationary server.
[0212] The processor 1220 is configured to execute the following computer-executable instructions, which implement the steps of the above method when executed by the processor.
[0213] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above 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 method.
[0214] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the above method when executed by a processor.
[0215] The above is a schematic solution of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above method belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above method.
[0216] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above method.
[0217] An embodiment of the present specification further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0218] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above method belong to the same concept, and any details not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above method.
[0219] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0220] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0221] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0222] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0223] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can 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: Acquire a text to be processed, and determine a guidance text associated with the text to be processed; The text to be processed and the guidance text are input into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary.
2. The text processing method according to claim 1, wherein the step of inputting the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed comprises: Inputting the to-be-processed text and the guidance text into the summary generation model, and extracting at least one text keyword corresponding to the guidance text using the summary generation model; The text to be processed and the at least one text keyword are processed in a keyword dimension and a semantic dimension to obtain a text summary corresponding to the text to be processed.
3. The text processing method according to claim 1, wherein the training of the summary generation model comprises: Acquire a training sample from a training sample set, and determine the sample text, sample guidance text, reference keywords, and reference summary text contained in the training sample; Inputting the sample text and the sample guidance text into an initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model; A loss value is calculated based on the predicted keywords, the predicted summary text, the reference keywords and the reference summary text, and the parameters of the initial summary generation model are adjusted based on the loss value until a summary generation model that meets the training stop condition is obtained.
4. The text processing method according to claim 3, wherein the construction of the training sample comprises: Determining the sample text and the sample guidance text associated with the sample text; Inputting the sample text into a large language model to obtain initial keywords and initial summary text; Correcting the initial keywords and the initial summary text based on the sample text to obtain the reference keywords and the reference summary text; A training sample corresponding to the sample text is constructed based on the sample text, the sample guidance text, the reference keywords and the reference summary text.
5. The text processing method according to claim 3, further comprising: after inputting the sample text and the sample guidance text into an initial summary generation model and obtaining the predicted keywords and predicted summary text output by the initial summary generation model; Inputting the sample text and the predicted summary text into the evaluation model respectively to obtain a first evaluation keyword corresponding to the sample text and a second evaluation keyword corresponding to the predicted summary text; A similarity between the first evaluation keyword and the second evaluation keyword is calculated, and similarity evaluation information of the initial summary generation model is determined based on the similarity.
6. The text processing method according to claim 3, further comprising: after inputting the sample text and the sample guidance text into an initial summary generation model and obtaining the predicted keywords and predicted summary text output by the initial summary generation model; determining predicted summary keywords in the predicted summary text; Calculating the matching degree between the predicted summary keywords and the sample guidance text; Matching evaluation information of the initial summary generation model is determined based on the matching degree.
7. The text processing method according to claim 1, wherein obtaining the text to be processed and determining the guidance text associated with the text to be processed comprises: Acquire a text to be processed and determine the text type of the text to be processed; A guidance text associated with the text to be processed is determined according to the text type.
8. The text processing method according to claim 7, wherein determining the guidance text associated with the text to be processed according to the text type comprises: searching a list of guidance texts based on the text type; Determine the guidance text associated with the text to be processed based on the search result.
9. A text processing method, comprising: Receive text processing requests submitted by the client; Parsing the text processing request to obtain a text to be processed, and determining a guidance text associated with the text to be processed; Inputting the text to be processed and the guidance text into a summary generation model to obtain a text summary and at least one text keyword corresponding to the text to be processed, wherein each text keyword is determined in the text to be processed based on the guidance text, the text summary is generated based on the text to be processed and each text keyword, and the guidance text is a text that guides the generation of the text summary; A text summary and at least one text keyword corresponding to the text to be processed are sent to the client as feedback of the text processing request.
10. A method for processing legal documents, comprising: Obtaining a pending legal document and determining a guiding legal document associated with the pending legal document; The legal document to be processed and the guiding legal document are input into a summary generation model to obtain a legal document summary and at least one legal document keyword corresponding to the legal document to be processed, wherein each legal document keyword is determined in the legal document to be processed based on the guiding legal document, and the legal document summary is generated based on the legal document to be processed and each legal document keyword, and the guiding legal document is a text that guides the generation of the legal document summary.
11. The legal document processing method according to claim 10, further comprising: receiving adjustment information submitted by a user for a legal document summary and at least one legal document keyword corresponding to the legal document to be processed; The legal document summary and the at least one legal document keyword are adjusted respectively based on the adjustment information, and the adjustment results are fed back to the user.
12. A summary generation model training method, applied to the cloud side, comprising: The training sample set submitted by the receiving end; Acquire a training sample from a training sample set, and determine the sample text, sample guidance text, reference keywords, and reference summary text contained in the training sample; Inputting the sample text and the sample guidance text into an initial summary generation model to obtain predicted keywords and predicted summary text output by the initial summary generation model; Calculating a loss value based on the predicted keywords, the predicted summary text, the reference keywords, and the reference summary text, and adjusting parameters of the initial summary generation model based on the loss value until a summary generation model that meets a training stop condition is obtained; Determine model parameters of the summary generation model that meet the training stop condition, and feed the model parameters back to the terminal side.
13. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 12 are implemented.
14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program or instructions, which implement the steps of the method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Patent Citations
Abstract text generation method and device, storage medium and computer device
CN110069623A
Method for generating text abstract and method and device for training abstract generation model
CN116186244A
Abstract generation method and device, equipment, storage medium and product
CN116894089A
Text abstract generation method and device, equipment and storage medium
CN116955595A