Method and device for segmenting judgment document, electronic equipment and storage medium

Through technical means such as Bert model and two-way long and short-term memory network, the segmentation process of judicial documents is optimized, and the problem of low accuracy of paragraph recognition in the existing technology is solved, and more accurate and reasonable structured segmentation results are achieved.

CN119830914AActive Publication Date: 2025-04-15CHINASYS TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411696170.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-15
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The existing methods for identifying paragraphs of judgment documents have low accuracy and cannot adapt to the diversity and changes in the format of judgment documents.

Method used

By entering the referee document into the Bert model, a vectorized representation of each sentence is obtained, and the context information is determined based on the two-way long and short-term memory network and attention mechanism, the preliminary segmentation results are optimized, and the final segmentation results are obtained.

Benefits of technology

The accuracy of paragraph recognition of the judgment document is improved, so that the segmentation results are more in line with the actual structure of the judgment document, and the semantic information and contextual relationship of individual sentences are considered.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830914A_ABST
    Figure CN119830914A_ABST
Patent Text Reader

Abstract

The invention provides a segmentation method and device for a judgment document, electronic equipment and a storage medium, and the method comprises the steps: inputting a target judgment document into a Bert model, and obtaining a vectorization representation of each sentence of text in the target judgment document; segmenting the target judgment document based on the vectorization representation of each sentence of text to obtain a preliminary segmentation result; and based on the vectorization representation of each sentence of text, determining context information of each sentence of text of the target judgment document, and based on the context information, adjusting the preliminary segmentation result to obtain a final segmentation result of the target judgment document. By inputting the judgment document into the Bert model, the vectorization representation of each sentence of text is obtained, and the segmentation result is further optimized based on the context information, so that the segmentation is more in line with the actual structure of the judgment document. The final segmentation result not only considers the semantic information of a single sentence, but also further improves the segmentation accuracy through the context relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a method, device, electronic device and storage medium for segmenting judicial documents. Background Art

[0002] Existing judicial document paragraph recognition has always used technologies such as rule matching, template matching, and natural language processing. These document recognition technologies have certain limitations. For example, the rule-based method relies on manually formulated rules and requires specific anchor points, formats, and keywords to achieve paragraph recognition, which cannot adapt to the diversity and changes in judicial document formats; the template matching-based method requires recognition through a similarity comparison between the judicial document to be recognized and the template, which is heavily dependent on the quality and quantity of the template.

[0003] The existing methods for recognizing paragraphs in judicial documents have a low accuracy rate in recognizing paragraphs in judicial documents. Summary of the invention

[0004] The present invention provides a method, device, electronic device and storage medium for segmenting judicial documents, so as to improve the accuracy of paragraph recognition of judicial documents.

[0005] The present invention provides a method for segmenting a judgment document, comprising the following steps: Input the target judgment document into the Bert model to obtain a vectorized representation of each sentence in the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence in the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; Based on the vectorized representation of each sentence of text, segment the target judgment document to obtain a preliminary segmentation result of the target judgment document; Based on the vectorized representation of each sentence of text, the context information of each sentence of text in the target judicial document is determined, and based on the context information, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0006] According to a method for segmenting a judgment document provided by the present invention, determining the context information of each sentence of the target judgment document based on the vectorized representation of each sentence of the text includes: The vectorized representation of each sentence of text is input into a bidirectional long short-term memory network to obtain a contextual information representation of each sentence of text output by the bidirectional long short-term memory network. The bidirectional long short-term memory network is trained based on judicial document samples and their corresponding paragraph category labels containing specific semantic features.

