Method, system, medium and equipment for extracting entity and relation of judicial text
By combining the pseudo-labeled data generated by the big model with real-labeled data, expanding the data set of the full supervision model, and building entity and event extraction modules, the problems of data imbalance and confusing in judicial texts are solved, and more accurate identification of low-frequency and confusing entities and case analysis are improved.
Patent Information
- Application Number
- CN202411781069.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-18
AI Technical Summary
There are problems in judicial texts with data imbalance and confusing crimes, which leads to poor effectiveness in identifying low-frequency crimes and distinguishing confusing crimes.
The method of integrating large models and fully supervised models is adopted to generate pseudo-notation data through large models to expand the data set of the fully supervised models, build entity extraction modules and event extraction modules, and use BiLSTM, CRF and BERT models to extract entities and relationships.
By integrating large models and fully supervised models, the model's ability to identify low-frequency entity categories and confusing entities is improved, and the accuracy and efficiency of case analysis are improved.
Smart Images

Figure CN119848189A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of entity extraction, and in particular to a method, system, medium and device for extracting entities and relations from judicial texts. Background Art
[0002] In earlier studies, scholars usually used artificial intelligence models such as machine learning models and With the rapid development of information technology, the processing and analysis of legal texts has become a research hotspot. Traditional machine learning models mainly rely on manual feature extraction and shallow classification. Although they have achieved certain results on small-scale data sets, their scalability and classification capabilities are limited due to the lack of capturing deep features of texts. In recent years, deep learning methods such as BERT, BiLSTM, and CRF have shown significant advantages in the task of entity extraction from legal texts. The application of fully supervised learning methods in legal text processing relies on a large amount of high-quality annotated data. By carefully annotating the key information in legal documents, a large-scale training data set can be constructed, thereby improving the accuracy and generalization ability of the model. In addition, research on legal text processing based on large-scale pre-trained language models (such as GPT, Llama, ChatGLM, Baichuan7B, etc.) has also begun to emerge. These models have improved their understanding of legal professional terms and complex language structures through fine-tuning techniques. At the same time, zero-shot and few-shot learning techniques are widely used in legal text processing, especially in the absence of a large amount of annotated data. Foreign research, such as Stanford University's "Judicial Language Model Adaptability Project", has successfully improved the accuracy of entity recognition in legal texts by combining pre-trained models with few-shot learning. This method can effectively address the problem of data scarcity in legal texts. It should be noted that legal texts are usually formal, terminologically specialized, and complex in expression, making it more difficult to obtain high-quality annotations, which makes the application of fully supervised learning in the legal field challenging.
[0003] As a specific scenario of text classification, most neural network crime classification models perform well, especially on standardized crime datasets. However, in practical applications, crime classification prediction has serious data imbalance problems and easy confusion of crimes. In real cases, the distribution of crimes is extremely uneven, and only a few crimes have a high number of samples; the entire dataset is severely polarized. Traditional neural network models have poor recognition effects on such crime pairs. Only high-frequency crimes are easy to predict, while a large number of low-frequency crimes are difficult to identify as appropriate categories. In addition, there are a large number of easily confused crime pairs, such as "embezzlement of funds" and "embezzlement of specific funds and objects", whose text descriptions of criminal facts are very similar and difficult to distinguish. In order to alleviate these problems, Z.Hu et al. introduced 10 legal attributes of crimes as intermediate mappings to achieve fine-grained recognition of crimes. However, there are still some easily confused crimes with exactly the same attributes in their model, such as theft and fraud, embezzlement of funds and embezzlement of specific property. Although this external knowledge is helpful to improve the prediction accuracy, it inevitably brings a lot of noise. In this case, it is still difficult to accurately distinguish the crimes. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of unbalanced judicial text data and easy confusion of crimes, and to propose a method for extracting entities and relations from judicial texts, comprising the following steps:
[0005] S1. Obtain judicial texts and annotate entities in the judicial texts to obtain true value labels;
[0006] S2, build entity extraction module, event extraction module, and fine-tune large model extraction module;
[0007] The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on the judicial text, the generation task generates entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels.
[0008] The entity extraction module extracts entities based on judicial texts and supplementary data, using true value labels and pseudo labels as supervision;
[0009] The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events;
[0010] S3. The entities extracted by the entity extraction module and the relationships extracted by the event extraction module are used as the final extracted entities and relationships, and case analysis is performed based on the entities and relationships.
[0011] Furthermore, the entity extraction module includes: an input layer, an embedding layer, a BiLSTM layer, a BiLSTM output layer, a CRF layer, and an output layer;
[0012] The input layer converts judicial texts and supplementary data into numerical representations;
[0013] The embedding layer converts the numerical representation into a sequence of continuous numerical data;
[0014] The continuous numerical sequence data passes through the BiLSTM layer to obtain the representation of context information;
[0015] The representation of context information is obtained through the BiLSTM output layer to obtain context-related feature representation;
[0016] Context-dependent feature representation is used for sequence labeling through the CRF layer;
[0017] The output layer processes the results of the CRF layer and outputs the label corresponding to each input.
[0018] Furthermore, the event extraction module includes: input layer, BERT model layer, event representation layer, event extraction layer, and Dense-Sofmax layer;
[0019] The input layer marks the words in the input into corresponding tokens;
[0020] The BERT model layer obtains the embedding representation of each token;
[0021] The event representation layer determines whether a token is an element of an event based on the embedding representation of each token and generates a classification label for each token.
[0022] The event extraction layer extracts event elements based on token classification annotations;
[0023] The Dense-Sofmax layer performs multi-classification processing on the extracted event elements to obtain classified event elements and realize relationship extraction.
[0024] Furthermore, the event representation layer uses BIO annotation to generate classification annotations for each token.
[0025] Furthermore, the fine-tuning large model extraction module is implemented based on the Baichuan 7B model.
[0026] Furthermore, the hidden state output of each cell unit of BiLSTM is expressed as:
[0027]
[0028] in, represents the current hidden state vector, represents the current input vector, Represents the hidden state vector at the previous moment, i t represents the input gate, f t represents the forget gate, o t represents the output gate, σ(·) is the sigmoid activation function, tanh(·) is the hyperbolic tangent function, W i , W f , W o , W c represents the weight matrix, b i , b o , b c represents the deviation vector, Represents the abstract information representation of the current cell state, C t represents the current cell state vector, C t-1 Represents the cell state vector at the previous moment.
[0029] The present invention also proposes a judicial text entity and relationship extraction system, comprising:
[0030] The data acquisition module is used to acquire judicial texts and annotate entities in the judicial texts to obtain true value labels;
[0031] Model building module, used to build entity extraction module, event extraction module, and fine-tune large model extraction module;
[0032] The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on the judicial text, the generation task generates entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels.
[0033] The entity extraction module extracts entities based on judicial texts and supplementary data, using true value labels and pseudo labels as supervision;
[0034] The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events;
[0035] The result acquisition module is used to use the entities extracted by the entity extraction module and the relationships extracted by the event extraction module as the final extracted entities and relationships, and conduct case analysis through the entities and relationships.
[0036] The present invention also proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned entity and relationship extraction method of judicial text.
[0037] The present invention also proposes an electronic device, comprising a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises computer-readable instructions, and the processor is configured to call the computer-readable instructions to execute the above-mentioned entity and relationship extraction method of judicial text.
[0038] The beneficial effects brought by the technical solution provided by the present invention are:
[0039] The present invention proposes a method based on the fusion of a large model and a fully supervised model, and generates pseudo-annotated data through a large model to expand the data set of the fully supervised model and enrich the data set of entity extraction. The fully supervised model includes an entity extraction module and an event extraction module. The entity extraction module is constructed based on BiLSTM and CRF. The entity extraction module extracts entities based on judicial data and pseudo-annotated data. The event extraction module is constructed based on BERT. The event extraction module extracts events based on the entities extracted by the entity extraction module and obtains relationships. By combining the pseudo-annotated data generated by the large model with the real annotated data, the present invention can provide more samples for low-frequency entity categories and enhance the model's recognition ability for these categories. In addition, this fusion method can effectively enhance the model's ability to distinguish easily confused entities. Extracting entities and relationships is conducive to rapid analysis of the case. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of a method for extracting entities and relations from judicial texts according to an embodiment of the present invention;
[0041] Figure 2 It is a block diagram of an electronic device in an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0042] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0043] In the processing of legal texts, entity extraction and event extraction have gradually become important research directions. In the analysis of judicial texts, accurately identifying and extracting key entities (such as people involved in the case, illegal units, time, place, punishment units, etc.) is a basic step in understanding the case. The entity extraction task aims to identify these key information from unstructured case texts, helping judges and lawyers quickly obtain information such as key people, time and place in the case, so as to better understand the specific circumstances of the case. However, manually analyzing a large number of case texts is not only time-consuming and labor-intensive, but also easily affected by subjective factors.
[0044] Example 1: A flowchart of the entity and relationship extraction method of the judicial text of the embodiment of the present invention is as follows Figure 1 , specifically including the following steps:
[0045] S1. Obtain the judicial text and annotate the entities in the judicial text to obtain the true value label.
[0046] By manually refining the data annotation guidelines with experts and using a large model to generate a portion of the annotation data using a few-shot strategy, we can perform high-quality data annotation on judicial texts to ensure that each entity and trigger word can be correctly identified and annotated. Entity types in judicial texts include: names, dates and times, names of organizations, locations and their latitude and longitude, personal identification information (such as mobile phone numbers, ID numbers, WeChat IDs, QQ numbers, bank card numbers), etc.
[0047] S2. Build entity extraction module, event extraction module, and fine-tune large model extraction module.
[0048] 1. Fine-tune the large model extraction module
[0049] The fine-tuning large model extraction module is implemented based on the Baichuan 7B model. The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on judicial texts, the generation task obtains entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels.
[0050] 2. Entity extraction module
[0051] The entity extraction module extracts entities based on judicial texts and supplementary data with true value labels and pseudo labels as supervision. The entity extraction module includes: input layer, embedding layer, BiLSTM layer, BiLSTM output layer, CRF layer, and output layer.
[0052] The input layer of the entity extraction module receives judicial text and supplementary data. The input layer has multiple input units, each of which corresponds to a word, phrase or character in the input, and converts them into numerical representations, such as word vectors or character embeddings. The role of this layer is to provide the model with raw serialized data, which provides raw information for subsequent layers.
[0053] The word vector representation model Word2Vec can be used to convert the word of the input unit into a word vector. Its main idea is to capture contextual semantic information based on a sliding window. It contains two basic models: the Skip-gram model and the CBOW model. The Skip-gram model infers the context in the sliding window from the current word, while the CBOW model infers the current word based on the context in the sliding window before and after the word.
[0054] The embedding layer converts the numerical representation into continuous numerical sequence data. Through the embedding layer, each word and character in the text is mapped to a vector space of fixed dimension, which enables the model to understand the similarity or association between words and convert the input discrete information into a high-dimensional vector representation. The embedding layer maps the input sequence data into continuous numerical data that is more suitable for model processing.
[0055] Word2Vec can encode discrete word sequences in a text into a set of word vectors. The text description of the crime is represented by x = {x1, x2, ..., x n}, where x represents a sentence describing a fact, x n represents the nth word, where n is the number of words in the sentence. Through word embedding, each word x i ∈x are converted into d-dimensional vectors Accordingly, the entire case text can be represented by a series of vectors, namely:
[0056] The continuous numerical sequence data is passed through the BiLSTM (bidirectional long short-term memory network) layer to obtain the representation of context information. BiLSTM extracts features from both left to right (forward LSTM) and right to left (reverse LSTM) of the input sequence. By combining the information of the context, the model can have a more comprehensive understanding of the context of each word. By processing the input sequence in both the forward and reverse directions, the context features of the words in the sequence are obtained, which improves the model's ability to capture the text context.
[0057] The hidden state output of each cell unit of BiLSTM is expressed as:
[0058]
[0059] in, represents the current hidden state vector, represents the current input vector, Represents the hidden state vector at the previous moment, i t represents the input gate, f t represents the forget gate, o t represents the output gate, σ(·) is the sigmoid activation function, tanh(·) is the hyperbolic tangent function, W t , W f , W o , W c represents the weight matrix, b i , b o , b c represents the deviation vector, Represents the abstract information representation of the current cell state, C t represents the current cell state vector, C t-1Represents the cell state vector at the previous moment.
[0060] The representation of context information obtains context-related feature representation through the BiLSTM output layer. The BiLSTM output layer obtains the feature representation of each word after passing through BiLSTM. These features contain information from the word itself and its front and back neighbors.
[0061] The context-dependent feature representation is sequence labeled through the CRF (Conditional Random Field) layer. CRF is a sequence labeling model that is mainly used to solve the problem of sequence dependency. CRF will maximize the probability of sequence labeling to ensure that the model considers the relationship between the previous and next labels when predicting the sequence. For example, in the named entity recognition task, if a word is labeled as B-PER (beginning of a name), the following words should tend to be labeled as I-PER (inside a name). By means of sequence labeling, the model is ensured to consider the relationship between each word and its previous and next words when making decisions, thereby improving the overall accuracy of sequence labeling.
[0062] The output layer processes the results of the CRF layer and outputs the labels corresponding to each input, such as B-PER (beginning of a person's name), I-PER (inside a person's name), B-LAW (beginning of a legal provision), I-LAW (inside a legal provision), etc. The final entity recognition results are generated, and the entity boundaries and types in the text are marked.
[0063] 3. Event extraction module
[0064] The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events. The event extraction module includes: input layer, BERT model layer, event representation layer, event extraction layer, and Dense-Sofmax layer.
[0065] The input layer of the event extraction module marks the words in the input into corresponding tokens.
[0066] The BERT model layer obtains the embedded representation of each token. The BERT model is used to extract semantic information from the input text. BERT generates the corresponding vector representation by understanding the context of each input token.
[0067] The event representation layer determines whether a token is an element of an event based on the embedded representation of each token and generates a classification label for each token. The network structure of this layer further analyzes each token in the text and generates a classification label for each token using the BIO label to determine whether the token is an element of an event (such as B for the beginning, I for the middle, or O for not being an element). This layer generates a classification label (B, I, O) for each token to help identify the specific location of the event element in the text.
[0068] The event extraction layer extracts event elements such as event subject, event behavior, etc. according to the classification annotation of tokens. According to the classification results of tokens, the corresponding text fragments are extracted as event-related elements.
[0069] The Dense-Sofmax layer passes the extracted event elements through a fully connected network (Dense layer), and then performs multi-classification processing through Softmax to obtain the classified event elements. This part can be regarded as further optimization and classification of the extracted elements to ensure the accuracy of the classification results.
[0070] If further classification is required, a Dense-Sofmax layer is used to further classify the classified event elements into specific event roles to achieve relationship extraction. This classification helps to clarify the specific participants or objects in the event.
[0071] S3. The entities extracted by the entity extraction module and the relationships extracted by the event extraction module are used as the final extracted entities and relationships, and case analysis is performed based on the entities and relationships.
[0072] Embodiment 2: The present invention also proposes a judicial text entity element extraction system, comprising:
[0073] The data acquisition module is used to acquire judicial texts and annotate entities in the judicial texts to obtain true value labels;
[0074] Model building module, used to build entity extraction module, event extraction module, and fine-tune large model extraction module;
[0075] The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on the judicial text, the generation task generates entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels.
[0076] The entity extraction module extracts entities based on judicial texts and supplementary data, using true value labels and pseudo labels as supervision;
[0077] The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events;
[0078] The result acquisition module is used to use the entities extracted by the entity extraction module and the relationships extracted by the event extraction module as the final extracted entities and relationships, and conduct case analysis through the entities and relationships.
[0079] Embodiment 3: In an exemplary embodiment, a computer-readable storage medium is included, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned entity and relationship extraction method of judicial text is implemented.
[0080] Example 4: Please refer to Figure 2 In an exemplary embodiment, an electronic device is also included, including at least one processor, at least one memory, and at least one communication bus.
[0081] Among them, a computer program is stored in the memory, and the computer program includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory through a communication bus to execute the above-mentioned entity and relationship extraction method of judicial text.
[0082] The precision and F1 value are used as evaluation indicators of the model of the present invention to verify the effectiveness of the model.
[0083] The calculation process of the model accuracy is as follows:
[0084]
[0085] The calculation process of the model recall is as follows:
[0086]
[0087] The experimental results of the three models of the present invention: entity extraction, event extraction, and large model fine-tuning extraction are shown in Tables 1, 2, and 3 respectively.
[0088] Table 1
[0089] Entity Type Precision Recall Name 0,97 0,98 Date and time 0.99 0.97 Organization 0.88 0.83 Place 0.91 0.93 Phone number 0.88 0.98 ID number 0.96 1.00 Mail 0.88 0.92 Bank card number 0.93 0.89
[0090] Table 2
[0091]
[0092]
[0093] Table 3
[0094] Feature Type Precision Recall Illegal subject 0.96 0.94 Cause of incident 0.82 0.87 Occurrence process 0.75 0.80 Involved tools 0.74 0.82 Types of Crime 0.92 0.95 Time of the incident 0.96 0.98 Occurrence address 0.95 0.96 Pollutants and resources 0.91 0.93
[0095] In order to verify the effect of the method of the present invention, neural network models such as CNN (convolutional neural network), RNN+Attention (recurrent neural network + attention mechanism), Few-Shot+Attributes (few-shot learning + attribute learning) are used as baseline models for comparative experiments. In the CNN model, the filter width is set to 2, 3, and 4, respectively, and each filter contains 128 feature maps. In the RNN+Attention model, the size of the hidden layer is set to 128, and the size of the attention layer is set to 100. For all experiments, the Adam algorithm is selected as the network optimizer during training, and the dropout rate, learning rate, and batch size are set to 0.5, 0.001, and 64, respectively.
[0096] We designed several sets of comparative experiments to verify the performance of the model in terms of the accuracy of prejudgment of crime extraction, the accuracy of prediction of imbalanced crimes, and the accuracy of prediction of easily confused crimes. We also conducted case analysis to verify the effectiveness of the model in many aspects. If multiple indicators of the evaluation model are higher than existing work, and the prediction results of individual cases are reasonable, this shows that the introduction of crime definitions can greatly enrich the features of crime texts and have a favorable effect on single-label prediction. Indicators such as Precision and Recall are used to evaluate the entity extraction performance of the model. By comparing the performance of different models, the optimal model is selected for practical applications.
[0097] The experimental results of different models on small-scale event datasets, medium-scale event datasets, and large-scale event datasets are shown in Tables 5, 6, and 7, respectively. Accuracy (Acc), macro precision (MP), macro recall (MR), and F1 value are used as evaluation indicators to verify the effectiveness of the model. The sizes of small, medium, and large-scale datasets are shown in Table 4.
[0098] Table 4
[0099] Dataset Small scale Medium size Large scale Training set 10769 21538 53845 Validation set 5385 10769 26923 Test Set 5384 10769 26922
[0100] The calculation process of the model accuracy is as follows:
[0101]
[0102] Among them, TP and TN represent the number of correct predictions of positive and negative examples in the sample, that is, the true positive rate and true negative rate; FP and FN represent the number of incorrect predictions of positive and negative examples in the sample, that is, the false positive rate and false negative rate. The sum of the four is the total number of samples.
[0103] The calculation process of the model F1 value is as follows:
[0104]
[0105] Table 5
[0106]
[0107] Table 6
[0108]
[0109] Table 7
[0110]
[0111] In the entity extraction process, the present invention adopts the technology of fusing a large model with a fully supervised model to cope with the challenges of data imbalance and easy category confusion. Specifically, the present invention uses a large model to generate pseudo-annotated data to assist the fully supervised model, thereby enriching the data set for entity extraction. By combining the pseudo-annotated data generated by the large model with the real annotated data, more samples can be provided for low-frequency entity categories (such as rare crimes or entities related to special events), thereby improving the model's recognition ability for these categories. In addition, this fusion method can effectively improve the model's ability to distinguish easily confused entities. For example, in the identification of illegal units and penalty units, the model can more accurately distinguish similar roles.
[0112] In specific applications, the large model was fine-tuned to perform well in entity extraction in the field of environmental justice. The fine-tuned large model can achieve high-precision entity recognition and classification for typical entity types, such as occurrence process, cause of event, pollutants and resources, and tools involved. This capability makes the extraction method of the present invention particularly suitable for text analysis of environmental justice cases. It can not only identify common illegal persons and units, but also accurately identify key entities closely related to environmental events.
[0113] After completing the entity extraction, enter the event extraction task. Event extraction is based on the identified entities, and further analyzes and extracts the relationships between entities. Identify the relationships between the people involved in the case, the time and place of the case, and the specific illegal acts and penalties. The goal of event extraction is to build a complete case map so that each entity in the case and its associated relationships can be clearly presented. To this end, the present invention realizes the extraction of entity relationships in the case by customizing extraction rules (such as filtering out illegal acts and penalties from verbs in the text).
[0114] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for extracting entities and relations from judicial texts, characterized in that: The following steps are involved: S1. Obtain judicial texts and annotate entities in the judicial texts to obtain true value labels; S2, build entity extraction module, event extraction module, and fine-tune large model extraction module; The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on the judicial text, the generation task generates entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels. The entity extraction module extracts entities based on judicial texts and supplementary data, using true value labels and pseudo labels as supervision; The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events; S3. The entities extracted by the entity extraction module and the relationships extracted by the event extraction module are used as the final extracted entities and relationships, and case analysis is performed based on the entities and relationships.
2. The entity and relationship extraction method of judicial text according to claim 1 is characterized in that: The entity extraction module includes: input layer, embedding layer, BiLSTM layer, BiLSTM output layer, CRF layer, and output layer; The input layer converts judicial texts and supplementary data into numerical representations; The embedding layer converts the numerical representation into a sequence of continuous numerical data; The continuous numerical sequence data passes through the BiLSTM layer to obtain the representation of context information; The representation of context information is obtained through the BiLSTM output layer to obtain context-related feature representation; Context-dependent feature representation is used for sequence labeling through the CRF layer; The output layer processes the results of the CRF layer and outputs the label corresponding to each input.
3. The entity and relationship extraction method of judicial text according to claim 1 is characterized in that: The event extraction module includes: input layer, BERT model layer, event representation layer, event extraction layer, and Dense-Sofmax layer; The input layer marks the words in the input into corresponding tokens; The BERT model layer obtains the embedding representation of each token; The event representation layer determines whether a token is an element of an event based on the embedding representation of each token and generates a classification label for each token. The event extraction layer extracts event elements based on token classification annotations; The Dense-Sofmax layer performs multi-classification processing on the extracted event elements to obtain classified event elements and realize relationship extraction.
4. The entity and relationship extraction method of judicial text according to claim 3 is characterized in that: The event representation layer uses BIO annotation to generate classification annotations for each token.
5. The entity and relationship extraction method of judicial text according to claim 1 is characterized in that: The fine-tuning large model extraction module is implemented based on the Baichuan 7B model.
6. The entity and relationship extraction method of judicial text according to claim 2 is characterized in that: The hidden state output of each cell unit of BiLSTM is expressed as: in, represents the current hidden state vector, represents the current input vector, Represents the hidden state vector at the previous moment, i t represents the input gate, f t represents the forget gate, o t represents the output gate, σ(·) is the sigmoid activation function, tanh(·) is the hyperbolic tangent function, W i , W f , W o , W c represents the weight matrix, b i , b o , b c represents the deviation vector, Represents the abstract information representation of the current cell state, C t represents the current cell state vector, C t-1 Represents the cell state vector at the previous moment.
7. A judicial text entity and relationship extraction system, characterized in that: include: The data acquisition module is used to acquire judicial texts and annotate entities in the judicial texts to obtain true value labels; Model building module, used to build entity extraction module, event extraction module, and fine-tune large model extraction module; The fine-tuning large model extraction module is divided into generation tasks and classification tasks. Based on the judicial text, the generation task generates entities, and the classification task obtains entity labels. The entities and labels generated by the fine-tuning large model extraction module are used as supplementary data and pseudo labels. The entity extraction module extracts entities based on judicial texts and supplementary data, using true value labels and pseudo labels as supervision; The event extraction module extracts events based on the entities, judicial texts, and supplementary data extracted by the entity extraction module, using true value labels and pseudo labels as supervision, and extracts the relationships in the events; The result acquisition module is used to take the entities extracted by the entity extraction module and the relations extracted by the event extraction module as the final extracted entities and relations, and conduct case analysis through the entities and relations.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises computer-readable instructions, and the processor is configured to call the computer-readable instructions to execute the method according to any one of claims 1 to 6.