A case extraction method and device based on deep learning
Through the combination of deep learning neural network and pre-trained model, the problem of low accuracy of existing case extraction methods is solved, efficient and accurate extraction of legal texts is achieved, adapting to the diversity and complexity of legal texts, and improving the extraction efficiency and accuracy.
Patent Information
- Application Number
- CN202410354901.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-03-26
AI Technical Summary
The existing case extraction method has low accuracy, is difficult to adapt to the diversity and complexity of legal texts, and requires a lot of time and resources to adjust and update.
A case extraction method based on deep learning is adopted to collect and preprocess historical legal text data, train the deep learning neural network model, and fine-tune it using the pre-trained neural network model, and combine it with the standard case collection to perform double verification to improve the accuracy of extraction.
Effectively improve the accuracy of case extraction, reduce misjudgment and misjudgment, have better generalization ability and adaptability, and can accurately extract various types of case causes, including new case types and changing legal issues, improving Efficiency.
Smart Images

Figure CN118114650B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a case cause extraction method and device. Background Art
[0002] Low accuracy is a common problem in existing case cause extraction methods. Methods based on rules or keyword matching are limited by pre-set rules and vocabulary, and are difficult to adapt to the diversity and complexity of legal texts. In addition, due to the flexible and diverse ways of expressing case causes, traditional methods often rely on manually compiled templates or rules, which require a lot of time and resources to adjust and update for new case types or changing legal issues. Summary of the invention
[0003] The present application provides a case cause extraction method and device, aiming to solve the technical problem of low accuracy of existing case cause extraction methods.
[0004] In a first aspect, a case extraction method based on deep learning includes:
[0005] S1, collecting historical legal text data from multiple fields, and performing data cleaning and preprocessing on the historical legal text data;
[0006] S2, marking the historical legal text data to indicate the location of the case in the historical legal text data;
[0007] S3, dividing the historical legal text data into a training set, a validation set and a test set;
[0008] S4, training a deep learning neural network model using the training set, and fine-tuning a pre-trained neural network model using the training set;
[0009] S5, obtaining target legal text data, inputting the target legal text data into the trained deep learning neural network model to obtain a corresponding case sequence; and inputting the target legal text data into the fine-tuned pre-trained neural network model to obtain a corresponding article summary;
[0010] S6, comparing the similarity between the case sequence and the potential case in the article summary; based on the similarity and in combination with the standard case list, determining whether the case sequence is accurate;
[0011] S7: If it is determined that the case sequence is accurate, output the case sequence.
[0012] In the above solution, optionally, the data cleaning and preprocessing of the historical legal text data includes:
[0013] Removing unnecessary special characters and punctuation marks from the historical legal text data;
[0014] Performing text normalization on the historical legal text data;
[0015] The historical legal text data is segmented using a word segmentation tool.
[0016] In the above scheme, optionally, the deep learning neural network includes an input layer, a BiLSTM layer and a CRF layer; the input layer is used to represent the legal text data as word embedding or character embedding; the BiLSTM layer is used to learn contextual information in the text; and the CRF layer is used to model the dependency relationship of the label sequence.
[0017] In the above scheme, optionally, the pre-trained neural network model is a BERT-Base-Chinese model.
[0018] In the above scheme, further optionally, before fine-tuning the pre-trained neural network model using the training set, the legal text data in the training set is encoded into an embedded representation that can be understood by the BERT model.
[0019] In the above solution, further optionally, step S4 also includes:
[0020] Unfreeze some BERT layers when fine-tuning the pre-trained neural network model;
[0021] When fine-tuning the pre-trained neural network model, adopting a corresponding preset loss function and fine-tuning strategy, and adjusting the hyperparameters of the pre-trained neural network model;
[0022] The validation set is used to evaluate the performance of the pre-trained neural network model, and the best model is selected according to the evaluation result to adjust and optimize the pre-trained neural network model.
[0023] In the above solution, optionally, step S4 further includes:
[0024] When training the deep learning neural network model, adjusting the hyperparameters of the deep learning neural network model;
[0025] The validation set is used to periodically evaluate the performance of the deep learning neural network model, and early stopping is performed when the performance no longer improves, and the optimal model parameters are saved.
[0026] In the above scheme, optionally, the historical legal text data includes court judgments, case records and regulations; the division ratios of the training set, the validation set and the test set are 70%, 15% and 15% respectively.
[0027] In the above scheme, optionally, in step S6, if the similarity exceeds a preset similarity threshold and meets the case cause specification in the standard case cause collection, it is determined that the case cause sequence is accurate.
[0028] In a second aspect, a case extraction device based on deep learning includes:
[0029] A data collection module, used to collect historical legal text data from multiple fields, and perform data cleaning and preprocessing on the historical legal text data;
[0030] A data annotation module, used to annotate the historical legal text data to indicate the location of the case in the historical legal text data;
[0031] A data set division module, used for dividing the historical legal text data into a training set, a validation set and a test set;
[0032] A model training module, used to train a deep learning neural network model using the training set, and to fine-tune a pre-trained neural network model using the training set;
[0033] A target legal text data acquisition module is used to acquire target legal text data, input the target legal text data into the trained deep learning neural network model to obtain a corresponding case sequence; and input the target legal text data into the fine-tuned pre-trained neural network model to obtain a corresponding article summary;
[0034] A comparison and judgment module, used to compare the similarity between the case sequence and the potential case in the article summary; based on the similarity and in combination with the standard case list, determine whether the case sequence is accurate;
[0035] The case sequence output module is used to output the case sequence if it is determined that the case sequence is accurate.
[0036] Compared with the prior art, this application has at least the following beneficial effects:
[0037] In the method provided in the embodiment of the present application, a deep learning neural network model is used to extract the case causes in the legal text, and a pre-trained neural network model is used to extract the corresponding article summary in the legal text. Then, by comparing the similarity between the case cause and the potential case cause in the article summary, the extracted case cause is double-verified in combination with the standard case cause list to obtain the final case cause; the method can effectively improve the accuracy of case cause extraction through similarity comparison and double verification of the standard case cause list, and reduce the occurrence of misjudgment and missed judgment; the case cause in the legal text is expressed in a flexible and diverse manner, and traditional methods often rely on manually compiled templates or rules, which are difficult to adapt to the diversity and complexity of legal texts; the method provided in the present application uses a deep neural network model to automatically learn the feature representation and summarization ability of the case cause, has better generalization ability and adaptability, and can accurately extract various types of case causes, including new case types and changing legal issues; the method provided in the present application uses deep learning technology, and automatically learns the feature representation and summarization ability of the case cause by training a large-scale legal text data set, thereby improving the efficiency of case cause extraction; in addition, by continuously iterating and optimizing the model, the accuracy and efficiency can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a case extraction method based on deep learning provided in one embodiment of the present application;
[0039] Figure 2 Another flowchart of a case extraction method based on deep learning provided in one embodiment of the present application;
[0040] Figure 3 A block diagram of the module architecture of a case extraction device based on deep learning provided for one embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).
[0043] In one embodiment, Figure 1As shown, a case extraction method based on deep learning is provided, and the method comprises the following steps:
[0044] S1, collect historical legal text data from multiple fields, and perform data cleaning and preprocessing on the historical legal text data.
[0045] Historical legal text data includes court judgments, case records and regulations.
[0046] Furthermore, the historical legal text data is cleaned and preprocessed, including:
[0047] Remove unnecessary special characters and punctuation marks from historical legal text data;
[0048] Text normalization of historical legal text data;
[0049] Use word segmentation tools to segment historical legal text data.
[0050] S2, data annotation of historical legal text data, indicating the location of the case in the historical legal text data.
[0051] S3, divides the historical legal text data into training set, validation set and test set.
[0052] The division ratios of the training set, validation set, and test set are usually 70%, 15%, and 15%.
[0053] In other words, steps S1-S3 perform corpus construction:
[0054] 1. Data collection: Collect a large amount of legal text data from various fields, including various types of legal documents, regulations, cases, etc. This data should be as rich and diverse as possible to cover legal texts in different fields and topics.
[0055] 2. Data cleaning: Clean the collected data, remove unnecessary special characters and punctuation marks, and perform text normalization (such as case conversion and stop word removal) to prepare for word segmentation and tokenization.
[0056] Unnecessary special characters and punctuation marks may include the following:
[0057] (1) HTML tags: If the text is extracted from a web page or other HTML source, it may contain HTML tags, such as " "、" ", etc. These tags are meaningless for text analysis and should be removed.
[0058] (2) Sentence-end punctuation: The text may contain redundant sentence-end punctuation, such as multiple consecutive periods, question marks, or exclamation marks. These extra punctuation marks can be simplified to one.
[0059] (3) Quotation marks and brackets: Sometimes there may be redundant or mismatched quotation marks and brackets in the text. These unnecessary quotation marks and brackets should be deleted or adjusted.
[0060] (4) Dashes and hyphens: In legal texts, dashes and hyphens may be used inappropriately or redundantly. These extra dashes and hyphens should be corrected or deleted.
[0061] (5) Unicode characters, line breaks, tabs and other unconventional characters: These characters may affect the readability and processing effect of the text and need to be removed during the data cleaning process.
[0062] (6) Special symbols and illegal characters: Some special symbols and illegal characters may not be parsed or processed correctly, such as garbled characters, invisible characters, etc. These characters should be filtered or converted to appropriate characters.
[0063] For the cleaning of legal text data, regular expressions, string replacement or specialized text processing tools can be used to remove or repair these unnecessary special characters and punctuation marks. The clean text after preprocessing can improve the accuracy and effect of subsequent text analysis and processing.
[0064] 3. Data labeling: Label the parts to indicate which parts are the cause of the case and which are not. This labeling process is very time-consuming, but very critical because it provides the model with the data needed for supervised learning.
[0065] 4. Data partitioning: Divide the dataset into training set, validation set and test set. The training set is used to train the model, the validation set is used to adjust hyperparameters and model selection, and the test set is used for final performance evaluation.
[0066] 5. Data preprocessing:
[0067] ① Text segmentation: Use Chinese word segmentation tools (such as Jieba) to separate legal text into words or subwords in preparation for input into the model.
[0068] ② Tokenization: Tokenize each word to indicate whether it belongs to the case or not.
[0069] ③ Data augmentation can be considered to increase the diversity of training data by synthesizing legal text samples or introducing synonym replacement.
[0070] ④ Create data for case verification, including verification data sets for verifying case matching. These data should include legal texts with known cases and corresponding verification cases.
[0071] S4, trains the deep learning neural network model using the training set, and fine-tunes the pre-trained neural network model using the training set.
[0072] Furthermore, the deep learning neural network includes an input layer, a BiLSTM layer and a CRF layer; the input layer is used to represent the legal text data as word embeddings or character embeddings; the BiLSTM layer is used to learn contextual information in the text; and the CRF layer is used to model the dependency relationship of the label sequence.
[0073] Furthermore, step S4 further includes:
[0074] When training a deep learning neural network model, adjust the hyperparameters of the deep learning neural network model;
[0075] Regularly evaluate the performance of the deep learning neural network model using the validation set, perform early stopping when the performance no longer improves, and save the best model parameters.
[0076] In other words, the BiLSTM+CRF model is used to extract the cause of the case:
[0077] 1. Model architecture: Use a bidirectional long short-term memory network (BiLSTM) to learn contextual information in the text, and then use a conditional random field (CRF) to solve the dependency problem of label sequences and improve the accuracy of case extraction.
[0078] 2. Data labeling: Data labeling is performed based on the case labels in the legal text to supervise model training.
[0079] 3. Model training: Use a deep learning model with BiLSTM and CRF layers to learn case cause recognition.
[0080] 4. Hyperparameter selection: Adjust hyperparameters such as learning rate, batch size, and number of training iterations to optimize model performance.
[0081] Furthermore, the pre-trained neural network model is a BERT-Base-Chinese model. Before fine-tuning the pre-trained neural network model using the training set, the legal text data in the training set is encoded into an embedded representation that can be understood by the BERT model.
[0082] Furthermore, step S4 further includes:
[0083] Unfreeze some BERT layers when fine-tuning a pre-trained neural network model;
[0084] When fine-tuning the pre-trained neural network model, adopt the corresponding preset loss function and fine-tuning strategy, and adjust the hyperparameters of the pre-trained neural network model;
[0085] The validation set is used to evaluate the performance of the pre-trained neural network model, and the best model is selected based on the evaluation results to adjust and optimize the pre-trained neural network model.
[0086] In other words, using BERT-Base-Chinese to achieve article summary:
[0087] 1. Pre-trained model: Use the pre-trained BERT-Base-Chinese model, which has been trained on large-scale Chinese text.
[0088] 2. Text encoding: Encode the legal text into an embedded representation understandable by the BERT model to obtain the contextual information of the text.
[0089] 3. Article summary: Use the BERT model to generate summaries of legal texts to extract the main content and key information.
[0090] S5, obtain the target legal text data, input the target legal text data into the trained deep learning neural network model to obtain the corresponding case sequence; and input the target legal text data into the fine-tuned pre-trained neural network model to obtain the corresponding article summary.
[0091] S6, compare the similarity between the case sequence and the potential case in the article summary; based on the similarity, combined with the standard case list, determine whether the case sequence is accurate.
[0092] In step S6, if the similarity exceeds the preset similarity threshold and meets the case cause specifications in the standard case cause collection, the case cause sequence is determined to be accurate.
[0093] S7, if it is determined that the case sequence is correct, output the case sequence.
[0094] Steps S5-S7 perform case matching and verification:
[0095] 1. Text similarity: Use text similarity metrics (such as cosine similarity) to compare the potential causes of action extracted by BiLSTM+CRF and the article summaries generated by BERT-Base-Chines.
[0096] 2. Case cause verification data: Use the case cause encyclopedia published by the Supreme People’s Court or other trusted data sources to verify and confirm whether the extracted case cause is accurate.
[0097] 3. Comprehensive output: Based on the matching degree and verification results, the final case cause is comprehensively output.
[0098] In other words, the case cause extraction method provided in this application includes the following steps:
[0099] Step 1: Data preparation and preprocessing:
[0100] (1) Collect legal text data and clean it, including removing special characters, punctuation marks, and normalizing the text.
[0101] (2) Divide the data into training set, validation set and test set.
[0102] (3) Based on the case extraction task, data annotation is performed to indicate the location of the case.
[0103] (4) For Chinese legal texts, select appropriate text preprocessing tools, such as the Jieba word segmenter, to divide the text into words or subwords.
[0104] That is to say, collect a large amount of legal text from legal text data sources, including court judgments, case records, regulations, etc. Perform data cleaning, remove special characters and punctuation, standardize the text format, and ensure data quality. Divide the data into training set, validation set, and test set, usually in a ratio of 70%, 15%, and 15%. Segment the text and use Chinese word segmentation tools (such as jieba) to convert the text into a processable token sequence.
[0105] Step 2: Training of case extraction model:
[0106] When designing and training the BiLSTM+CRF model, the model architecture, hierarchy, and parameter settings need to be described in more detail.
[0107] (1) Design BiLSTM+CRF model:
[0108] BiLSTM (Bidirectional Long Short-Term Memory Network) is used to capture contextual information in text for better understanding of the context.
[0109] CRF (Conditional Random Field) is used to model the dependencies between labels to ensure that the extracted case label sequence is reasonable.
[0110] (2) Model architecture and hierarchy:
[0111] Input layer: Represent the legal text as word embeddings or subword embeddings.
[0112] BiLSTM layer: Bidirectional LSTM is used to learn the contextual information of the text.
[0113] CRF layer: used to model the dependencies between labels to obtain the final case label sequence.
[0114] (3) Parameter settings:
[0115] Learning rate: Set an initial learning rate, which can be adjusted using a learning rate scheduling strategy.
[0116] Batch size: determines the number of samples in each training batch.
[0117] Number of training iterations: Set an appropriate number of training rounds to ensure that the model fully learns the data.
[0118] (4) Training process:
[0119] Supervised learning using labeled training datasets.
[0120] Regularly evaluate model performance on the validation set to allow for early stopping when needed. Save the best model parameters for later use.
[0121] That is, develop a BiLSTM+CRF model that is used to identify the cause of action in legal texts. Build a model architecture, including an embedding layer, a BiLSTM layer, and a CRF layer, to gradually extract the cause of action. Perform supervised learning on the model using training data, where the data has been annotated with the cause of action so that the model can learn to identify the cause of action. Adjust hyperparameters, including learning rate, batch size, and number of training iterations, to optimize model performance. Perform model evaluation and use a validation set to test the accuracy and generalization ability of the model.
[0122] Step 3: Pre-training and fine-tuning of the BERT model:
[0123] (1) Pre-training stage:
[0124] Select the pre-trained BERT-Base-Chinese model.
[0125] Load the pre-trained model weights and freeze most of BERT’s layers to preserve its knowledge on general tasks.
[0126] (2) Fine-tuning stage:
[0127] Unfreeze some BERT layers to allow the model to adapt to specific legal text tasks.
[0128] Fine-tune using the training set and validation set, and adopt an appropriate loss function (such as cross entropy loss).
[0129] Choose appropriate fine-tuning strategies such as gradient accumulation, differential learning rates, etc.
[0130] Adjust hyperparameters, such as fine-tuning learning rate, fine-tuning number of iterations, etc.
[0131] (3) Verify performance:
[0132] The validation set is used to evaluate the performance of the fine-tuned BERT model on case extraction and article summarization tasks.
[0133] Compare metrics such as accuracy, recall, and F1 score on the validation set to select the best model.
[0134] BERT-Base-Chinese model application: Use the pre-trained BERT-Base-Chinese model to encode legal texts into vector sequences to obtain contextual information. Use BERT to generate summaries and abstracts of legal texts, extracting the main content and key information as alternative causes of action.
[0135] Step 4: Case verification data preparation:
[0136] Prepare data for case verification, including legal text and corresponding verification case.
[0137] Step 5: Case matching and verification:
[0138] (1) Case Extraction:
[0139] Use the trained BiLSTM+CRF model to extract case sequences from legal texts.
[0140] The extracted case sequences were used for further comparison and verification.
[0141] (2) Article summary generation:
[0142] Generate article summaries of legal texts using a fine-tuned BERT model.
[0143] Make sure the resulting article summary contains key information to facilitate subsequent comparisons.
[0144] (3) Compare the case and the article summary:
[0145] Use a text similarity metric or model to compare the potential causes of action extracted by BiLSTM and the potential causes of action in the article summary generated by BERT.
[0146] Commonly used similarity measures include cosine similarity, Jaccard similarity, etc.
[0147] (4) Verification and Validation:
[0148] Use the validation dataset to verify and confirm whether the extracted case causes are accurate.
[0149] The cases in the data set can be manually reviewed and verified for comparison with the model extraction results.
[0150] (5) Performance evaluation:
[0151] Performance indicators such as accuracy, recall, and F1 score of the statistical model on the validation dataset.
[0152] Perform in-depth analysis of the model's performance to understand how it performs on different categories.
[0153] That is, match the case extracted by BiLSTM+CRF and the summary generated by BERT and compare their similarity. Use text similarity metrics, such as cosine similarity, to evaluate the similarity between the case and the summary. Use a validation dataset, which includes legal texts with known cases, to verify and confirm whether the extracted case is accurate.
[0154] Step 6: Result output:
[0155] Based on the matching degree and verification results, the final case cause is comprehensively output.
[0156] If multiple models and validation methods produce different results, merging, weighting, or manual intervention can be used to determine the final case.
[0157] In order to better illustrate the technical solution of this application, a demonstration is provided below:
[0158] A legal contract is processed. After the contract is recognized by OCR, the text output by OCR is preprocessed, including removing irrelevant characters, processing line breaks, and normalizing the text format.
[0159] The document is fed into the BiLSTM+CRF model to obtain the case file, and then the document is fed into the BERT-Base-Chinese model to encode the entire legal text to obtain contextual information. A summary and abstract of the legal text is generated to extract the main content and key information.
[0160] Match the case cause extracted by BiLSTM+CRF and the summary generated by BERT. Use text similarity metrics (such as cosine similarity) to compare the similarity between the case cause and the summary. Use the case cause encyclopedia published by the Supreme People's Court or other trusted data sources to verify and confirm the case cause.
[0161] Result output: Based on the matching degree and verification results, the final case cause is comprehensively output. If multiple models and verification methods produce different results, a merging or weighting strategy can be used to determine the final case cause.
[0162] Another flow chart of the method provided in the embodiment of the present application can be found in Figure 2 .
[0163] The method provided in the embodiment of the present application uses the BiLSTM+CRF and BERT-Base-Chinese models to extract the case causes in the legal text and perform double verification. First, BiLSTM+CRF is used to extract the case causes, and then BERT-Base-Chinese is used for article summary. Finally, through comparison and verification, the final case causes are obtained. This method aims to improve the accuracy and efficiency of legal text processing.
[0164] It should be understood that although Figure 1-2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-2 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0165] In one embodiment, Figure 3 As shown, a case extraction device based on deep learning is provided, comprising the following modules:
[0166] The data collection module 301 is used to collect historical legal text data from multiple fields and perform data cleaning and preprocessing on the historical legal text data;
[0167] A data annotation module 302 is used to annotate the historical legal text data to indicate the location of the case in the historical legal text data;
[0168] A data set division module 303 is used to divide the historical legal text data into a training set, a validation set and a test set;
[0169] A model training module 304 is used to train a deep learning neural network model using a training set, and to fine-tune a pre-trained neural network model using the training set;
[0170] The target legal text data acquisition module 305 is used to acquire the target legal text data, input the target legal text data into the trained deep learning neural network model to obtain the corresponding case sequence; and input the target legal text data into the fine-tuned pre-trained neural network model to obtain the corresponding article summary;
[0171] A comparison and judgment module 306 is used to compare the similarity between the case sequence and the potential case in the article summary; based on the similarity and in combination with the standard case list, determine whether the case sequence is accurate;
[0172] The case sequence output module 307 is used to output the case sequence if it is determined that the case sequence is correct.
[0173] The specific implementation content of each module can be found in the above definition of a case cause extraction method based on deep learning, which will not be repeated here.
[0174] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A case extraction method based on deep learning, characterized in that: include: S1, collecting historical legal text data from multiple fields, and performing data cleaning and preprocessing on the historical legal text data; S2, marking the historical legal text data to indicate the location of the case in the historical legal text data; S3, dividing the historical legal text data into a training set, a validation set and a test set; S4, training a deep learning neural network model using the training set, and fine-tuning a pre-trained neural network model using the training set; S5, obtaining target legal text data, inputting the target legal text data into the trained deep learning neural network model to obtain a corresponding case sequence; and inputting the target legal text data into the fine-tuned pre-trained neural network model to obtain a corresponding article summary; S6, comparing the similarity between the case sequence and the potential case in the article summary; Based on the similarity, combined with the standard case list, determine whether the case sequence is accurate; S7, if it is determined that the case sequence is correct, output the case sequence; The deep learning neural network model includes an input layer, a BiLSTM layer and a CRF layer; the input layer is used to represent the legal text data as word embedding or character embedding; the BiLSTM layer is used to learn context information in the text; the CRF layer is used to model the dependency relationship of the label sequence; The pre-trained neural network model is a BERT-Base-Chinese model; before fine-tuning the pre-trained neural network model using the training set, the legal text data in the training set is encoded into an embedded representation that can be understood by the BERT model.
2. The case extraction method based on deep learning according to claim 1 is characterized in that: The data cleaning and preprocessing of the historical legal text data includes: Removing unnecessary special characters and punctuation marks from the historical legal text data; Performing text normalization on the historical legal text data; The historical legal text data is segmented using a word segmentation tool.
3. The case extraction method based on deep learning according to claim 1 is characterized in that: Step S4 also includes: Unfreeze some BERT layers when fine-tuning the pre-trained neural network model; When fine-tuning the pre-trained neural network model, adopting a corresponding preset loss function and fine-tuning strategy, and adjusting the hyperparameters of the pre-trained neural network model; The validation set is used to evaluate the performance of the pre-trained neural network model, and the best model is selected according to the evaluation result to adjust and optimize the pre-trained neural network model.
4. The case extraction method based on deep learning according to claim 1 is characterized in that: Step S4 also includes: When training the deep learning neural network model, adjusting the hyperparameters of the deep learning neural network model; The validation set is used to periodically evaluate the performance of the deep learning neural network model, and early stopping is performed when the performance no longer improves, and the optimal model parameters are saved.
5. The case extraction method based on deep learning according to claim 1 is characterized in that: The historical legal text data includes court judgments, case records and regulations; the training set, validation set and test set are divided into a ratio of 70%, 15% and 15%.
6. The case extraction method based on deep learning according to claim 1 is characterized in that: In step S6, if the similarity exceeds a preset similarity threshold and meets the case cause specification in the standard case cause collection, it is determined that the case cause sequence is accurate.
7. A case extraction device based on deep learning, characterized in that: include: A data collection module, used to collect historical legal text data from multiple fields, and perform data cleaning and preprocessing on the historical legal text data; A data annotation module, used to annotate the historical legal text data to indicate the location of the case in the historical legal text data; A data set division module, used for dividing the historical legal text data into a training set, a validation set and a test set; A model training module, used to train a deep learning neural network model using the training set, and to fine-tune a pre-trained neural network model using the training set; A target legal text data acquisition module is used to acquire target legal text data, input the target legal text data into the trained deep learning neural network model to obtain a corresponding case sequence; and input the target legal text data into the fine-tuned pre-trained neural network model to obtain a corresponding article summary; A comparison and judgment module, used to compare the similarity between the case sequence and the potential case in the article summary; Based on the similarity, combined with the standard case list, determine whether the case sequence is accurate; A case sequence output module, used for outputting the case sequence if it is determined that the case sequence is correct; The deep learning neural network model includes an input layer, a BiLSTM layer and a CRF layer; the input layer is used to represent the legal text data as word embedding or character embedding; the BiLSTM layer is used to learn context information in the text; the CRF layer is used to model the dependency relationship of the label sequence; The pre-trained neural network model is a BERT-Base-Chinese model; before fine-tuning the pre-trained neural network model using the training set, the legal text data in the training set is encoded into an embedded representation that can be understood by the BERT model.
Citation Information
Patent Citations
Legal element extraction method, device and electronic equipment
CN112784578A
One-person multi-case association identification method and system based on deep metric learning
CN112925877A
Intelligent administrative law enforcement case information extraction and cause affirmation method
CN114547230A
Class case discrimination method and system based on similarity measurement
CN117172235A