[0007] According to a method for segmenting a judicial document provided by the present invention, the preliminary segmentation result is adjusted based on the context information representation to obtain the final segmentation result of the target judicial document, including: Based on the attention mechanism, the weight of each time step is calculated for the hidden state output by the bidirectional long short-term memory network; Based on the weight, weighting the context information representation of each sentence of text to obtain a weighted context information representation of each sentence of text; Based on the weighted context information representation of each sentence of text, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0008] According to a method for segmenting judicial documents provided by the present invention, after obtaining the context information representation of each sentence of the text output by the bidirectional long short-term memory network, the method further includes: Based on the conditional random field, determining a mapping relationship between an input and an output of the bidirectional long short-term memory network; Based on the mapping relationship, each output of the bidirectional long short-term memory network is optimized.

[0009] According to a method for segmenting judicial documents provided by the present invention, before inputting the vectorized representation of each sentence of text into a bidirectional long short-term memory network, the method further includes: Verifying the bidirectional long short-term memory network based on a pre-constructed verification set and determining a verification result, wherein the verification set is constructed based on a plurality of judicial documents in a judicial document library; And based on the verification result, the parameters of the bidirectional long short-term memory network are adjusted.

[0010] According to a method for segmenting judicial documents provided by the present invention, the training labels include at least litigation participants, case description, case facts, judgment logic, judgment reasons, judgment results and litigation relationships.

[0011] The present invention also provides a segmentation device for a judgment document, comprising the following modules: A text vector determination module, used to input a target judgment document into a Bert model, and obtain a vectorized representation of each sentence of text in the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence of text in the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; A preliminary segmentation module, used to segment the target judgment document based on the vectorized representation of each sentence of text, and obtain a preliminary segmentation result of the target judgment document; The segmentation optimization module is used to determine the context information of each sentence of the target judicial document based on the vectorized representation of each sentence of the text, and adjust the preliminary segmentation result based on the context information to obtain the final segmentation result of the target judicial document.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for segmenting a judicial document as described in any one of the above-mentioned methods is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for segmenting judicial documents as described in any one of the above-mentioned methods.

[0014] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements a method for segmenting a judicial document as described in any one of the above-mentioned methods.

[0015] The segmentation method, device, electronic device and storage medium of the judicial document provided by the present invention obtain the vectorized representation of each sentence of text by inputting the judicial document into the Bert model, and further optimize the segmentation result based on the context information, so as to identify the key information and structural features in the judicial document, such as the title, litigation participants, case facts, reasons for the judgment, etc., and automatically divide the judicial document into multiple paragraphs based on this information, thereby realizing the automatic segmentation process of the judicial document and making the segmentation more in line with the actual structure of the judicial document. The final segmentation result not only takes into account the semantic information of the individual sentences, but also further improves the accuracy of the segmentation through the contextual relationship. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a flow chart of the method for segmenting judicial documents provided by the present invention.

[0018] Figure 2 It is a schematic diagram of the segmented model construction process provided by the present invention.

[0019] Figure 3 It is a schematic diagram of the supplemented sample structure provided by the present invention.

[0020] Figure 4 It is a schematic diagram of the document segmentation structure provided by the present invention.

[0021] Figure 5 It is a structural schematic diagram of the segmentation device of the judicial document provided by the present invention.

[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Figure 1 is a flow chart of the method for segmenting judicial documents provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 110, inputting the target judgment document into the Bert model, and obtaining a vectorized representation of each sentence of the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence of the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; Step 120, segmenting the target judgment document based on the vectorized representation of each sentence of text to obtain a preliminary segmentation result of the target judgment document; Step 130, based on the vectorized representation of each sentence of text, determine the context information of each sentence of text in the target judicial document, and based on the context information representation, adjust the preliminary segmentation result to obtain the final segmentation result of the target judicial document.

[0025] The execution subject of the method for segmenting judicial documents provided by the present invention may be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), or a personal computer (PC), etc., which is not specifically limited by the present invention.

[0026] The following takes the method for segmenting the judicial documents provided by the present invention executed by a computer as an example to explain the technical solution of the present invention in detail.

