Automatic summarization method and system for legal documents based on semantic segmentation
By dividing legal documents into five semantic paragraphs and generating summaries for each paragraph, the problem of input length and processing time for long text summarization in existing technologies is solved, achieving efficient and accurate automatic summarization of legal documents.
Patent Information
- Application Number
- CN202310880337.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-18
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-07-18
AI Technical Summary
Existing technologies for automatic legal document summarization suffer from limitations such as limited input length, long model runtime, and incomplete summary structure. In particular, when processing long texts, traditional methods struggle to effectively preserve the semantic structural features of legal documents.
A semantic segmentation-based approach is used to divide legal documents into five semantic paragraphs (dispute category, plaintiff's claim, defendant's statement, facts and reasons, legal basis, main text and conclusion of the judgment). A generative text summarization method is used to generate a summary for each paragraph, which is then concatenated in sequence to finally generate a complete legal document summary.
It enables the generation of structurally complete and accurate legal document summaries within a limited time, shortening the model running time and improving the quality and efficiency of the summaries.
Smart Images

Figure CN116894088B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and particularly relates to a semantic segmentation-based automatic summary method and system for legal documents. BACKGROUND
[0002] Legal documents are the true records of court litigation results and important materials for legal research. Legal practitioners need to read, search and study a large amount of documents, but these legal documents are often lengthy and difficult to read. A concise and clear legal document summary can effectively help legal practitioners quickly understand the key content of the document.
[0003] Legal documents are generally lengthy, with an average length of more than 3000 words. However, traditional text summarization methods are often limited by running resources and model performance, and cannot well solve the problem of long text summarization, which is prone to problems such as long model running time, limited input text length, and incomplete summary content.
[0004] Text summarization methods are mainly divided into extractive summarization and generative summarization. Extractive summarization selects part of the text from the original text and concatenates the text to form a summary, which is simple to implement and fast to run, and can be used for long text summarization. However, the quality of the summary text is not high, and there are often problems such as incoherent sentences and incomplete descriptions. Generative summarization is based on the semantic content of the original text and automatically paraphrases and rewrites the summary, but the model is complex, the running time is long, and long text cannot be directly input into the model. The method of first extraction and then generation is mainly to extract important content from the original text through an extraction model to achieve a preliminary reduction of the text, and then perform generative summarization. However, additional human annotation information needs to be introduced in the extraction stage, and the text obtained after reduction is still long, which still has the problem of long model running time.
[0005] In addition, legal documents are professional description texts, and their writing process generally follows a specific template and semantic structure (such as a civil judgment, which can be divided into five parts: dispute category, plaintiff's claim, defendant's statement, facts and reasons, and basis for judgment, main text of judgment, and tail). The summary of legal documents also needs to preserve the semantic structure features of the original text. SUMMARY
[0006] To solve the problems of limited input length, long model running time, and incomplete summary structure in the prior art in the automatic summarization of legal documents, the present application proposes a semantic segmentation-based automatic summarization method and system for legal documents, which is used to generate a complete legal document summary in a limited time.
[0007] The present application adopts the following technical solutions:
[0008] The first aspect, the application provides a legal document automatic abstract method based on semantic segmentation, comprising:
[0009] Obtaining a legal document, based on the method of continuous sentence classification, the judgment document is segmented semantically, and the judgment document is divided into five semantic structure semantic paragraphs of dispute category, plaintiff claim, defendant statement, fact and reason, and judgment basis, judgment main text and tail part, and the five semantic structures are numbered with continuous ascending numbers respectively;
[0010] The abstract of each semantic paragraph after segmentation is obtained based on the method of generative text abstract respectively;
[0011] The abstracts of each text paragraph after segmentation of the same legal document are spliced in order to obtain the final result.
[0012] Further, the method based on continuous sentence classification comprises:
[0013] According to the punctuation, the legal document is divided into multiple sentences and arranged in order;
[0014] Based on the Bert pre-training language model, the representation of each sentence is obtained, and the sentence is classified according to the representation result to obtain the predicted category sequence;
[0015] The classification result not meeting the semantic structure order is corrected;
[0016] All the sentences divided into the same category are aggregated in order to obtain the semantic paragraph of different semantic structures.
[0017] Further, the method of correcting the classification result not meeting the semantic structure order comprises:
[0018] Determine whether the predicted category sequence is increasing, if yes, it meets the semantic structure order, if not, according to the number of categories before and after the abnormal category, the abnormal category is corrected to the category with more continuous ascending numbers, if there are 2 or more categories with the same number of continuous ascending numbers, the category with higher overall probability is corrected.
[0019] The overall probability refers to a method of reordering the segmented sentences by using the overall probability when the category order of the sentence does not conform to the preset structure order of the controversial category, the plaintiff's claim, the defendant's statement, the fact and reason, and the basis of the judgment, the main text of the judgment and the tail part in the sentence segmentation process; the method comprises the following steps: extracting the category (for example, "32" in the order "22232333") that does not conform to the increasing order, and judging the true attribute of the category according to the overall probability (that is, the probability of "222" or "333") of the adjacent category; the overall probability is obtained by calculating the product of each category probability, based on the assumption of independent and identical distribution, that is, the probability that a sentence belongs to a certain category is independent and identically distributed, so the overall probability is the product of each category probability.
[0020] Further, the method for generating a text summary is represented as:
[0021] S j =UniLM j (D j )
[0022] Wherein, S j represents the summary corresponding to the jth semantic paragraph, UniLM i (.) represents the summary generation model corresponding to the jth semantic paragraph, and D j represents the jth semantic paragraph.
[0023] Further, the summary generation model adopts a UniLM model initialized based on the NEZHA pre-training language model.
[0024] Further, the summary generation model takes the semantic paragraph and the real summary as inputs in the training stage, and takes the semantic paragraph as input in the test stage, and generates the summary in a word-by-word encoding manner.
[0025] Further, the loss function in the training stage comprises:
[0026] The text generation loss function between the predicted summary and the word / word of the real summary;
[0027] The loss function of BIO paradigm sequence labeling;
[0028] Both of the two losses adopt K sparse cross-entropy loss.
[0029] In a second aspect, the application provides an automatic summary system for legal documents based on semantic segmentation, which is used to realize the automatic summary method for legal documents based on semantic segmentation.
[0030] Compared with the prior art, the application has the beneficial effects that the application automatically abstracts legal documents, uses a semantic segmentation method, shortens the text length of a single input generated abstract model, and can retain the complete original text semantic structure features. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a schematic diagram of a semantic segmentation-based automatic abstracting method of legal documents provided by the application; in order to clearly show the model optimization process, the abstract generation module is in a training state.
[0032] Figure 2 is a schematic diagram of a semantic segmentation-based automatic abstracting method of legal documents provided by the application, which generates an abstract word by word through a self-recurrence paradigm in a test stage. DETAILED DESCRIPTION
[0033] The application will be further described below in combination with the drawings and embodiments. The drawings are only illustrative diagrams of the application, and some block diagrams shown in the drawings are functional entities, which do not necessarily correspond to physically or logically independent entities, and can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0034] The object of the application is to automatically abstract legal documents using a semantic segmentation method. Specifically, the application first segments legal documents into five continuous semantic paragraphs through a semantic segmentation method, and then respectively implements generative abstracting on each paragraph. In the application, the semantic segmentation-based automatic abstracting of legal documents mainly includes a semantic segmentation module, an abstract generation module and an abstract splicing module. The semantic segmentation model is used to automatically divide legal documents into several paragraphs according to the semantic content of the documents; the abstract generation model is used to generate an abstract of each paragraph by using a text generation model on each segmented paragraph; and the abstract splicing module is used to combine the abstracts of all semantic paragraphs in order to obtain an abstract of the full text of the legal document.
[0035] Figure 1 The total framework of an embodiment of the application is shown, the input of the model is a Chinese civil judgment document original text, and the output is a complete document abstract. In order to clearly present the complete optimization process, Figure 1 The abstract generation module shows the input in the training stage, that is, the original text and the abstract are input at the same time, and the model output of the abstract part is used to optimize the overall model.
[0036] Figure 2The diagram illustrates the process of the summary generation module generating summaries during the testing phase: using the original text as the initial input, a word-by-word summary is generated using an autoregressive paradigm. That is, at each step, a new word is generated using the original text and the previously generated summary, until a symbol representing the stop is output (in this embodiment, the special symbol [SEP] is used to represent the stop of summary generation).
[0037] The following sections will introduce each module in detail. I. Semantic Segmentation Module:
[0038] Legal documents can be represented as D = {d1, d2, ..., d...} n}, where d i Let represent the i-th sentence in the document, and n represent the total number of sentences.
[0039] The goal of the semantic segmentation module is to predict the semantic structure label sequence L = {l1, l2, ..., l...} n}, where l i This represents the semantic structure tag to which the i-th sentence in the document belongs. Tag l i ∈{1, 2, 3, 4, 5} correspond to five text paragraphs: (1) dispute category, (2) plaintiff's claim, (3) defendant's statement, (4) facts and reasons, and (5) the basis of the judgment, the main text of the judgment, and the conclusion. Furthermore, in order to correctly divide the document into different semantic paragraphs, the above five parts must be arranged in order, that is, the sequence L must be a non-decreasing sequence, i.e., l i ≤l j , i < j. The semantic segmentation module, based on L, segments the legal document D into five continuous, complete parts, which can be represented as D = {D...} 1 D 2 , ..., D 5} represents a semantic paragraph obtained by merging sentences corresponding to five different semantic structures.
[0040] The steps of the semantic segmentation module are as follows:
[0041] 1. Divide a complete document into sentences: legal documents can be divided into multiple sentences using punctuation marks such as periods and colons.
[0042] 2. Perform representation learning for each sentence:
[0043] x i =MeanPooling(Bert(d i ))
[0044] In the above formula, x i d represents the representation of the i-th sentence. irepresents the i-th sentence, Bert(.) represents the Bert model, and MeanPooling(.) represents the mean pooling operation. The above formula represents: first, the text is represented using the Bert [Devlin et al., 2018], which is a commonly used general pre-trained language model. The Bert divides the input text into multiple tokens and maps each token to a corresponding word vector. After obtaining all the word vectors of a sentence, the average value of all the word vectors on the valid tokens (i.e., the mean pooling process) is obtained, which is a vector that can represent the semantic information of each sentence.
[0045] The model parameters in this part are frozen and do not participate in gradient updating, Figure 1 The dashed part in the above formula represents that the parameters in this part are frozen. In this way, the space and time cost of the model can be effectively reduced, and the expressiveness of the model is still strong.
[0046] 3. Using the sentence representation obtained in the previous step, the BiGRU model is used to classify the sentence:
[0047] p i , h i = BiGRU(x i )
[0048] y i = argmax(MLP(p i ))
[0049] Since a sentence belongs to which category depends on the context, the BiGRU model that can interact with the context information is selected. The representation of each sentence is input at each time step, p i is the model output at this time step, and h i is the hidden layer feature at this time step. The BiGRU enables each sentence to interact with the text of the previous and next sentences in the same document, and then the multi-layer perceptron MLP obtains the final probability distribution on the five semantic structures.
[0050] The above argmax represents that each sentence takes the semantic structure with the maximum probability as the generation result. The value of the classification result y i corresponds to the semantic structure as follows: y i = 1 represents that the sentence belongs to the dispute category, y i = 2 represents that the sentence belongs to the plaintiff's claim, y i = 3 represents that the sentence belongs to the defendant's statement, y i = 4 represents that the sentence belongs to the fact and reason, and y i = 5 represents that the sentence belongs to the basis of the judgment, the main text of the judgment, and the tail part.
[0051] 4. Correcting the classification results that do not conform to the semantic order:
[0052] Classification results y corresponding to the semantic structure generated according to the above steps i In most cases, it is continuous ascending order, that is, strictly according to the order of (1) dispute category, (2) plaintiff's claim, (3) defendant's statement, (4) facts and reasons, and (5) basis for judgment, main text of judgment and tail. However, sometimes there are errors of jumping and interlacing. When this happens, the classification needs to be corrected by pre-defined rules: correct the interlaced classification results to the category with more continuous ascending numbers nearby, if there are 2 or more categories with the same number of continuous ascending numbers, correct to the category with higher overall probability, and force the final classification result to be continuous ascending order with the sentence index.
[0053] The method for calculating the overall probability is as follows: for 2 or more categories with the same number of continuous ascending numbers, calculate the product of the probability of each category to obtain the overall probability of the category.
[0054] For the first case, that is, correcting the interlaced classification results to the category with more continuous ascending numbers nearby, give the following example sample, and the output result sequence after sentence classification is: [1 1 1 1 2 2 2 2 3 3 4 4 4 4 3 4 4 4 5 5 5]
[0056] In the above example, the bold "3" (defendant's statement) is behind the "4" (facts and reasons), which does not conform to the semantic structure of legal documents. Because the two labels before and after the error label "3" are both "4", "3" is directly corrected to "4", and a label sequence that conforms to the semantic structure order is obtained: [1 1 1 1 2 2 2 2 3 3 4 4 4 4 4 4 4 4 5 5 5]
[0058] For the second case, that is, when there are 2 or more categories with the same number of continuous ascending numbers, give the following example sample, and the output result sequence after sentence classification is: [1 1 2 2 2 3 2 3 3 3 4 4]
[0060] In the above example, the bold "32" means that the "defendant statement" appears before the "plaintiff claim", which is not in line with the semantic structure of legal documents. Since the number of labels "2" and "3" before and after the incorrect label "32" is the same, the incorrect label is corrected to the label with a higher overall probability in this case. Here, we assume that the probability of a sentence belonging to a certain structure class is independently and identically distributed, so the overall probability is calculated as the product of the probabilities of all sentences with that label. The overall probability of label "2" is the product of the probabilities of the first three sentences before the incorrect label belonging to "2", and the overall probability of label "3" is the product of the probabilities of the first three sentences before the incorrect label belonging to "3". In this example, we assume that the overall probability of label "2" is higher, so the incorrect label is directly corrected to "22", resulting in a label sequence that conforms to the semantic structure order: [1 1 2 2 2 2 2 3 3 3 4 4]
[0062] 5. After merging the sentences classified into the same semantic structure, a complete semantic paragraph is obtained:
[0063] D j =Concat yi=j (d i )
[0064] In the above formula, Concat refers to the operation of merging all texts in order, D j refers to a semantic paragraph divided, representing a part of complete semantic information, where j ∈ {1, 2, 3, 4, 5}, the semantic paragraph value is the same as the semantic structure label corresponding to the sentence.
[0065] II. Abstract generation module:
[0066] The abstract generation module constructs a UniLM [Dong et al., 2019] architecture abstract generation model based on the initialization parameters of the NEZHA [Wei et al., 2019] pre-training language model to realize generative abstracts. Input the original text of a semantic paragraph to generate the predicted abstract of the semantic paragraph.
[0067] The NEZHA pre-training language model is a general pre-training language model that improves BERT proposed by existing technology, which increases the input text length of the model by using a relative position encoding function. In actual experiments, 1024 tokens are used as the maximum text input, which is significantly longer than the limit of BERT, i.e. 512 tokens.
[0068] The UniLM architecture is a pre-training language model architecture for unified natural language understanding and natural language generation proposed by the prior art. The traditional model for a text-to-text task follows an encoder-decoder architecture, while Bert and the like only use an encoder module to implement natural language understanding and the like. The UniLM uses only an encoder module like Bert, but can implement text generation by modifying the mask matrix of attention. In the decoding process, the part not input is masked. This allows the UniLM to directly use a general pre-training language model such as Bert to initialize parameters. In the present application, the NEZHA model improved from Bert is used.
[0069] The formula of the abstract generation module is as follows:
[0070] S j =UniLM j (D j )
[0071] In the above formula, S j is the jth semantic paragraph corresponding to the abstract, UniLM i (.) represents the jth semantic paragraph corresponding to the UniLM model, i.e. the abstract generation model. Different semantic paragraphs use different UniLM abstract generation models.
[0072] The original word table of the NEZHA pre-training language model basically follows the rule of Chinese character segmentation. In this embodiment, the jieba Chinese segmentation toolkit is used for pre-segmentation, and a part of the word table is added to realize the embedding of these words in the form of words instead of characters. This can ensure that some important continuous character words will not be separated, such as Figure 1 The word "borrowing contract dispute" in the above is added to the word table in this way.
[0073] In the training stage, the UniLM takes the original text and the abstract as input together, and uses the following two loss functions to optimize the model together:
[0074]
[0075]
[0076]
[0077] L=L1+L2
[0078] The above formula defines a loss function, which is composed of two parts. Both parts use K sparse cross-entropy to measure the difference between the output probability and the true label.
[0079] In the formula, s iThis refers to the class probability directly output by the UniLM model, Ω. k It refers to s1, s2, ..., s N The top k largest elements in the K-sparse cross-entropy formula. Here, K-sparse cross-entropy refers to the fact that, instead of using the traditional softmax function, only the k largest probabilities (i.e., Ω in the formula) are retained before calculating the output probabilities. k The probability after the softmax function operation is calculated and used to calculate the cross-entropy loss function.
[0080] The first loss function is the text generation loss function, which is the text generation loss function between the output probability of the summary part and the real labels. K-sparse cross-entropy is used to measure the difference between the output probability and the real labels, making the model's learned output closer to the real summary. The second loss function is the sequence labeling loss function. Content identical to the original text in the real summary is treated as entities. The BIO paradigm (BIO is a sequence labeling method where B stands for Begin, used to label the beginning of an entity; I stands for Inside, used to label the internal part of an entity; O stands for Outside, used to label non-entity parts) is used to label the sequence of labels. The K-sparse cross-entropy between the output probability of the summary part and this sequence of labels is calculated. This method encourages the model to directly use terms appearing in the original text when outputting, increasing the fidelity of the generated text to the original text. The final total loss of the model is the sum of the text generation loss and the sequence labeling loss. The goal of this invention is to minimize this total loss so that the model's output is as close as possible to the real summary. In the testing phase, UniLM uses the original text as input and uses an autoregressive method to encode and generate summaries word by word. Autoregressive language models use previous words as input and generate the next word from the model's output. This approach allows the generated sequence to have a certain degree of contextual relevance, producing text with coherence and semantic accuracy. For an example of generating output text sequences word-by-word, please refer to... Figure 2 .
[0081] III. Abstract Assembly Module:
[0082] After merging the summaries of all semantic paragraphs in order, a summary of the full legal document is obtained:
[0083] Summary = Concat j={1,2,...5} (S j )
[0084] In the above formula, "Summary" refers to a summary of the entire legal document.
[0085] In summary, by using the legal document abstract automatic generation method provided by the application, the final output legal document abstract has complete structure and accurate content, and the text in the input generation model is shortened each time, so that the program can run in parallel, thereby reducing the running time of the model.
[0086] The embodiment verifies the implementation effect of the application through a specific experiment.
[0087] (1) Data Description
[0088] The data set used in the experiment is derived from the CAIL (China AI and Law Challenge) competition 2020 judicial abstract track, and contains 9484 data, each data containing a first instance civil judgment original text and a true abstract obtained by artificial annotation.
[0089] (2) Evaluation Index
[0090] The F1 value of ROUGE-1, ROUGE-2 and ROUGE-L in the automatic evaluation model commonly used in text abstract is used as the evaluation index in the experiment, and the Python toolkit rouge is used to realize the code.
[0091] The calculation of the ROUGE index is based on the matching of n-gram and the statistics of matching fragments. Since Chinese can use both characters and words as gram units, in order to evaluate the effect of each method fairly, the results of the ROUGE index at the character level and the word level are evaluated in this embodiment.
[0092] (3) Comparative Experiment
[0093] In order to verify the effectiveness of the model of the application comprehensively, the experiment compares it with several different types of baseline models, and the baseline models compared with the model of the application include:
[0094] Unsupervised extractive abstract method:
[0095] LEAD-3: Improved LEAD-3 algorithm, select the sentence with "litigation request" and the two sentences after it to splice as the abstract, if there is no "litigation request" word, select the sentences with index 11-13 directly.
[0096] TextRank [Mihalcea & Tarau, 2004]: The text is constructed as a graph with sentence nodes and sentence repetition degree edges, and the three sentence nodes with the highest PageRank value are selected to splice as the abstract.
[0097] Supervised extractive abstract method:
[0098] BertSum[Liu, 2019]: After using pre-trained language model to represent the sentence, directly do binary classification problem, and splice the sentence classified as positive as the summary. Because the text in the data set is too long, this experiment uses Longformer[Beltagy et al., 2020] which can realize long text input to realize the BertSum architecture.
[0099] Generative summary method:
[0100] Pointer Generator Network[See et al., 2017]: Use an Encoder-Decoder model with a copy mechanism to realize summary generation.
[0101] Bert+UniLM: Use UniLM architecture summary generation model based on Bert pre-trained language model to initialize parameters.
[0102] NEZHA+UniLM: Use UniLM architecture summary generation model based on NEZHA pre-trained language model to initialize parameters.
[0103] BART[Lewis et al., 2019]: Pre-trained language model of Encoder-Decoder architecture.
[0104] CPT[Shao et al., 2021]: Pre-trained language model of Chinese Encoder-Decoder architecture.
[0105] T5 Pegasus[Su, 2021]: Chinese summary generation pre-trained language model.
[0106] SPACES[Su, 2021]: Use extract-then-generate architecture to realize summary generation. The generation part uses NEZHA+UniLM model similar to the method of the application.
[0107] The test results are shown in Table 1:
[0108] Table 1 Model test results
[0109]
[0110] As shown in Table 1, the application performs better than other participating comparison methods in legal document summary generation, and the ROUGE value is improved. This result verifies the effectiveness of the application in using semantic segmentation to realize summary on legal documents.
[0111] In addition to the improvement of the text summary generation index ROUGE, the method of the application has also been improved in running time: compared with other baseline models using the UniLM architecture, the method of the application reduces the text length of a single input generation model, and uses a semantic segmentation method so that the model can generate summaries of each semantic structure in parallel, thus also showing an advantage in time in actual operation. The specific experimental time is shown in Table 2:
[0112] Table 2 Model experimental time
[0113]
[0114] In calculating the use time of each model, the SPACES model needs to be preprocessed and extracted first, and the generation training is performed in each training phase of the epoch; the method of the application is divided into stages, and the training is performed in the structure segmentation and summary generation stages respectively. As can be seen from Table 2, in the training stage, the use time of the method of the application is slightly more than that of the Bert+UniLM and SPACES methods, but this is acceptable; since the autoregressive method is adopted, the UniLM architecture-based method takes more time in the test stage, and in the test stage, the use time of the application is shorter than that of other models, which reflects the time superiority of the parallel method used in the summary generation stage.
[0115] In the embodiment, an automatic summary system of legal documents based on semantic segmentation is also provided, which is used to implement the above-mentioned embodiments and has been described above. The terms "module", "unit" and the like used below can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible.
[0116] The system comprises:
[0117] A semantic segmentation module is configured to segment the legal documents into five text segments according to semantic segmentation, i.e., a dispute category, a plaintiff claim, a defendant statement, a fact and reason, and a basis for judgment, a judgment main text and a tail part;
[0118] A summary generation module is configured to generate a summary for each text segment after semantic segmentation;
[0119] A summary splicing module is configured to splice the summaries corresponding to each text segment to obtain a summary of the entire legal document.
[0120] The implementation process of the functions and roles of each module in the system is specifically described in the implementation process of the corresponding steps in the above method, and will not be repeated here. For the system embodiment, since it basically corresponds to the method embodiment, please refer to the part of the method embodiment for the related description. The system embodiments described above are only illustrative, and the modules described as separate components can or can not be physically separated, i.e., they can be located in one place or distributed on multiple network elements. Part or all of the modules can be selected to achieve the purpose of the present application according to actual needs. Those skilled in the art can understand and implement it without creative labor.
[0121] The above-described embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of patent protection. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of protection of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for automatic summarization of legal documents based on semantic segmentation, characterized in that, The application relates to a method for obtaining a legal document, performing semantic segmentation on a judgment document based on a continuous sentence classification method, dividing the judgment document into five semantic paragraphs of five semantic structures of a dispute category, a plaintiff claim, a defendant statement, facts and reasons, and a judgment basis, a judgment main text and a tail part, and numbering the five semantic structures in a continuous ascending order respectively; obtaining an abstract for each semantic paragraph after segmentation based on a generative text abstract method; and splicing the abstracts of the text paragraphs after segmentation of the same legal document to obtain a final result. The method based on the continuous sentence classification comprises the following steps: dividing the legal document into multiple sentences according to punctuation marks and arranging the sentences in sequence; obtaining a representation of each sentence based on a Bert pre-training language model, classifying the sentences according to the representation and obtaining a predicted category sequence; correcting the classification results that do not conform to the semantic structure sequence; and aggregating the sentences of the same category in sequence to obtain semantic paragraphs of different semantic structures. The correction of the classification results that do not conform to the semantic structure sequence comprises the following steps: determining whether the predicted category sequence is increasing, if yes, the semantic structure sequence is correct, and if not, correcting the abnormal category to a category with more continuous ascending numbers according to the categories before and after the abnormal category, and if there are two or more categories with the same number of continuous ascending numbers, correcting the category to a category with a higher overall probability. The method for calculating the overall probability is as follows: for two or more categories with the same number of continuous ascending numbers, the product of the probability of each category is calculated to obtain the overall probability of the category. The method based on the Bert pre-training language model for obtaining the representation of each sentence and classifying the sentences according to the representation is as follows: The method based on the generative text abstract is as follows: The abstract generation model adopts a UniLM model initialized based on a NEZHA pre-training language model.
2. The method for automatic summarization of legal documents based on semantic segmentation according to claim 1, characterized in that, In the training stage, the semantic paragraph and the real abstract are used as inputs; in the test stage, the semantic paragraph is used as input, and the abstract is generated in a self-recurrent manner. ; ; ; wherein, denotes the representation of the i-th sentence, denotes the i-th sentence, denotes the Bert model, denotes the average pooling operation, denotes the BiGRU model, denotes the BiGRU output and its hidden layer of the i-th sentence, denotes the multi-layer perceptron, denotes taking the semantic structure with the largest probability as the generation result. 3.The method of claim 1, wherein, The loss function in the training stage comprises the following: ; wherein, represents the first semantic paragraph corresponding to the summary, represents the first semantic paragraph corresponding to the summary generation model, represents the first semantic paragraph.
4. The method of claim 3, wherein the semantic segmentation-based automatic summarization of legal documents is characterized by, a text generation loss function between the predicted abstract and the real abstract; 5. The method of claim 3, wherein the semantic segmentation-based automatic summarization of legal documents is characterized by, a loss function of BIO paradigm sequence labeling; 6. The method of claim 5, wherein the semantic segmentation-based automatic summarization of legal documents is characterized by, both the two loss functions adopt K sparse cross-entropy loss. The application relates to a method for obtaining a legal document, performing semantic segmentation on a judgment document based on a continuous sentence classification method, dividing the judgment document into five semantic paragraphs of five semantic structures of a dispute category, a plaintiff claim, a defendant statement, facts and reasons, and a judgment basis, a judgment main text and a tail part, and numbering the five semantic structures in a continuous ascending order respectively; obtaining an abstract for each semantic paragraph after segmentation based on a generative text abstract method; and splicing the abstracts of the text paragraphs after segmentation of the same legal document to obtain a final result. 7. A system for automatic summarization of legal documents based on semantic segmentation, characterized in that, The method based on continuous sentence classification comprises: dividing a legal document into multiple sentences according to punctuation marks and arranging the sentences in sequence; obtaining a representation of each sentence based on a Bert pre-training language model, classifying the sentences according to the representation, and obtaining a predicted category sequence; correcting the classification result that does not conform to the semantic structure sequence; and aggregating the sentences classified into the same category in sequence to obtain semantic paragraphs of different semantic structures. The method for correcting the classification result that does not conform to the semantic structure sequence comprises: determining whether the predicted category sequence is increasing, if yes, the semantic structure sequence is correct, if not, correcting the abnormal category to a category with more continuous ascending numbers according to the category before and after the abnormal category, if there are two or more categories with the same number of continuous ascending numbers, the category with a higher overall probability is corrected; the method for calculating the overall probability is: for two or more categories with the same number of continuous ascending numbers, the product of the probability of each category is calculated to obtain the overall probability of the category; an abstract generation module for obtaining an abstract for each semantic paragraph after segmentation based on a generative text abstract method; an abstract splicing module for splicing the abstracts generated by each text paragraph after segmentation of the same legal document in sequence to obtain a final result.
Citation Information
Patent Citations
Document abstract generation method and device, equipment and storage medium
CN113420143A
Systems and methods for determining and using semantic relatedness to classify segments of text
US20210279420A1