Methods and Systems for Generating Judicial Judgment Document Summary
By integrating legal semantic information and pre-trained models into judicial judgment documents, a generative summarization system is constructed, which solves the problems of semantic deficiency and lack of professionalism in the summaries of judicial judgment documents in existing technologies, and generates summaries with stronger logic and professionalism.
Patent Information
- Application Number
- CN202311592898.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-11-27
AI Technical Summary
Existing automatic summarization methods suffer from problems such as missing semantic information, incoherent sentences, logical errors, poor readability, and insufficient professionalism when processing judicial judgments. In particular, traditional extraction-based summarization methods fail to fully consider the structural characteristics of judgments and the lack of professionalism of pre-trained models in the legal field.
This paper employs a semantic function classification module and a semantic information fusion module, combining legal semantic information and a pre-trained model. It integrates the semantic functions of sentences in judicial judgments through a conditional normalization method, constructs a generative model using RoFormer and Unilm, and incorporates a cluster search algorithm from a legal dictionary to generate high-quality summaries.
It enables accurate extraction and generation of key information from judicial judgments, improves the logic, professionalism, and fluency of summaries, and solves the defects existing in the current technology. The generated summaries are more in line with the logic and professionalism of the judgments.
Smart Images

Figure CN117708644B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method and system for generating summaries of judicial judgments. Background Technology
[0002] Judicial judgments are characterized by their excessive length, difficulty in understanding legal terminology, and complex sentence structures. Furthermore, the increasing volume of publicly available judgments has increased the difficulty for lawyers and judges in retrieving, reviewing, and analyzing them. To address this issue, judicial judgment summaries have emerged. By compressing, summarizing, and concisely presenting the content of the document, they reflect the cause of action, factual basis, legal grounds, and judgment outcome in a shorter format and in easily understandable language. This helps improve the efficiency of judicial personnel in handling cases and makes the law more accessible to the general public.
[0003] Currently, automatic summarization technology can be mainly divided into extractive summarization and generative summarization. Extractive summarization selects the key sentences that best represent the core content of the article to form a summary, while generative summarization extracts key information from the input text and reorganizes this information to generate a professional and readable summary.
[0004] Traditional extractive summarization methods can be divided into unsupervised and supervised categories. Unsupervised extractive summarization algorithms mainly include topic model-based extraction algorithms and graph ranking-based extraction algorithms. Gong et al. first applied Latent Semantic Analysis (LSA) to the summarization task, converting the weighted word frequencies in each sentence into sentence vectors, performing singular value decomposition on the sentence vector matrix, and selecting sentences from these vectors to form the summary. The TextRank algorithm uses text units and sentence similarity to construct a graph, selecting appropriate nodes as summaries by calculating node importance scores. Supervised extractive summarization algorithms transform the extraction task into a sentence classification task; the FastText algorithm uses N-gram features and a hierarchical softmax loss function to reduce computational complexity, thus achieving simple and efficient text classification. The SummaRuNNer model proposed by Nallapati et al. uses a Long Short-Term Memory (LSTM) network to construct a two-layer encoder to generate document-level encoded representations of sentences and introduces relative and absolute position features of sentences, thereby clearly expressing the importance of text units and exhibiting good interpretability.
[0005] With the continuous development of neural network technology, generative summarization models based on neural networks have gradually become a focus of academic attention. Sutskever et al. proposed the Seq2Seq (Sequence to Sequence) model for machine translation tasks, which adopts an end-to-end sequence-to-sequence training strategy based on an encoder-decoder structure. However, the performance of Seq2Seq models typically decreases as the text length increases. To address this issue, Bahdanau et al. introduced an attention mechanism into the model, allowing the decoder to focus on more comprehensive textual information during the decoding process. Rush et al. were the first to apply the attention mechanism to the task of generative summarization, achieving good results on sentence-level summarization datasets.
[0006] With the continuous advancement of pre-training technology, pre-trained models specifically designed for text generation are becoming a hot topic in current text generation research, including MASS, UniLM, BART, GPT, T5, and PEGASUS. Based on these pre-trained models, researchers are constantly improving and enhancing summarization methods. Zhu et al. proposed the FASum model, which integrates knowledge graphs with summarization to identify and correct potential factual errors in summaries. Xu et al. utilized contrastive learning to improve summarization quality by minimizing the similarity distance between the original text, the human-generated summary, and the model-generated summary. Overall, pre-trained models provide a more efficient and reliable solution for text summarization tasks.
[0007] The existing automatic summarization methods mentioned above often suffer from problems such as missing semantic information, incoherent sentences, logical errors, poor readability, and insufficient professionalism when processing judicial documents, and are limited by text length.
[0008] Traditional extractive summarization methods only semantically encode the information within sentences themselves and classify sentences based on this semantic encoding. This approach fails to consider the structural characteristics of judicial documents, resulting in key sentences with no logical relationships and only considering common features. This leads to some key sentences lacking these features being difficult for the model to identify, and the extracted summaries also lacking some key information, affecting the final generated summary performance. This invention addresses this problem by integrating legal semantic information into the extractive model, using conditional normalization instead of the layer normalization method in the WoBERT model. This allows the extractive model to fully consider the legal semantic function of sentences and the logical relationships between sentences with different functions when identifying key sentences. Furthermore, pre-trained models often use general corpora for training, and even when fine-tuned using legal domain data, the generated summaries often suffer from insufficient specialization. Summary of the Invention
[0009] The technical problem to be solved by the present invention is to provide a method and system for generating summaries of judicial judgments, which addresses the shortcomings of the existing technology and allows for unlimited length of input text.
[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for generating summaries of judicial judgments, comprising the following steps:
[0011] S1. Input the sentences in the judicial judgment documents into the semantic function classification module to obtain the semantic function label R-Label for each sentence;
[0012] S2. Input the sentences in the judicial judgment documents and their corresponding semantic function tags into the semantic information fusion module to obtain the sentence keyness vector;
[0013] S3. Map the keyness vector to probability, identify key sentences in the judgment document, and concatenate all key sentences to obtain an extractive summary.
[0014] S4. Use the extracted summary as input to the long text summarization model to train the long text summarization model and obtain the summary generation model.
[0015] The method of the present invention further includes:
[0016] S5. Using the extracted summary and the generated summary sequence as input to the summary generation model, the probability of the next word is predicted by integrating the legal dictionary, and the sequence with the highest cumulative probability is calculated using bundle search. This sequence is the final generative summary.
[0017] The specific implementation process of step S5 includes:
[0018] 1) Segment all words in the legal domain dictionary and the extracted summary of the input judicial documents according to the N-gram method to generate the N-gram set D of the legal dictionary and the N-gram set S of the input text;
[0019] 2) Calculate the weight of each N-gram based on its frequency of occurrence in sets D and S;
[0020] 3) Let Y {1:t-1} Given a candidate summary sequence, the word y being decoded is the t-th word in the summary sequence. The extractive summary and the summary sequence Y are then combined. {1:t-1} Input a long text summarization model, and the model outputs the probability that each candidate word in the candidate word list is character y;
[0021] 4) Calculate the comprehensive legal dictionary score K(y) of the character y using the formula K(y) = β×D(y) + γ×S(y), where D(y) and S(y) respectively represent the weights of y in set D and set S, and the weights are obtained from the weights of the N-gram to which the character y belongs obtained in step 2) (for example, the character at position t-1 in the candidate sequence is "quan", and the score of the character "zhong" at position t is required; the word "weight" is split into ("quan", "zhong") by 2-gram, and the weights of the 2-gram found in sets D and S are the corresponding D("zhong") and S("zhong")). β and γ are adjustment parameters for balancing the weights of professional terms in the legal field and the extractive summary vocabulary of the input judicial judgment document;
[0022] 5) Calculate the comprehensive score F(y) of the given character y: F(y) = P(y) + λ×K(y); where P(y) is the probability generated by the model, and λ is an adjustment parameter;
[0023] Select Beam-Width (which can be set as required) characters with the highest comprehensive scores to form Beam-Width candidate sequences with the first t-1 characters in the sequence;
[0024] 6) Repeat step 3) to step 5) until the current character y is an end token or the length of the summary reaches the maximum value, and select the sequence with the highest score among the candidate sequences as the final generative summary.
[0025] The semantic function classification module includes a semantic information encoder and a semantic function classifier;
[0026] The semantic information encoder adopts the WoBERT model, which is used to obtain the semantic information vector R-Embedding of the sentence: where n represents the number of words in the sentence, w i represents the word vector obtained by the WoBERT model encoding the i-th word;
[0027] The semantic function classifier includes a BiLSTM model, a linear layer and a CRF layer connected in sequence; the input of the BiLSTM model is the semantic information vector R-Embedding, and the output of the CRF layer is the semantic function label R_Label.
[0028] In step S2, the semantic information fusion module includes a multi-layer Transformer module, and the formula for the Transformer module to normalize the semantic function label R-Label is:
[0029]
[0030] g c =g+W g.R-Label;
[0031] b c =b+W b .R-Label;
[0032] Where a′ represents the normalized parameter value, R_Label is the sentence semantic function label, and W g and W b Let μ represent the transformation matrix; l represents the l-th hidden layer; μ represents the transformation matrix. l and σ l Let g and b represent the expected value and variance of the parameters at layer l, respectively. Let g and b represent the gain and bias parameters before adding the legal semantic functional label conditional vector, respectively. c and b c These represent the gain parameter and bias parameter after adding the legal semantic function label condition vector, respectively.
[0033] In step S3, the keyness vector is mapped to a probability using a fully connected layer and an activation function, calculated as follows: p i =σ(WM i +b); where σ represents the sigmoid activation function, W is the weight matrix of the fully connected layer, b is the bias vector, and p i represents the output probability of the classifier.
[0034] In step S4, the long text summarization model combines the RoFormer pre-trained model with Unilm to construct a generative model. The attention calculation formula for this model is as follows:
[0035]
[0036] Where M is a mask matrix, and the element in the i-th row and j-th column of M is M i,j The calculation formula is: M i,j This indicates whether the information of the j-th character can be obtained from the i-th character. Q, K, and V are the query vector, key vector, and value vector, respectively. m and K n Let d represent the vectors after adding position information. k R represents the dimension of the K vector. m Let R be the rotation matrix at position m. n Let be the rotation matrix at position n, and AttentionM be the attention calculation result after adding the mask matrix M.
[0037] Specifically, the RoFormer model employs a method called Rotation Position Encoding (RoPE), which encodes relative positions by using a rotation matrix to encode absolute positions. The rotation matrix for position m is defined as R.m The rotation matrix at position n is R. n The formula for calculating AttentionR, which includes relative positional information, is:
[0038]
[0039] Among them, Q m and K n Let d represent the vectors after adding position information. k This represents the dimension of the K vector. Q, K, and V are the query vector, key vector, and value vector in the attention mechanism.
[0040] UniLM incorporates a mask matrix into the original attention mechanism, meaning that during text generation, words can only acquire information from their preceding context, allowing the model to simulate a one-way language model when handling text generation tasks. The calculation formula for the attention mechanism is then:
[0041]
[0042]
[0043] Where M i,j This indicates whether the information of the j-th character can be obtained from the i-th character.
[0044] As an inventive concept, the present invention also provides a judicial judgment document summary generation system, which includes a memory and at least one processor; the memory stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the steps of the method described above.
[0045] As an inventive concept, the present invention also provides a computer storage medium storing a computer program / instruction thereon, wherein when the computer program / instruction is executed by a processor, the steps of the method described above are implemented.
[0046] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0047] 1. This invention utilizes conditional normalization to integrate the different semantic functions between sentences in judicial judgments into an extraction model, making the extraction summary more consistent with the logic of the judgment and enabling the summary to more accurately grasp the key information in the document.
[0048] 2. This invention combines the RoFormer pre-trained model with Unilm to construct a generative model, making the model more suitable for processing long texts in the judicial field without causing forgetting due to excessive text length.
[0049] 3. This invention improves the cluster search algorithm by integrating a legal dictionary from the legal field into the cluster search algorithm, which can greatly enhance the professionalism and fluency of the model-generated summaries. Attached Figure Description
[0050] Figure 1 This is a flowchart of the method according to an embodiment of the present invention;
[0051] Figure 2 This is a structural diagram of the semantic function classifier according to an embodiment of the present invention.
[0052] Figure 3 This is a structural diagram of the bundle search module that integrates prior knowledge according to an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] Example 1
[0055] Embodiment 1 of the present invention provides a method for generating summaries of judicial judgments, the specific implementation steps of which include:
[0056] Step 1: Input the sentences from the judicial judgment documents into the semantic function classification module to obtain the semantic function label (R-Label) for each sentence. The specific steps are as follows:
[0057] The main body of a judicial judgment document consists of six parts: the preamble, the facts, the reasons, the basis for the judgment, the main text of the judgment, and the conclusion. The semantic function classification module is used to identify the different semantic functions of sentences in judicial judgment documents.
[0058] The semantic function classification module consists of a semantic information encoder and a semantic function classifier. The semantic information encoder is based on WoBERT; the specific steps are to add a classification layer after the WoBERT model using data with labeled semantic functions for fine-tuning, remove the classification layer after training, encode each word in the sentence using the weights of the pre-trained model, and obtain the semantic information vector (R-Embedding) of the sentence through average pooling.
[0059]
[0060] Where n represents the number of words in the sentence, w iThis represents the word vector obtained by encoding the i-th word using the WoBERT model.
[0061] The semantic function classifier is implemented based on the BiLSTM+CRF model. First, the obtained semantic information vector is input into a Long Short-Term Memory (BiLSTM) network to obtain a new semantic vector (H-Embedding) that integrates contextual semantic information between sentences. This process can be described as follows:
[0062]
[0063]
[0064]
[0065] in, This represents the forward hidden vector obtained by passing R-Embedding through a BiLSTM network. This represents the backward hidden vector obtained by passing the R-Embedding through the BiLSTM network.
[0066] Then, a linear layer is used to transform the H-Embedding into a vector s with the same dimension as the number of semantic function labels, where s (i,j) This represents the score of the i-th sentence assigned to the j-th semantic function label; finally, the CRF layer will comprehensively consider the score of the current sentence and the transition probability between adjacent labels to predict the semantic function label R_Label of each sentence.
[0067] Step Two: Input the sentences and their corresponding semantic function labels from the judicial judgment documents into the semantic information fusion module to obtain the sentence keyness vector. The extractive summarization model is also built on the WoBERT model, which includes 12 Transformer layers. To integrate the semantic function labels into the WoBERT model, conditional normalization is used instead of the original layer normalization method of the Transformer. The conditional normalization method adds a conditional vector to the layer normalization method to control the calculation results. Its calculation process can be described as follows:
[0068]
[0069] g c =g+W g .R-Label;
[0070] b c =b+W b .R-Label;
[0071] Where a′ represents the normalized parameter value, R_Label is the sentence semantic function label, and W gand W b Let μ represent the transformation matrix; l represents the l-th hidden layer; μ represents the transformation matrix. l and σ l Let g and b represent the expected value and variance of the parameters at layer l, respectively. g and b represent the gain and bias parameters before adding the legal semantic functional label conditional vector. c and b c This represents the gain and bias parameters after adding the legal semantic function label condition vector.
[0072] The WoBERT model, which integrates legal semantic information, converts each sentence in a judicial judgment document into a keyness vector (K-Embedding).
[0073] Step 3: After the semantic information fusion module, the K-Embedding is mapped to probabilities using a fully connected layer and a sigmoid activation function. The calculation method is as follows:
[0074] p i =σ(WM i +b)
[0075] Where σ represents the sigmoid activation function, W is the weight matrix of the fully connected layer, b is the bias vector, and p i represents the output probability of the classifier.
[0076] The model determines whether a sentence is a key sentence based on the output probability, and then concatenates all the key sentences in the judgment document to form an extractive summary.
[0077] Step 4: Input the extractive summary into the fine-tuned long text summarization model. The bundle search module, which integrates the legal dictionary, obtains the final generative summary based on the probabilities output by the long text summarization model. The specific steps are as follows:
[0078] First, the long text summarization model is fine-tuned. The long text summarization model is designed based on the pre-trained models RoFormer and Unilm. Since RoFormer is pre-trained on general corpora, it needs to be fine-tuned in order to enable the model to learn legal expertise.
[0079] The long text summarization model takes an extractive summary and a sequence of generated summaries as input. It constructs a candidate word list based on probability, and a beam search module integrating a legal dictionary selects the highest-probability words from this list and adds them to the summary sequence. This process is repeated until the final generative summary is generated. The specific steps are as follows:
[0080] S501: A collection and compilation of professional legal dictionaries, containing 1,124 commonly used legal terms.
[0081] S502: Segment all words in the legal domain dictionary and the extracted summary of the input judicial documents according to the N-gram method to generate the N-gram set D of the legal dictionary and the N-gram set S of the input text.
[0082] S503: Calculate the weight of each N-gram based on the frequency of occurrence of each N-gram in sets D and S.
[0083] S504: Let Y {1:t-1} Given a candidate summary sequence, the word y being decoded is the t-th word in the summary sequence. The extractive summary and the summary sequence Y are then combined. {1:t-1} Input a long text summarization model.
[0084] S505: The comprehensive legal dictionary score for character y is calculated as follows:
[0085] K(y)=β×D(y)+γ×S(y)
[0086] Where D(y) and S(y) represent the weights of y in set D and set S, respectively, and β and γ are adjustment parameters used to balance the weights of legal professional terms and the input judicial judgment document extraction summary terms.
[0087] S506: The long text summarization model generates a set of candidate words and their probabilities for the current sequence. The comprehensive score for word y is calculated as follows:
[0088] F(y) = P(y) + λ × K(y)
[0089] Where F(y) is the overall score of a given character y, P(y) is the probability generated by the model, K(y) is the overall legal dictionary score of character y, and λ is the adjustment parameter.
[0090] The Beam-Width words with the highest comprehensive scores are selected and combined with the first t-1 words in the sequence to form the Beam-Width candidate sequences.
[0091] S507: Repeat steps S504 and S506 until the current character y is the end character or the summary length reaches the maximum value, and select the sequence with the highest score among the candidate sequences as the final generative summary.
[0092] To demonstrate the effectiveness of this invention in practical applications, we constructed multiple comparative models for both extraction-based and generative models, using Rouge and bleu as evaluation metrics. Both are commonly used metrics for evaluating the similarity between machine-generated and human-written summaries. The comparison results are as follows:
[0093] The extractive comparison model is described below:
[0094] (1) LEAD-3: Select the first three sentences as the text summary. In this experiment, considering the characteristics of judicial judgments, the method was improved to select consecutive sentence segments containing specific keywords (such as "claims") as the summary.
[0095] (2) TextRank: An extractive summarization method based on graph ranking algorithm. It treats each sentence as a node in a graph, establishes edges by calculating the similarity between sentences, and calculates the weight score of each sentence. Finally, it selects the N sentences with the highest scores to form a summary.
[0096] (3) FastText: An efficient and scalable text classification method that focuses on using sub-word information to speed up training and improve the ability to handle rare words and spelling errors.
[0097] (4) TextCNN: Applying convolutional neural networks (CNN) to text classification tasks, using convolutional kernels of different sizes to process word vector sequences in order to capture local features.
[0098] (5) SummaRuNNer: Two double-layer GRU-RNNs are used to encode sentences and documents respectively to obtain document-level encoding representations of sentences, and text classification is performed based on these representations.
[0099] (6) BERT: The pre-trained language model BERT is fine-tuned using sentence key level labels and classification layers and applied to text classification.
[0100] (7)WoBERT: Fine-tuning the Chinese pre-trained language model WoBERT for text classification.
[0101] (8)BERTSum_EXT: An extractive summarization method based on BERT, which inserts [CLS] and [SEP] tags before and after each sentence, uses Segment Ids to distinguish different sentences, and evaluates the importance of sentences in the document through a summarization judgment layer.
[0102] Table 1. Comparison of experimental data for the extractive model:
[0103]
[0104] The table above compares the results of our invention's extraction and summarization model that integrates legal semantic information with other common extraction and summarization models. It can be seen that our model outperforms other comparative models in multiple metrics and can capture the key legal information of documents more comprehensively, which provides high-quality input for subsequent summarization.
[0105] The generative contrastive model is introduced as follows:
[0106] (1) Seq2Seq+Attention: Generative summarization baseline model, where the encoder encodes the input text into a vector and the decoder generates a summary based on attention weights.
[0107] (2)PGN: Pointer Generation Network Model, which combines the Seq2Seq model and the pointer network. The Seq2Seq model is responsible for learning abstract concepts from the source text and generating summaries, while the pointer network is used to directly copy key information from the source text.
[0108] (3) PGN_Trm: Compared to PGN, PGN_Trm uses Transformer as the sequence network and copies it based on the self-attention mechanism, which has stronger modeling ability and higher training efficiency.
[0109] (4) BERT+Seq2Seq: Combining the pre-trained language model BERT with the Seq2Seq architecture for text summarization.
[0110] (5) NEZHA+Seq2Seq: Combine the pre-trained language model NEZHA with the Seq2Seq architecture.
[0111] (6)Roformer+Seq2Seq: Combines the pre-trained language model Roformer with the Seq2Seq architecture.
[0112] It should be noted that the input to all the above generative models are the key sentences extracted by the extractive model in the embodiments of the present invention.
[0113] Table 2. Comparison of experimental data for generative models:
[0114]
[0115] The table above compares the generative summary model of this invention, which integrates a legal dictionary, with other common generative summary models. It can be seen that our model outperforms other comparative models in all indicators, which shows that our model can generate higher quality and more professional judicial summaries.
[0116] Table 3 Ablation Experiment Results
[0117]
[0118] When a semantic functional information fusion module based on conditional normalization is added to the extractive summarization baseline model (WoBERT), the recall rates of ROUGE-1, ROUGE-2, and ROUGE-L are significantly improved, increasing by 4.67, 6.79, and 6.64 percentage points, respectively. This result indicates that by integrating legal semantic information into the key sentence classification process using layer-normalization, the model can more effectively extract sentences containing key information, thereby improving the quality of the summary. The extractive summarization model extracts key information from the original text (extractive summary) and uses it as input to the generative summarization model, which further refines and summarizes it. As shown in Table 3, the generative summarization baseline model (Roformer) has a considerable improvement over the extractive summarization model, further demonstrating the performance superiority of the two-stage extraction-generation summarization model. When a bundle search module (KBS) integrating a legal dictionary is added to the generative summarization baseline model (Roformer), all metrics are improved, indicating that integrating prior knowledge can effectively improve the quality of the generated summary.
[0119] Table 4 Sentence Semantic Function Annotation Specifications
[0120]
[0121] The basic structure of judicial judgments includes three parts: title, body, and signature. Based on the different semantic functions of sentences, we divide the body into six parts: preamble, facts, reasons, legal basis, main text of the judgment, and conclusion. The preamble describes and confirms the legality of the trial procedure; the facts section elaborates on the facts of the case after the trial; the reasons section provides a detailed explanation and argumentation of the judge's reasons for the judgment; the legal basis is the legal rules and relevant legal provisions upon which the judge based the judgment; the main text of the judgment states the judgment result and its corresponding legal effect; and the conclusion is the signing and announcement of the judgment. To introduce legal semantic information into the summary dataset, we have developed a guideline for the semantic function annotation of sentences in judgments, and have conducted meticulous and rigorous annotation of legal semantic information on the original data. Table 4 details the sentence semantic function labeling specifications developed in this embodiment of the invention.
[0122] Example 2
[0123] Embodiment 2 of the present invention provides a system corresponding to Embodiment 1 above, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program in the memory to implement the steps of the method of Embodiment 1 above.
[0124] In some implementations, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.
[0125] In other implementations, the processor can be any type of general-purpose processor, such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation here.
[0126] Example 3
[0127] Embodiment 3 of the present invention provides a computer-readable storage medium corresponding to Embodiment 1 above, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, they implement the steps of the method of Embodiment 1 above.
[0128] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.
[0129] 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 implemented 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. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0130] 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.
[0131] 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.
[0132] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0133] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for generating summaries of judicial judgments, characterized in that, Includes the following steps: S1. Input the sentences in the judicial judgment documents into the semantic function classification module to obtain the semantic function label R-Label for each sentence; S2. Input the sentences in the judicial judgment documents and their corresponding semantic function tags into the semantic information fusion module to obtain the sentence keyness vector; S3. Map the keyness vector to probability, identify key sentences in the judgment document, and concatenate all key sentences to obtain an extractive summary. S4. Use the extracted summary as input to the long text summarization model, train the long text summarization model, and obtain the summary generation model; S5. The extracted summary and the generated summary sequence are used as input to the summary generation model. The probability of the next word is predicted by integrating the legal dictionary. The sequence with the highest cumulative probability is calculated by using bundle search. This sequence is the final generative summary. The semantic function classification module includes a semantic information encoder and a semantic function classifier; The semantic information encoder uses the WoBERT model to obtain the semantic information vector R-Embedding of the sentence: ;in, Indicates the number of words in a sentence. Indicates the encoding of the WoBERT model. Word vectors obtained from each word; The semantic function classifier comprises a BiLSTM model, a linear layer, and a CRF layer connected in sequence; the input of the BiLSTM model is a sequence of sentence semantic information vectors R-Embedding, and the output of the CRF layer is a semantic function label R_Label; The semantic information fusion module includes a multi-layer Transformer module, and the formula for normalizing the semantic function label R-Label by the Transformer module is as follows: ; ; ; in, R_Label represents the normalized parameter values and is the sentence semantic function label. and Represents the transformation matrix; Indicates the first A hidden layer, and They represent the first The expected value and variance of the layer parameters, and These represent the gain and bias parameters before adding the legal semantic function label condition vector, respectively. and These represent the gain parameter and bias parameter after incorporating the legal semantic functional label condition vector, respectively. In step S4, the long text summarization model includes the RoFormer model, and the attention calculation formula for the RoFormer model is as follows: ; Where M is a mask matrix, and the element in the i-th row and j-th column of M... The calculation formula is: , Indicates the first Can the 1st character be obtained? Information consisting of 10 characters, where Q, K, and V are the query vector, key vector, and value vector, respectively. and These represent the vectors after adding position information. express The dimension of a vector For position The rotation matrix, For position The rotation matrix, This is the attention calculation result after adding the mask matrix M.
2. The method for generating judicial judgment document summaries according to claim 1, characterized in that, The specific implementation process of step S5 includes: 1) Segment all words in the legal dictionary and the extracted summary of the input judicial documents according to the N-gram method to generate the N-gram set D of the legal dictionary and the N-gram set S of the input text; 2) Let This is a candidate summary sequence, the words being decoded. For the t-th word of the summary sequence, combine the extractive summary and the summary sequence. Inputting into a long text summarization model, the candidate words in the candidate word list are characters. The probability of; 3) Using the formula Calculation word Comprehensive Legal Dictionary Score ,in, and They represent The weights of sets D and S, and To adjust the parameters; 4) Calculate the given word Overall score : ;in, The probability output by the long text summarization model. To adjust the parameters; The Beam-Width words with the highest overall scores are selected and combined with the first t-1 words in the sequence to form the Beam-Width candidate sequences; 5) Repeat steps 2) to 4) until the current character. If the end-of-sequence marker or the summary length reaches its maximum value, the sequence with the highest score among the candidate sequences is selected as the final generative summary.
3. The method for generating judicial judgment document summaries according to claim 1, characterized in that, In step S3, the keyness vector is mapped to a probability using a fully connected layer and an activation function, calculated as follows: ;in, This represents the sigmoid activation function. This is the weight matrix of the fully connected layer. For bias vectors, represents the output probability of the classifier.
4. A system for generating summaries of judicial judgments, characterized in that, It includes a memory and at least one processor; the memory stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to perform the steps of the method according to any one of claims 1 to 3.
5. A computer storage medium storing computer programs / instructions thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 3.