[0027] In step 110, the target judicial document is input into the Bert model to obtain a vectorized representation of each sentence of the target judicial document output by the Bert model. The Bert model is trained based on judicial document samples and training labels annotated in each sentence of the judicial document samples, and the training labels are determined based on key case elements in the judicial document samples.

[0028] The Bert model needs to be trained in advance. The training process of the Bert model includes: The training is carried out through judicial documents samples and their corresponding training labels. The training labels here are annotated based on the key case elements in the judicial documents (such as case facts, litigation participants, reasons for the judgment, etc.).

[0029] The role of training labels is to tell the model which parts of each sentence are important and which parts need special attention. The annotation of training data is usually provided by manual annotation or based on the knowledge of domain experts.

[0030] Obtain the target judgment document to be processed. After obtaining the target judgment document, the target judgment document can be preprocessed. The preprocessing process mainly includes removing irrelevant characters, deduplication, formatting, etc., to ensure the accuracy and completeness of the target judgment document data.

[0031] To input the target judgment document into the trained Bert model, the text must first be preprocessed into a format suitable for Bert model input: the judgment document is processed into sentences, and each sentence is used as an independent input sequence. For each sentence, the Bert model will generate a corresponding vectorized representation.

[0032] It should be noted that the Bert model outputs a vectorized representation for each sentence through the input of each sentence. This vector representation contains the context information of the sentence.

[0033] Among them, Bert (Bidirectional Encoder Representations from Transformers) is a bidirectional encoder model based on Transformer. It can deeply understand the semantic information of the text through pre-training on a large-scale corpus. In the segmentation of judicial documents, the Bert model can: (1) Understand semantic relationships: The Bert model can accurately understand the semantic relationships between sentences in judicial documents, including causal relationships, parallel relationships, transitional relationships, etc., which is crucial for the segmentation of judicial documents. (2) Identify paragraph themes: Based on its powerful semantic understanding ability, the Bert model can accurately identify the theme of each paragraph in the judicial document, thereby helping to achieve more refined segmentation. (3) Improve segmentation accuracy: Through the semantic understanding of the Bert model, the logical relationship and content coherence between different paragraphs in the judicial document can be more accurately judged, thereby improving the accuracy of segmentation.

[0034] In specific applications, the Bert model is used to vectorize each sentence. The general output of the Bert model is pooler_output and last_hidden_state, where last_hidden_state is the concatenation of Bert's encoding of each token, and its shape is [batch_size, max_seq_length, hidden_dim]. Pooler_output is Bert's [CLS] vector, which is the result of pooling all token vectors, and its shape is [batch_size, hidden_dim]. In the segmentation of judicial documents, the pooler_output of each sentence is taken as a vector. After filling to the maximum limit of the length of the sentence, its shape is [batch_size, max_sentence_number, hidden_dim].

[0035] In the sequence tagging task, the goal of vectorization is to represent words. Taking the RNN model as an example, the input size required by RNN is [batch_size, max_seq_length, hidden_dim], so in the data of [batch_size, max_seq_length], the vectorized size is [batch_size, max_seq_length, hidden_dim] to meet the RNN input requirements. If the words are also represented in this project, the size at this time is [batch_size, max_sentences_length, max_seq_length, hidden_dim], so the model uses bert's pooler_output as the representation of the sentence, so that the vectorized size meets the encoder input.

[0036] In step 120, the target judicial document is segmented based on the vectorized representation of each sentence of text to obtain a preliminary segmentation result of the target judicial document.

[0037] After obtaining the vectorized representation of each sentence, we can perform preliminary segmentation based on these vectors. The goal of segmentation is to divide the document into different parts based on the semantic similarity of the text content.

[0038] For example, to calculate the similarity between sentences: Based on the BERT vectorized representation of each sentence, the cosine similarity or Euclidean distance between the sentences is calculated. If the similarity between two sentences is high, then they are likely to belong to the same paragraph or part, thus achieving the preliminary segmentation process of the target judicial document.

