A method and system for generating an abstract of a judicial ruling document
Patent Information
- Application Number
- CN202311451427.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2043-11-02
AI Technical Summary
[0005]本发明所要解决的技术问题是现有司法裁判文书摘要生成方法没有结合司法裁判文书的论辩结构特性,存在模型输入长度限制造成的信息丢失问题以及粗略截断造成的上下文信息不连贯等问题
[0048]本发明一种针对司法裁判文书的摘要生成方法及系统,首先,基于司法裁判文书的论辩结构对文本进行段落提取,缩短文本长度;其次,在每个论辩结构段落内分别进行关键句抽取,进一步缩短文本长度;然后利用生成式模型进行内容重写,生成子摘要;最后将每个论辩结构对应的子摘要拼接,生成最终的司法裁判文书摘要。本发明能够解决模型输入长度限制造成的信息丢失问题以及粗略截断造成的上下文信息不连贯问题。本发明方法基于裁判文书的论辩结构对文本长度进行缩减,一方面缓解了模型输入限制对文本长度的影响,另一方面保证了摘要的内容完整性和连续性,符合裁判文书原文的论辩结构,更具逻辑性和忠实度。
Smart Images

Figure CN117435725B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of judicial judgment document data processing technology, specifically to a method and system for generating summaries of judicial judgment documents. Background Technology
[0002] With the rapid development of the information age, the amount of data on the internet is growing exponentially. Text summarization uses various technologies to extract, summarize, and refine the content of text, enabling the processed content to summarize and present the main content or main ideas of the original text. High-quality summaries play an important role in information retrieval. For example, using abstracts instead of the original article in indexing can effectively shorten retrieval time and reduce redundant information in search results, allowing users to efficiently obtain the information they need from large amounts of data. With the advent of the information explosion era, summarization has gradually become an important research topic in the field of natural language processing.
[0003] In the judicial field, judgments are crucial carriers of the people's courts' public trial activities, reasoning, legal basis, and outcomes. They also serve as important evidence for sentencing decisions and for standardizing judgment criteria. In recent years, the requirement for judgment summaries has mandated the compression, summarization, and generalization of judgment content to reflect the argumentative structure of the trial process, facts, reasoning, and legal basis. This is of practical significance and necessity for the development of the rule of law in my country. However, with over 120 million publicly available judgments, how to automatically extract key information from these documents through technological means is a pressing issue. Automatic summarization technology can condense and refine lengthy judicial judgments, summarizing the key content of lengthy original texts in concise summaries, thus providing an important means to address the problem of information overload.
[0004] Currently, there are two main technical approaches in the field of text summarization: extractive text summarization and generative text summarization. Extractive methods select keywords and key sentences from the original text to construct a summary. This method has a low error rate in terms of syntax and grammar, but suffers from problems such as content selection errors, poor coherence, and limited flexibility. Generative summarization, based on the original text, allows the generation of new words and phrases to form the summary, offering greater flexibility in word choice, but it is prone to generating content that contradicts the main idea of the original text. A hybrid summarization method, combining extractive and generative techniques, integrates the advantages of both technologies. Extractive techniques locate important content, while generative techniques rewrite the original sentences to generate a coherent and fluent text summary, making it particularly suitable for summarizing long texts. While hybrid summarization methods can alleviate the problem of information loss to some extent, current deep learning-based generative summarization models still have significant limitations on the length of the input text, affecting the completeness of extracting important content from long texts. Trunculating and concatenating long texts can solve the input length limitation problem, but for texts with argumentative structures, such as legal documents, rough truncation may lead to discontinuity of important content, resulting in the loss of contextual information. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that existing methods for generating summaries of judicial judgments do not take into account the argumentative structure of judicial judgments, and suffer from problems such as information loss due to model input length limitations and incoherent contextual information caused by coarse truncation.
[0006] The purpose of this invention is to provide a method and system for generating summaries of judicial judgments. First, based on the argumentative structure of the judicial judgment, paragraphs are extracted from the text to shorten its length. Second, key sentences are extracted from each argumentative paragraph to further shorten the text length. Then, a generative model is used to rewrite the content, generating sub-summaries. Finally, the sub-summaries corresponding to each argumentative structure are concatenated to generate the final summary of the judicial judgment. This invention can solve the problems of information loss caused by model input length limitations and the incoherence of contextual information caused by coarse truncation.
[0007] This invention is achieved through the following technical solution:
[0008] In a first aspect, the present invention provides a method for generating summaries of judicial judgments, the method comprising:
[0009] Based on the argumentative structure of judicial judgments, the texts are divided into paragraphs, resulting in sections for claims, defendant's arguments, findings of fact, and judgment, thus initially shortening the length of judicial judgments.
[0010] By combining the BERT and GCN models, key sentences are extracted from each argument structure paragraph, and these key sentences are combined into a key sentence set, further shortening the text length of judicial judgment documents.
[0011] The set of key sentences is input into the generative model, and the content is rewritten using the generative model to generate sub-summaries for each argumentative structure paragraph.
[0012] By concatenating the sub-summaries corresponding to each argument structure, the final summary of the judicial judgment document is generated.
[0013] Furthermore, based on the argumentative structure of judicial judgments, judicial judgments are divided into paragraphs, including:
[0014] Identify and skip the basic information of judicial judgments, read the content of judicial judgments sentence by sentence, and identify keywords (in string form) that feature the argumentative structure; the basic information of judicial judgments includes the court name, case number, etc.
[0015] If the sentence contains keywords characteristic of the argumentative structure, then the sentence shall be used as the starting sentence of the argumentative structure.
[0016] Read sentences from the beginning sentence until the subsequent sentence triggers the key features of the next argument structure; and take the sentences from the previous beginning sentence to the beginning sentence of the current argument structure as the previous argument structure paragraph.
[0017] Follow the steps above until you have read all the judicial documents, and finally obtain the paragraphs corresponding to the four argumentative structures.
[0018] Furthermore, by combining the BERT and GCN models, key sentences are extracted from each argumentative structure paragraph, and these key sentences are grouped into a set of key sentences, including:
[0019] The ROUGE evaluation metric was used to select key sentences, and the BERT model was used to extract single-sentence features from each argumentative paragraph to obtain the feature vector of a single sentence.
[0020] Based on the feature vectors, BERT and GCN are jointly trained to obtain a trained extractive model.
[0021] An extraction model is used to extract key sentences from the argumentative paragraphs of judicial judgments, that is, to extract key sentences from the original text of the paragraphs. i In the input extraction model, key sentences are selected based on the labels predicted by the extraction model to construct a key sentence set D. ki Collection of key sentences from the original text of the argumentative paragraphs.
[0022] Furthermore, key sentences were selected using ROUGE evaluation metrics, including:
[0023] Construct an empty set S for each argument paragraph.i From the original text of the argumentative paragraph D i ={x1,x2,…,x n Select sentence x in} j ;
[0024] Calculate sentence x j Summary of Argumentation Paragraphs Y i The average of the ROUGE-1, ROUGE-2, and ROUGE-L scores makes the selected sentence x j With set S i The sentences in the set S can be maximized by concatenating them. i ={x s1 ,x s2 ,…,x sm} and the summary of the argument paragraphs Y i The mean of ROUGE;
[0025] Thus, the original text D for each argument paragraph is constructed. i - Key sentence set dataset, where the key sentences in the key sentence set have a label of 1 in the original text.
[0026] Furthermore, the BERT model is used to extract single-sentence features from each argumentative paragraph, resulting in a single-sentence feature vector, including:
[0027] In the original text of the argumentative paragraph D i The single sentence x j Insert the [CLS] symbol before the sentence and then add the single sentence x after the [CLS] symbol. cls,j Input into the BERT model;
[0028] The features of each sentence are extracted using the BERT model, resulting in the output vector L of the [CLS] character for each sentence. cls , as the feature vector of a single sentence;
[0029] The feature vector of a single sentence is represented as: L cls =BERT(x cls,j ).
[0030] Furthermore, the BERT model includes an input layer, hidden layers, and an output layer; the hidden layer has 12 layers, including an attention layer, intermediate layers, and a hidden output layer;
[0031] The BERT model obtains word vectors from the text data through the input layer as the output vector; the attention layer uses a 12-head multi-head attention mechanism to obtain an attention score, which is then added to the output of the previous hidden layer as the output; the output of the attention layer is connected to a fully connected layer, and then the GELU activation function is used to obtain the output of the intermediate layer; the hidden output layer performs fully connected, Dropout, and Norm operations on the output of the intermediate layer to obtain the output of the entire hidden layer; the above hidden layer operations are repeated 12 times to finally obtain the output of the BERT model.
[0032] Furthermore, the GCN model is trained using a binary model to obtain a trained extractive model, including:
[0033] The [CLS] output vector L of all sentences in the original text cls Treating nodes as nodes in the GCN model, construct a fully connected graph G. i And calculate and construct the affinity matrix W i ;
[0034] The affinity matrix W i Weight normalization yields the fully connected graph G. i Weight matrix A i =Softmax(W i );
[0035] By leveraging the GCN model to infer relationships between nodes, a two-layer GCN model structure is constructed to calculate the probability of each node belonging to a binary classification. The first layer uses ReLU as the activation function, and the second layer uses Softmax as the activation function, resulting in the inferred feature matrix H. i ;
[0036] At each labeled node, the loss is calculated using cross-entropy to obtain the trained extractive model.
[0037] Furthermore, the set of key sentences is input into the generative model, which is then used to rewrite the content, generating sub-summaries for each argumentative structure paragraph, including:
[0038] S31. Select the PEGASUS model as the generation model, merge the constructed original text of the argument paragraph - summary of the argument paragraph with the constructed original text of the argument paragraph - set of key sentences to obtain the set of key sentences - summary of the argument paragraph; fine-tune the PEGASUS model based on the set of key sentences - summary of the argument paragraph to obtain the fine-tuned judicial summary PEGASUS model.
[0039] S32, Set the key sentences D ki The fine-tuned judicial summary PEGASUS model is input into the model, and the content is rewritten using the fine-tuned judicial summary PEGASUS model. Finally, the sub-summary of the argument paragraphs Y is output.ki , represented as: Y ki =PEGASUS(D ki ).
[0040] Furthermore, the PEGASUS model has a maximum input of 1024 bytes, a total of 16 layers, a hidden layer size of 4096, and a multi-head attention mechanism with 16 heads.
[0041] The PEGASUS model consists of an encoder and a decoder. The encoder includes an input layer and a hidden layer. The hidden layer predicts the characters of the random mask and extracts text features. The output of the last hidden layer of the encoder is used as the input of the decoder. The decoder includes an input layer, a hidden layer, and an output layer. It uses the output of the last hidden layer of the encoder to predict the sentence of the random mask word by word.
[0042] Secondly, the present invention provides a system for generating summaries of judicial judgments, which uses the aforementioned method for generating summaries of judicial judgments; the system includes:
[0043] The argument structure division unit is used to divide judicial judgment documents into paragraphs based on the argument structure of the judicial judgment documents, resulting in the litigation request section, the defendant's defense section, the investigation findings section, and the judgment result section;
[0044] The key sentence set extraction unit is used to extract key sentences from each argument structure paragraph by combining the BERT model and the GCN model, and to form a key sentence set from each key sentence.
[0045] The sub-summary generation unit is used to input the set of key sentences into the generation model, and use the generation model to rewrite the content to generate sub-summaries for each argument structure paragraph;
[0046] The sub-summary splicing unit is used to splice the sub-summaries corresponding to each argument structure to generate the final judicial judgment document summary.
[0047] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0048] This invention discloses a method and system for generating summaries of judicial judgments. First, based on the argumentative structure of the judicial judgment, paragraphs are extracted from the text to shorten its length. Second, key sentences are extracted from each argumentative paragraph to further shorten the text length. Then, a generative model is used to rewrite the content, generating sub-summaries. Finally, the sub-summaries corresponding to each argumentative structure are concatenated to generate the final summary of the judicial judgment. This invention solves the problems of information loss caused by model input length limitations and the incoherence of contextual information caused by coarse truncation. The method of this invention reduces the text length based on the argumentative structure of the judgment, mitigating the impact of model input limitations on text length while ensuring the completeness and continuity of the summary content, conforming to the argumentative structure of the original judgment, and thus being more logical and faithful.
[0049] (1) This invention divides judicial judgment documents according to the argumentation structure, which can maximize the integrity of the content and structure of judicial judgment documents, reduce the text length, and avoid the problem of incomplete loading of the original text due to the limitation of the model input length.
[0050] (2) This invention combines the BERT model, GCN model, and PEGASUS model to address the impact of model input or output limitations on long text summarization. The BERT model is used to extract features from single sentences, which can effectively avoid the model input length limitation since the length of a single sentence is often limited. The GCN model is used for reasoning and classification, which can make up for the defect of the BERT model in being unable to capture the contextual semantics between single sentences due to extracting features from single sentences. The PEGASUS model is used as the generation model, with a maximum input length of up to 1024 bytes, which can alleviate the problem of incomplete content rewriting caused by excessively long documents. Attached Figure Description
[0051] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0052] Figure 1 This is a flowchart of a method for generating summaries of judicial judgment documents according to the present invention;
[0053] Figure 2 This is a detailed flowchart of a method for generating summaries of judicial judgment documents according to the present invention;
[0054] Figure 3 This is a block diagram of a system for generating summaries of judicial judgment documents according to the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0056] Existing hybrid long text summarization models typically employ an extraction + generation approach. However, both extraction and generation models are mostly built upon pre-trained models such as BERT, GPT, and BART. Some of these models are suitable for text understanding, excelling in the extraction stage (e.g., BERT), while others are better suited for text generation (e.g., GPT). A common problem with these pre-trained models is the limitation on input and output length. For example, BERT's input is typically limited to 512 bytes, and GPT's output is usually limited to 256 bytes. However, long texts in the legal field can range from hundreds to tens of thousands of words, exceeding the model's input limitations and thus failing to solve the problem of long text summarization in the legal domain.
[0057] In existing technologies, when the model input is too long, the usual solution is to truncate the input text. However, this may result in the loss of the text's contextual semantics. This is especially true in the judicial field, where judgments are highly logical and have distinct argumentative structures. If the text is not properly truncated within a certain argumentative paragraph, it may lead to incomplete understanding of the paragraph's semantics, resulting in the final summary text deviating from the facts.
[0058] Based on this, the present invention addresses the impact of model input or output limitations on long text summarization. First, a preset rule is constructed to extract the argumentative structure of judicial documents, roughly divided into four parts, thus initially shortening the text length. Since the content elaborated in each argumentative paragraph of a judicial document is relatively independent, dividing the text by argumentative structure, compared to truncation, can maximize the coherence of the document summary.
[0059] Then, based on the text understanding capabilities of the BERT model, this invention uses each argument structure as input to the BERT model separately. Unlike the previous two-segment hybrid method that directly uses the entire argument structure paragraph as input to the BERT model (which still has the problem of length limitation, as real-world judgment documents contain paragraphs of thousands of words), this invention uses the sentences within each argument structure paragraph as input to the BERT model separately to obtain the semantic features of each sentence. However, this is only the semantic understanding of a single sentence in the text by the BERT model, and does not capture the contextual semantics within each argument structure paragraph.
[0060] Next, conventional extraction models, after using a BERT-like model for semantic understanding of paragraphs, would fine-tune the process, such as performing binary classification after the BERT model output, to directly extract key sentences. Considering that the input to the BERT model in this invention is a single sentence, direct binary classification does not consider the context and may lead to random classification results. To address this issue, this invention employs a GCN model, which can better capture the relationship structure between features. This invention constructs a fully connected graph from the single-sentence semantic features obtained from BERT for each argumentative paragraph, and uses the GCN model to infer the relationship structure of this fully connected graph, fusing the contextual semantics into the features of each single sentence. Then, based on the GCN inference results, each single sentence is binary classified, and important sentences are selected to complete the key sentence extraction operation. Thus, this invention can obtain four sets of key sentences for four argumentative paragraphs.
[0061] Considering the advantages of the PEGASUS model compared to other generative models—its input limitation of up to 1024 bytes and its unique training method making it more suitable for summary generation—previous methods would directly use the entire text as input to the model, leveraging PEGASUS's input length advantage to generate corresponding summary text. While this approach avoids the loss of important information during extraction, it still cannot solve the problem of long text lengths, and not all information in long texts is useful; extraction methods can still filter out some irrelevant content, ensuring the authenticity of the summary. Therefore, PEGASUS is used in the generation stage of this invention. This invention uses the set of key sentences obtained from the extraction stage for each argumentative structure paragraph as input to the PEGASUS model, and finally concatenates the four generated paragraph summaries to form the complete court document summary.
[0062] The advantage of this invention, which divides and inputs arguments according to their structure, is that it eliminates the limitation of model input length. Furthermore, since the output of the generated model also has length limitations, inputting them separately avoids excessive compression of the summary due to model output length constraints, thus preventing the loss of important textual information. By adjusting the model's output length, the proportion of each argument structure paragraph in the final summary can also be flexibly controlled.
[0063] Example 1
[0064] like Figure 1 and Figure 2 As shown, the present invention provides a method for generating summaries of judicial judgment documents, the method comprising:
[0065] S1, based on the argumentative structure of judicial judgment documents, divide the judicial judgment documents into paragraphs to obtain the litigation request section, the defendant's defense section, the investigation findings section, and the judgment result section; step S1 initially shortens the text length of judicial judgment documents;
[0066] The specific identification rules during the segmentation process in S1 are as follows:
[0067] The statement of claims section includes phrases such as "...states the claim," "requests...", and "requests...".
[0068] The defendant's defense includes phrases such as "The defendant argued...".
[0069] The section on ascertainment during the trial includes phrases such as "Ascertained during the trial..." and "This court holds...".
[0070] The judgment results section includes phrases such as "The judgment is as follows..." or "The ruling is as follows...".
[0071] In this embodiment, the judicial judgment document is divided into paragraphs based on its argumentative structure. The specific steps are as follows:
[0072] Identify and skip basic information such as the court name and case number in judicial judgment documents, read the content of judicial judgment documents sentence by sentence, and identify keywords (in string form) that feature the argumentative structure;
[0073] If the sentence contains keywords characteristic of the argumentative structure, then the sentence shall be used as the starting sentence of the argumentative structure.
[0074] Read sentences from the beginning sentence until the subsequent sentence triggers the key features of the next argument structure; and take the sentences from the previous beginning sentence to the beginning sentence of the current argument structure as the previous argument structure paragraph.
[0075] Follow the steps above until you have read all the judicial documents, and finally obtain the paragraphs corresponding to the four argumentative structures.
[0076] S2, combining the BERT model and GCN model to extract key sentences from each argument structure paragraph, and forming a key sentence set; step S2 further shortens the text length of judicial judgment documents;
[0077] Step S2 includes:
[0078] The ROUGE evaluation metric was used to select key sentences, and the BERT model was used to extract single-sentence features from each argumentative paragraph to obtain the feature vector of a single sentence.
[0079] Based on the feature vectors, BERT and GCN are jointly trained to obtain a trained extractive model.
[0080] An extraction model is used to extract key sentences from the argumentative paragraphs of judicial judgments. The original text of the paragraph is input into the extraction model, and key sentences are selected based on the labels predicted by the extraction model. This constructs a set of key sentences and a set of original text and key sentences from the argumentative paragraph.
[0081] In this embodiment, the implementation steps of step S2 are as follows:
[0082] S21. Select a relevant dataset of judicial abstracts (such as the 2020 Legal Research Cup) as training data. According to the paragraph segmentation method in S1, divide the original text D and abstract Y in the training set into argumentative structure paragraphs to construct the original text D of the argumentative paragraphs. i - Argumentation paragraph summary Y i The dataset contains four different argument paragraphs, where i = 1, 2, 3, 4.
[0083] S22. Using the ROUGE evaluation index as the standard for selecting key sentences, construct an empty set S for each argumentative paragraph. i From the original text of the argumentative paragraph D i ={x1,x2,…,x n Select sentence x in} j ; Calculate sentence x j Summary of Argumentation Paragraphs Y i The average of the ROUGE-1, ROUGE-2, and ROUGE-L scores makes the selected sentence x j With set S i The sentences in the set S can be maximized by concatenating them. i ={x s1 ,x s2 ,…,x sm} and the summary of the argument paragraphs Y i The ROUGE mean; thus constructing the original text D for each argument paragraph. i - Key sentence set dataset, where the key sentences in the key sentence set have a label of 1 in the original text.
[0084] S23. Use the BERT model to encode the text (i.e., extract features) in the original text of the argumentative paragraph D. i The single sentence x j Insert the [CLS] symbol before the x symbol, and then set the x after the inserted [CLS] symbol to... cls,j The BERT model is input to extract features from each sentence, resulting in an output vector L of the [CLS] characters for each sentence. cls As a feature vector of a single sentence, it is represented as:
[0085] L cls =BERT(x cls,j (1)
[0086] The BERT model used in this embodiment has a total of 110M parameters, including an input layer, hidden layers, and an output layer. The input layer obtains the token embeddings of the text data as the output vector. The hidden layer has 12 layers, which can be divided into an attention layer, an intermediate layer, and an output layer. The attention layer uses a 12-head multi-head attention mechanism to obtain an attention score, which is then added to the output of the previous hidden layer as the output. The output of the attention layer is connected to a fully connected layer, and then the GELU activation function is used to obtain the output of the intermediate layer. The output layer performs fully connected, Dropout, and Norm operations on the output of the intermediate layer to obtain the output of the entire hidden layer. This process of performing hidden layer operations 12 times yields the final output of the BERT model.
[0087] S24. Apply the GCN model to feature vector classification, and output the [CLS] vector L of all sentences in the original text. cls Treating nodes as nodes in the GCN model, construct a fully connected graph G. i And calculate and construct the affinity matrix W i Among them, the affinity w between nodes jk The cosine similarity between node feature vectors is obtained by calculating the following formula:
[0088]
[0089] The affinity matrix W i Weight normalization yields G i Weight matrix A i =Softmax(W i This paper utilizes the GCN model to infer the relationships between nodes. A two-layer GCN model structure is constructed to calculate the probability of each node belonging to a binary classification. The first layer uses ReLU as the activation function, and the second layer uses Softmax as the activation function. Finally, the inferred feature matrix H is obtained. i The formula is as follows:
[0090] H i =Softmax(A i ReLU(A i Z i W 0 W 1 (3)
[0091] Among them, Z i ={L1,L2,…,L n}, W 0,1 This is the training parameter matrix.
[0092] Then, at each labeled node, the loss is calculated using cross-entropy. The formula is as follows:
[0093]
[0094] in, This represents a set of labeled documents, and F represents the dimension of the output features, which is equivalent to the number of categories.
[0095] S25. Use the extraction model trained in S24 to extract key sentences from the argumentative paragraphs of judicial judgments. Input the original paragraph text D. i Key sentences are selected based on the labels predicted by the extraction model, and a key sentence set D is constructed. ki .
[0096] S3, input the set of key sentences into the generative model, use the generative model to rewrite the content, and generate sub-summaries for each argument structure paragraph;
[0097] Step S3 specifically includes:
[0098] S31. Select the PEGASUS model as the generation model, merge the original text of the argument paragraph and the summary of the argument paragraph constructed in step S21 with the original text of the argument paragraph and the set of key sentences constructed in step S2 to obtain the set of key sentences and the summary of the argument paragraph; fine-tune the PEGASUS model according to the set of key sentences and the summary of the argument paragraph to obtain the fine-tuned judicial summary PEGASUS model.
[0099] S32. Take the set of key sentences D obtained in step S24. ki The fine-tuned judicial summary PEGASUS model is input into the model, and the content is rewritten using the fine-tuned judicial summary PEGASUS model. Finally, the sub-summary of the argument paragraphs Y is output. ki , is represented as:
[0100] Y ki =PEGASUS(D ki (5)
[0101] The PEGASUS model used in this embodiment has a total of 523M parameters, belonging to a typical encoder-decoder structure. Its maximum input is 1024 bytes, with 16 layers, a hidden layer size of 4096, and 16 heads for the multi-head attention mechanism. The difference between the PEGASUS model and the BERT model lies in their pre-training objective. The pre-training objective of the PEGASUS model is GSG (Gap Sentences Generation), where the random mask includes both characters and sentences. Therefore, this model is more suitable for summarization tasks.
[0102] The PEGASUS model in this embodiment includes an encoder and a decoder; the encoder includes an input layer and a hidden layer, predicts characters of a random mask and extracts text features through the hidden layer, and the output of the last hidden layer of the encoder is used as the input of the decoder; the decoder includes an input layer, a hidden layer and an output layer, and uses the output of the last hidden layer of the encoder to predict the sentence of the random mask word by word.
[0103] S4 concatenates the sub-summaries corresponding to each argument structure to generate the final judicial judgment document summary.
[0104] Step S4 concatenates the sub-summaries of the four argument paragraphs obtained in S32 to form the final summary of a judicial judgment document, represented as follows:
[0105] Y = Concat(Y) k1 ||Y k2 ||Y k3 ||Y k4 (6)
[0106] The method of this invention reduces the text length based on the argumentative structure of the judgment document. On the one hand, it alleviates the impact of model input limitations on text length, and on the other hand, it ensures the integrity and continuity of the summary content, conforms to the argumentative structure of the original judgment document, and is more logical and faithful.
[0107] Example 2
[0108] like Figure 3 As shown, the difference between this embodiment and Embodiment 1 is that this embodiment provides a summary generation system for judicial judgment documents, which uses a summary generation method for judicial judgment documents from Embodiment 1; the system includes:
[0109] The argument structure division unit is used to divide judicial judgment documents into paragraphs based on the argument structure of the judicial judgment documents, resulting in the litigation request section, the defendant's defense section, the investigation findings section, and the judgment result section;
[0110] The key sentence set extraction unit is used to extract key sentences from each argument structure paragraph by combining the BERT model and the GCN model, and to form a key sentence set from each key sentence.
[0111] The sub-summary generation unit is used to input the set of key sentences into the generation model, and use the generation model to rewrite the content to generate sub-summaries for each argument structure paragraph;
[0112] The sub-summary splicing unit is used to splice the sub-summaries corresponding to each argument structure to generate the final judicial judgment document summary.
[0113] The execution process of each unit can be carried out according to the steps of the summary generation method for judicial judgment documents in Embodiment 1, and will not be described in detail in this embodiment.
[0114] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0118] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating summaries of judicial judgments, characterized in that, The method includes: Based on the argumentative structure of judicial judgment documents, the documents are divided into paragraphs, resulting in the litigation request section, the defendant's defense section, the investigation findings section, and the judgment result section. By combining the BERT and GCN models, key sentences are extracted from each argument structure paragraph, and these key sentences are combined into a set of key sentences. The set of key sentences is input into the generation model, and the content is rewritten using the generation model to generate sub-summaries for each argument structure paragraph. The sub-summaries corresponding to each argument structure are concatenated to generate the final summary of the judicial judgment document; By combining the BERT and GCN models, key sentences are extracted from each argument structure paragraph, and these key sentences are grouped into a set of key sentences, including: The ROUGE evaluation metric was used to select key sentences, and the BERT model was used to extract single-sentence features from each argumentative paragraph to obtain the feature vector of a single sentence. Based on the feature vectors, BERT and GCN are jointly trained to obtain a trained extractive model. An extraction model is used to extract key sentences from the argumentative paragraphs of judicial judgments. The original text of the paragraph is input into the extraction model, and key sentences are selected based on the labels predicted by the extraction model. This process constructs a set of key sentences and a set of key sentences from the original text of the argumentative paragraph. Key sentences were selected using ROUGE evaluation metrics, including: Construct an empty set for each argument paragraph From the original text of the argumentative paragraph Choose a sentence ; Calculate sentences Summary of Argumentation Paragraphs The average of the ROUGE-1, ROUGE-2, and ROUGE-L scores makes the selected sentences... With sets The sentences in the set can be maximized by concatenating them. Summary of Argumentation Paragraphs The mean of ROUGE; Thus constructing the original text of each argument paragraph - A dataset of key sentences, where the labels of the key sentences in the original text are set to 1; The BERT model is used to extract single-sentence features from each argumentative paragraph, resulting in a single-sentence feature vector, including: In the original text of the argumentative paragraph single sentence Insert the [CLS] symbol before the sentence and then insert the [CLS] symbol after the sentence. Input into the BERT model; The BERT model is used to extract features from each sentence, resulting in the output vector of the [CLS] character for each sentence. , as the feature vector of a single sentence; The feature vector of a single sentence is represented as follows: ; The BERT model includes an input layer, a hidden layer, and an output layer; the hidden layer has 12 layers, including an attention layer, an intermediate layer, and a hidden output layer. The BERT model obtains word vectors from the text data through the input layer as the output vector; the attention layer uses a 12-head multi-head attention mechanism to obtain an attention score, which is then added to the output of the previous hidden layer as the output; the output of the attention layer is connected to a fully connected layer, and then the GELU activation function is used to obtain the output of the intermediate layer; the hidden output layer performs fully connected, Dropout, and Norm operations on the output of the intermediate layer to obtain the output of the entire hidden layer; the above hidden layer operations are repeated 12 times to finally obtain the output of the BERT model.
2. The method for generating summaries of judicial judgment documents according to claim 1, characterized in that, Based on the argumentative structure of judicial judgments, judicial judgments are divided into paragraphs, including: Identify and skip the basic information of judicial judgments, read the content of judicial judgments sentence by sentence, and identify keywords that feature the argumentative structure. If the sentence contains keywords characteristic of the argumentative structure, then the sentence shall be used as the starting sentence of the argumentative structure. Read sentences from the starting sentence onwards until the subsequent sentence triggers the next argument structure feature keyword; and take the sentences from the previous starting sentence to the sentence before the current argument structure starting sentence as the previous argument structure paragraph. Follow the steps above until you have read all the judicial documents, and finally obtain the paragraphs corresponding to the four argumentative structures.
3. The method for generating summaries of judicial judgment documents according to claim 1, characterized in that, The GCN model is trained using a binary model to obtain a trained extractive model, including: The output vectors of all sentences in the original text are regarded as nodes of the GCN model. A fully connected graph is constructed, and the affinity matrix is calculated. The weights of the affinity matrix are normalized to obtain the weight matrix of the fully connected graph; By leveraging the GCN model to infer relationships between nodes, a two-layer GCN model structure is constructed to calculate the probability of each node belonging to a binary classification. The first layer uses... As the activation function, the second layer uses As an activation function, the inferred feature matrix is obtained; At each labeled node, the loss is calculated using cross-entropy to obtain the trained extractive model.
4. The method for generating summaries of judicial judgment documents according to claim 1, characterized in that, The set of key sentences is input into the generative model, which is then used to rewrite the content, generating sub-summaries for each argumentative structure paragraph, including: S31. Select the PEGASUS model as the generation model, merge the constructed original text of the argument paragraph - summary of the argument paragraph with the constructed original text of the argument paragraph - set of key sentences to obtain the set of key sentences - summary of the argument paragraph; fine-tune the PEGASUS model based on the set of key sentences - summary of the argument paragraph to obtain the fine-tuned judicial summary PEGASUS model. S32. Input the set of key sentences into the fine-tuned judicial summary PEGASUS model, rewrite the content using the fine-tuned judicial summary PEGASUS model, and finally output the sub-summary of the argument paragraph.
5. The method for generating summaries of judicial judgment documents according to claim 4, characterized in that, The PEGASUS model has a maximum input of 1024 bytes, a total of 16 layers, a hidden layer size of 4096, and a multi-head attention mechanism with 16 heads. The PEGASUS model includes an encoder and a decoder; the encoder includes an input layer and a hidden layer, predicts characters of a random mask and extracts text features through the hidden layer, and the output of the last hidden layer of the encoder is used as the input of the decoder; the decoder includes an input layer, a hidden layer and an output layer, and uses the output of the last hidden layer of the encoder to predict the sentence of the random mask word by word.
6. A system for generating summaries of judicial judgments, characterized in that, The system uses a method for generating summaries of judicial judgments as described in any one of claims 1 to 5; the system includes: The argument structure division unit is used to divide judicial judgment documents into paragraphs based on the argument structure of the judicial judgment documents, resulting in the litigation request section, the defendant's defense section, the investigation findings section, and the judgment result section; The key sentence set extraction unit is used to extract key sentences from each argument structure paragraph by combining the BERT model and the GCN model, and to form a key sentence set from each key sentence. The sub-summary generation unit is used to input the set of key sentences into the generation model, use the generation model to rewrite the content, and generate a sub-summary for each argument structure paragraph. The sub-summary splicing unit is used to splice the sub-summaries corresponding to each argument structure to generate the final judicial judgment document summary.
Citation Information
Patent Citations
Course trial query generation method and device for generating Seq2Seq model based on pointer, and medium
CN112417155A
Sentence-level Chinese event detection method in combination with document key information
CN113505200A