[0039] In step 130, based on the vectorized representation of each sentence of text, the context information of each sentence of the target judicial document is determined, and based on the context information representation, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0040] Optionally, models such as BiLSTM or Transformer can be used to further model the contextual relationship between sentences. Based on the sentence vector output by Bert, BiLSTM can capture the dependency between previous and next sentences and help distinguish the boundaries between different paragraphs.

[0041] After obtaining the preliminary segmentation, the segmentation results are optimized and adjusted based on the context information. The adjustment can be done by: Context-based weight adjustment: Dynamically adjust segment boundaries based on the context of the sentence (such as its position in the document and its relationship with the previous and next sentences). For example, if the context information of a paragraph is similar to that of the previous paragraph, these sentences can be merged together; if the difference is large, they can be divided into different paragraphs.

[0042] Consider the structure of the text: Judgment documents usually have a certain structure, such as different parts such as case facts, judgment basis, and judgment reasons. Using this structural information, the preliminary segmentation results can be further adjusted to make the segmentation more consistent with the format of the actual document.

[0043] After adjusting and optimizing the context information, the final segmentation result of the target judicial document is obtained. At this point, the accuracy of the segmentation will be improved because the initial segmentation takes into account the semantic similarity of the sentences; the final segmentation is optimized based on the context information, making the structure and logic of the document clearer.

[0044] Specifically, based on the above method, an automatic segmentation model of a target judicial document can be constructed. The schematic diagram of the segmentation model construction process of the target judicial document can be as follows: Figure 2 The schematic diagram of the segmented model construction process provided by the present invention is shown in FIG.

[0045] Data collection and preprocessing, collect judicial documents from cooperative units and public documents, and preprocess the original data; data labeling and creation of data labeling sets, form a certain amount of data labeling sets through manual data labeling; select deep learning framework and design model framework; data construction and data loading, preprocess the labeled data and input it into the model; model training, input the processed data into the model for training; model evaluation and parameter adjustment, use the validation set to evaluate the model, and adjust the parameters according to the evaluation results; model storage and deployment.

[0046] Optionally, the trained segmentation model can be saved to a local or cloud storage device for subsequent prediction and classification tasks. The segmentation model is deployed in actual applications to pre-process the input judgment documents and use the model for prediction to obtain segmentation results.

[0047] The segmentation method of judicial documents provided by the present invention obtains a vectorized representation of each sentence of text by inputting the judicial documents into the Bert model, and further optimizes the segmentation results based on context information, so as to identify key information and structural features in the judicial documents, such as titles, litigation participants, case facts, and reasons for judgment, and automatically divide the judicial documents into multiple paragraphs based on this information, thereby realizing the automatic segmentation process of the judicial documents and making the segmentation more consistent with the actual structure of the judicial documents. The final segmentation result not only takes into account the semantic information of individual sentences, but also further improves the accuracy of segmentation through contextual relationships.

[0048] In one embodiment, based on the vectorized representation of each sentence of text, the context information of each sentence of the target judicial document is determined, including: inputting the vectorized representation of each sentence of text into a bidirectional long short-term memory network to obtain the context information representation of each sentence of text output by the bidirectional long short-term memory network, wherein the bidirectional long short-term memory network is trained based on judicial document samples and their corresponding paragraph category labels containing specific semantic features.

[0049] Optionally, the bidirectional long short-term memory network can be a BiLSTM network. BiLSTM (Bidirectional Long Short-Term Memory) is a bidirectional long short-term memory network model that can capture long-distance dependencies in text. In the segmentation of judicial documents, BiLSTM can: (1) capture contextual information. BiLSTM can simultaneously capture the information before and after the current position in the text through bidirectional propagation, thereby achieving a comprehensive understanding of the contextual information. (2) Optimize the segmentation results. Based on the captured contextual information, BiLSTM can further optimize the segmentation results of judicial documents, making the segmentation more consistent with the logical structure and content coherence of the text.

[0050] In specific applications, BiLSTM, as an "encoder" of a special type of recurrent neural network that can process sequence data, captures the long-term dependencies in the input sequence data through LSTM units in two directions and converts the input sequence data into a fixed-length vector representation.

[0051] During the training phase, the goal of BiLSTM is not only to capture the contextual information of each sentence, but also to further optimize its output according to the category label. Each paragraph or sentence in the judgment document can be labeled as a certain category according to specific semantic features. For example: Case facts: describe the background and facts of the case. Reasons for judgment: list the basis and analysis of the court's judgment. Judgment result: the conclusion of the judgment.

[0052] The samples of judicial documents sampled during the training process can be based on the judicial document production specifications, and based on the legal knowledge system and structural logic system between the context paragraphs of the judicial documents, divide the natural paragraphs containing specific semantic features; set legal feature labels for the above natural paragraphs containing specific semantic features according to the legal language specifications; and build a segmented legal feature label system for judicial documents based on the legal feature labels. Manual segmentation and labeling and labeling database construction, based on the segmentation plan, manually label the different paragraphs of the judicial documents (such as the litigation participant segment and the judgment result segment) to create a labeled data set for training the model.

[0053] Before training, the judicial document samples need to be processed and the maximum number of sentences in the text needs to be defined. If the maximum number of sentences in the text exceeds the maximum limit, the document will be truncated into multiple documents. At the same time, [B-] will be added before the first label, and [I-] will be added before the labels that appear later. If the same document is divided into multiple documents, the suffix [_number] will be added after the document number to distinguish them, and the first label of the segmented document will be changed to [B-label]. Load each segmented document, set the maximum sentence length, truncate the text that exceeds the maximum sentence length, and fill the text that does not exceed the maximum sentence length with a number of [ <pad>】; Fill in a number of false sentences after the document that does not exceed the maximum length limit. The false sentences are 【 <pad>Maximum sentence length]. The sample structure obtained can be as follows Figure 3 The schematic diagram of the supplemented sample structure provided by the present invention is shown.

[0054] Each paragraph or sentence belongs to one or more of the above categories according to its content. These paragraph category labels are supervisory signals used to guide the model to learn how to generate correct context information representation based on context information.

[0055] During training, BiLSTM is trained based on judicial document samples and paragraph category labels, so that the model can learn: how to adjust sentence representation based on context information to adapt to different categories of paragraphs, and how to predict labels based on paragraph category labels so that the final context information representation matches the target label.

[0056] By using the advantages and complementarity of BERT and BiLSTM in natural language processing, we can achieve accurate and efficient understanding and processing of document content. BERT, as a feature extractor, converts text into high-quality vector representations. These word vectors are then used as inputs to BiLSTM for further sequence modeling and contextual information capture. This combination can fully utilize the representation capabilities of BERT and the sequence modeling capabilities of BiLSTM, thereby improving the accuracy of document segmentation.

[0057] In one embodiment, based on the context information representation, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document, including: based on the attention mechanism, calculating the weight of each time step for the hidden state output by the bidirectional long short-term memory network; based on the weight, weighting the context information representation of each sentence of text to obtain the weighted context information representation of each sentence of text; based on the weighted context information representation of each sentence of text, adjusting the preliminary segmentation result to obtain the final segmentation result of the target judicial document.

[0058] The attention mechanism is an effective weighting method that highlights important information by assigning different weights to each time step in a sequence. Unlike traditional recurrent neural networks (RNNs), the attention mechanism can dynamically focus on the key parts of the input, thereby improving the expressiveness of the model.

[0059] Based on the hidden state of BiLSTM output, an attention mechanism is introduced to calculate the weight of each time step.

[0060] Through the attention weights, the hidden state vector of each time step can be weighted to obtain the weighted context information representation of each sentence.

[0061] When segmenting text, the model needs to judge which sentences belong to the same paragraph and which sentences should be divided into different paragraphs based on the context information representation of each sentence. Using the weighted context information representation, the preliminary segmentation results can be adjusted more accurately.

[0062] An attention mechanism is introduced into the bidirectional long short-term memory network to dynamically adjust the degree of attention to different parts. The attention mechanism can be calculated based on text content and format features to highlight important paragraphs or sentences. Through training, the bidirectional long short-term memory network can learn how to effectively use the attention mechanism to capture important information in judicial documents.

[0063] The combination of BiLSTM and attention mechanism can better capture the contextual information in the text and the dependencies between sentences, thereby effectively improving the accuracy of text understanding and segmentation.

[0064] In one embodiment, after obtaining the context information representation of each sentence of text output by the bidirectional long short-term memory network, it also includes: determining the mapping relationship between the input and output of the bidirectional long short-term memory network based on the conditional random field; and optimizing each output of the bidirectional long short-term memory network based on the mapping relationship.

[0065] Specifically, BiLSTM receives the input sentence sequence and generates a hidden state for each time step (each word). Each hidden state contains the semantic information of the word and its context, indicating the meaning of the word in the entire context.

[0066] Conditional Random Field (CRF) is a model that can capture the dependencies between label sequences. It optimizes the output of the entire sequence by maximizing the conditional probability, finding the best label sequence, and considering the transition probability between labels and the emission probability of a single label.

[0067] Use CRF to optimize the output of the model. CRF can consider the contextual information of the entire sequence to output a more accurate and coherent label sequence. By maximizing the conditional probability, CRF can learn the mapping relationship between the input and output label sequences and output the optimal paragraph segmentation result.

[0068] Specifically, the schematic diagram of the segmented structure of the document can be as follows: Figure 4 The document segmentation structure provided by the present invention is shown as follows. The target judicial document is input into the Bert model to obtain a vectorized representation of each sentence in the target judicial document. Based on the LSTM model, the context information of each sentence of the target judicial document is determined. The mapping relationship between the input and output label sequences is learned based on CRF, and the optimal paragraph segmentation result is output.

[0069] In one embodiment, before the vectorized representation of each sentence of text is input into the bidirectional long short-term memory network, it also includes: verifying the bidirectional long short-term memory network based on a pre-constructed verification set and determining the verification result, wherein the verification set is constructed based on multiple judicial documents in a judicial document library; and adjusting the parameters of the bidirectional long short-term memory network based on the verification result.

[0070] Use the validation set to evaluate the model and calculate the model's accuracy, recall, F1 value and other indicators. These indicators can reflect the performance of the model in different aspects.

[0071] Adjust the model parameters according to the evaluation results, such as adjusting the learning rate, batch size and other parameters to improve the performance of the model.

[0072] In one embodiment, the training labels include at least litigation participants, case description, case facts, judgment logic, judgment reasons, judgment results and litigation relationships.

[0073] By labeling multiple key elements of judicial documents (such as litigation participants, case facts, and reasons for judgment, etc.), the model can learn the semantics and logical relationships of each part. Combining the powerful capabilities of BERT, BiLSTM, and CRF, the model can accurately identify and understand the structure of judicial documents and perform precise labeling and text segmentation.

[0074] The segmentation device for judicial documents provided by the present invention is described below. The segmentation device for judicial documents described below and the segmentation method for judicial documents described above can be referenced to each other.

[0075] like Figure 5 As shown, the device comprises: A text vector determination module 510 is used to input a target judgment document into a Bert model to obtain a vectorized representation of each sentence of text in the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence of text in the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; A preliminary segmentation module 520, configured to segment the target judgment document based on the vectorized representation of each sentence of text, and obtain a preliminary segmentation result of the target judgment document; The segmentation optimization module 530 is used to determine the context information of each sentence of the target judicial document based on the vectorized representation of each sentence of the text, and adjust the preliminary segmentation result based on the context information to obtain the final segmentation result of the target judicial document.

[0076] The segmentation device for judicial documents provided by the present invention obtains a vectorized representation of each sentence of text by inputting the judicial documents into the Bert model, and further optimizes the segmentation results based on context information, so as to identify key information and structural features in the judicial documents, such as titles, litigation participants, case facts, and reasons for judgment, and automatically divide the judicial documents into multiple paragraphs based on this information, thereby realizing the automatic segmentation process of the judicial documents and making the segmentation more consistent with the actual structure of the judicial documents. The final segmentation result not only takes into account the semantic information of individual sentences, but also further improves the accuracy of segmentation through contextual relationships.

[0077] In a real time, the segment optimization module 530 is specifically used to: Based on the vectorized representation of each sentence of text, determining the context information of each sentence of text in the target judgment document includes: The vectorized representation of each sentence of text is input into a bidirectional long short-term memory network to obtain a contextual information representation of each sentence of text output by the bidirectional long short-term memory network. The bidirectional long short-term memory network is trained based on judicial document samples and their corresponding paragraph category labels containing specific semantic features.

[0078] In a real time, the segment optimization module 530 is further specifically used for: The step of adjusting the preliminary segmentation result based on the context information representation to obtain the final segmentation result of the target judgment document includes: Based on the attention mechanism, the weight of each time step is calculated for the hidden state output by the bidirectional long short-term memory network; Based on the weight, weighting the context information representation of each sentence of text to obtain a weighted context information representation of each sentence of text; Based on the weighted context information representation of each sentence of text, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0079] In a real time, the segment optimization module 530 is further specifically used for: After obtaining the context information representation of each sentence of the text output by the bidirectional long short-term memory network, the method further includes: Based on the conditional random field, determining a mapping relationship between an input and an output of the bidirectional long short-term memory network; Based on the mapping relationship, each output of the bidirectional long short-term memory network is optimized.

[0080] In a real time, the segment optimization module 530 is further specifically used for: Before inputting the vectorized representation of each sentence of text into the bidirectional long short-term memory network, the method further includes: Verifying the bidirectional long short-term memory network based on a pre-constructed verification set and determining a verification result, wherein the verification set is constructed based on a plurality of judicial documents in a judicial document library; And based on the verification result, the parameters of the bidirectional long short-term memory network are adjusted.

[0081] In a real time, the text vector determination module 510 is specifically used to: The training labels include at least litigation participants, case description, case facts, judgment logic, judgment reasons, judgment results and litigation relationships.

[0082] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the segmentation method of the judgment document, the method comprising: inputting the target judgment document into the Bert model, obtaining the vectorized representation of each sentence of the target judgment document output by the Bert model, the Bert model is trained based on the judgment document sample and the training labels annotated in each sentence of the judgment document sample, and the training labels are determined based on the key case elements in the judgment document sample; Based on the vectorized representation of each sentence of text, segment the target judgment document to obtain a preliminary segmentation result of the target judgment document; Based on the vectorized representation of each sentence of text, the context information of each sentence of text in the target judicial document is determined, and based on the context information, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0083] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0084] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the judgment document segmentation method provided by the above methods, the method comprising: inputting a target judgment document into a Bert model, obtaining a vectorized representation of each sentence of text in the target judgment document output by the Bert model, the Bert model is trained based on a judgment document sample and a training label annotated in each sentence of text in the judgment document sample, and the training label is determined based on key case elements in the judgment document sample; Based on the vectorized representation of each sentence of text, segment the target judgment document to obtain a preliminary segmentation result of the target judgment document; Based on the vectorized representation of each sentence of text, the context information of each sentence of text in the target judicial document is determined, and based on the context information, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0085] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when executed by a processor to execute the judgment document segmentation method provided by the above methods, the method comprising: inputting a target judgment document into a Bert model, obtaining a vectorized representation of each sentence of text in the target judgment document output by the Bert model, wherein the Bert model is trained based on a judgment document sample and a training label annotated in each sentence of text in the judgment document sample, and the training label is determined based on key case elements in the judgment document sample; Based on the vectorized representation of each sentence of text, segment the target judgment document to obtain a preliminary segmentation result of the target judgment document; Based on the vectorized representation of each sentence of text, the context information of each sentence of text in the target judicial document is determined, and based on the context information, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

[0086] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / pad> < / pad>

Claims

1. A method for segmenting a judicial document, characterized in that: include: Input the target judgment document into the Bert model to obtain a vectorized representation of each sentence in the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence in the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; Based on the vectorized representation of each sentence of text, segment the target judgment document to obtain a preliminary segmentation result of the target judgment document; Based on the vectorized representation of each sentence of text, the context information of each sentence of text in the target judicial document is determined, and based on the context information, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

2. The method for segmenting judicial documents according to claim 1, characterized in that: The determining of context information of each sentence of the target judgment document based on the vectorized representation of each sentence of the text includes: The vectorized representation of each sentence of text is input into a bidirectional long short-term memory network to obtain a contextual information representation of each sentence of text output by the bidirectional long short-term memory network. The bidirectional long short-term memory network is trained based on judicial document samples and their corresponding paragraph category labels containing specific semantic features.

3. The method for segmenting judicial documents according to claim 2, characterized in that: The step of adjusting the preliminary segmentation result based on the context information representation to obtain the final segmentation result of the target judgment document includes: Based on the attention mechanism, the weight of each time step is calculated for the hidden state output by the bidirectional long short-term memory network; Based on the weight, weighting the context information representation of each sentence of text to obtain a weighted context information representation of each sentence of text; Based on the weighted context information representation of each sentence of text, the preliminary segmentation result is adjusted to obtain the final segmentation result of the target judicial document.

4. The method for segmenting judicial documents according to claim 2, characterized in that: After obtaining the context information representation of each sentence of the text output by the bidirectional long short-term memory network, the method further includes: Based on the conditional random field, determining a mapping relationship between an input and an output of the bidirectional long short-term memory network; Based on the mapping relationship, each output of the bidirectional long short-term memory network is optimized.

5. The method for segmenting judicial documents according to claim 2, characterized in that: Before inputting the vectorized representation of each sentence of text into the bidirectional long short-term memory network, the method further includes: Verifying the bidirectional long short-term memory network based on a pre-constructed verification set and determining a verification result, wherein the verification set is constructed based on a plurality of judicial documents in a judicial document library; And based on the verification result, the parameters of the bidirectional long short-term memory network are adjusted.

6. The method for segmenting judicial documents according to claim 1, characterized in that: The training labels include at least litigation participants, case description, case facts, judgment logic, judgment reasons, judgment results and litigation relationships.

7. A device for segmenting judicial documents, characterized in that: include: A text vector determination module, used to input a target judgment document into a Bert model, and obtain a vectorized representation of each sentence of text in the target judgment document output by the Bert model, wherein the Bert model is trained based on judgment document samples and training labels annotated in each sentence of text in the judgment document samples, and the training labels are determined based on key case elements in the judgment document samples; A preliminary segmentation module, used to segment the target judgment document based on the vectorized representation of each sentence of text, and obtain a preliminary segmentation result of the target judgment document; The segmentation optimization module is used to determine the context information of each sentence of the target judicial document based on the vectorized representation of each sentence of the text, and adjust the preliminary segmentation result based on the context information to obtain the final segmentation result of the target judicial document.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the method for segmenting the judicial document as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for segmenting a judicial document as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the method for segmenting a judicial document as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Judgment document structured processing method and system

    CN110750974A

  • Judicial document paragraph classification method and device, computer equipment and storage medium

    CN111428485A

  • Long text classification method based on attention mechanism

    CN111984791A

  • Chinese grammar debugging method and system based on multivariate text features

    CN112183094A

  • Structured processing method and device for legal documents

    CN116152019A