Few-sample judicial trial file entity extraction method and system and storage medium

The training samples are expanded through data augmentation technology and the extraction of entities and entity types is combined with language models and deep learning technology, which solves the problem of insufficient training samples in judicial trial documents and improves the extraction accuracy.

CN119647476AActive Publication Date: 2025-03-18ANHUI UNIV +2
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411779498.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-18
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

The problem of insufficient training samples in judicial trial documents and low accuracy in entity and entity type extraction.

Method used

Data augmentation technology is used to expand the training samples, and enhancement data is generated by retaining entity category labels, changing entity category labels, adding new entity categories, etc., and the enhanced data is mixed with the original data for model training. At the same time, the language model is used to generate embed vectors of context-dependent, part-of-speech and pattern features, and the entity and entity types are extracted through Bi-LSTM and CRF models.

Benefits of technology

It effectively solves the problem of insufficient training samples, improves the accuracy of identification of entities and entity types in judicial trial documents, and realizes accurate identification of entity information in semi-structured text data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647476A_ABST
    Figure CN119647476A_ABST
Patent Text Reader

Abstract

The invention relates to a few-sample judicial trial file entity extraction method and system and a storage medium. The few-sample judicial court hearing file entity extraction method comprises the steps of inputting a judicial court hearing file into a language processing model by taking a sentence as a unit to generate three embedded vectors: integrating the three embedded vectors of a context-related embedded feature vector # imgabs0 # word part-of-speech embedded feature vector # imgabs1 # and a mode feature embedded feature vector # imgabs2 # into a feature fusion vector ti, wherein the three embedded vectors are a context-related embedded feature vector # imgabs0 # word part-of-speech embedded feature vector # imgabs1 # and a mode feature embedded feature vector # imgabs2 #; and inputting the feature fusion vector ti into a BiLSTM model to obtain a feature fusion vector ti'containing bidirectional sequence information, and inputting the feature fusion vector ti 'into a feedforward neural network to carry out BIEOU label prediction. According to the method, the training data set is expanded by adopting a data enhancement technology, and the enhanced data is mixed with the original data, so that the problem of insufficient training samples in the civilian complaint of the judicial court trial file is solved. And meanwhile, according to the prediction sequence and the entity type sequence, various entities in the judicial file can be accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method, system and storage medium for extracting entities from judicial trial documents with a small number of samples. Background Art

[0002] During the trial of civil, criminal and administrative cases, judges consult various materials, such as prosecution documents, evidence materials, and prosecutorial documents, to understand case information. Most of these materials are structured data and semi-structured data. Judicial personnel need to spend a lot of manpower in the process of extracting the case elements of legal cases, which is not only inefficient, but also easily affected by personal subjective judgment.

[0003] With the continuous advancement of technologies such as natural language processing and big data analysis, relevant technicians have developed some tools that can realize the extraction of case elements, which provides convenience for judicial personnel. For example, China Invention Patent Application Publication No. CN118364047A provides an entity relationship extraction model training, entity relationship extraction method, device and equipment. The method collects text data and marks whether each text unit belongs to an entity and the relationship between entities; uses the labeled text samples to train the entity relationship extraction model so that it learns to identify entities and their relationships; uses the feature mapping network to convert the text unit into a feature vector; analyzes the feature vector sequence through the global pointer network, predicts the entity relationship, and generates an entity relationship prediction matrix. Although this scheme can realize the recognition of entity information and the logical relationship between entities from text data, it does not take into account the fact that the training samples are not sufficient and the characteristics of each module of the file are diverse, which makes the recognition accuracy of entities and entity types low. Summary of the invention

[0004] Based on this, it is necessary to provide a retrieval system and method for extracting entities and entity types in civil complaints of judicial trial documents with a small number of samples to address the problems of insufficient training samples and low accuracy of entity and entity type extraction in civil complaints of judicial trial documents.

[0005] A method for extracting entities from a few-sample judicial trial document, in which all models are trained in the absence of training samples, and entities and entity types in the judicial trial document are extracted through the trained models; wherein the method for training the model comprises the following steps:

[0006] Performing data enhancement on training samples to generate enhanced data; the data enhancement method includes: retaining the category label of the entity, masking the entity and context, and generating enhanced data; changing the category label of the entity to mask the predicted entity and context, and generating enhanced data; adding an entity category, performing mask prediction on the entity and context, and generating enhanced data;

[0007] Screening the generated enhanced data: deleting the enhanced data whose entity category does not match the specific entity, and retaining the enhanced data whose entity category matches the specific entity;

[0008] Mixing the screened enhanced data with the training samples and inputting them together as training samples of the model;

[0009] Extracting entities and entity types from judicial trial documents includes the following steps:

[0010] The judicial trial document consists of L sentences, each of which consists of M words. The sentences are input into the language processing model to generate three embedding vectors: context-dependent embedding feature vector The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors The three embedding vectors are combined into a feature fusion vector t i ;

[0011] The feature fusion vector t i Input into the BiLSTM model to obtain the feature fusion vector t containing bidirectional sequence information i ′;

[0012] The feature fusion vector t i ′ is input into the feedforward neural network for BIEOU tag prediction, and the prediction sequence Y of the word BIEOU tag in all sentences is generated L ={y 1 ,y 2 ,…,y M}, where Y L Represents the BIEOU tag sequence of the sentence, y M Indicates the type of BIEOU label to which the Mth word in the sentence belongs;

[0013] The feature fusion vector t i ′ is input into the CRF model to calculate the possible probability distribution of the entity type of each word, and then the entity type with the highest probability is selected as the entity type of the word to generate the entity type sequence z of each word in the sentence L ={z 1 ,z 2 ,…,z M}, where zL Represents the entity type sequence of the sentence, z M Represents the entity type of the Mth word in the sentence;

[0014] According to the prediction sequence Y L ={y 1 ,y 2 ,…,y M} Extract the entities of all sentences in the judicial trial document; according to the entity type sequence z L ={z 1 ,z 2 ,…,z M}Extract the entity's type.

[0015] As a preferred example, the formula for mixing the enhanced data with the original training sample is:

[0016]

[0017] a~U(1,A) b~U(1,B) x~U(1,C) y~U(1,C)

[0018] In the formula, s aug represents the mixed training samples, represents the kth sentence randomly selected from the training sample, represents the qth sentence randomly selected from the augmented data, x represents the number of sentences randomly selected from the original training sample, y represents the number of sentences randomly selected from the original training sample, A is the number of sentences in the original training sample, B is the number of sentences in the augmented dataset, C represents the maximum number of sentences that can be connected, U(1,A), U(1,B) and U(1,C) represent randomly selecting a number from 1 to A, 1 to B and 1 to C respectively, a is the serial number of the sentence randomly selected from the original training sample, and b is the serial number of the sentence randomly selected from the augmented dataset.

[0019] As a preferred example, the language processing model includes a BERT language model and a Word2Vec word vector model; the sentence generates an embedded feature vector through the BERT language model The sentence generates an embedded feature vector through the Word2Vec word vector model

[0020] As a preferred example, the sentence introduces a pattern feature, which is used to capture the intrinsic word shape of the entity mention at the subword level; the pattern feature is encoded and sequentially input into the CNN and BiLSTM models to obtain the pattern feature embedding feature vector

[0021] As a preferred example, the feature fusion vector t containing bidirectional sequence information is obtained.i The method comprises the following steps:

[0022] The feature fusion vector t i Input into the BiLSTM model to get the forward hidden state and the backward hidden state

[0023]

[0024] The forward hidden state and the backward hidden state Concatenate to get the feature fusion vector t i ′:

[0025]

[0026] In the formula, [t 1 ,t 2 ,…,t M ] is a sentence sequence after feature fusion, and ⊕ represents a vector connection operation.

[0027] As a preferred example, generate the predicted sequence Y L ={y 1 ,y 2 ,…,y M The method comprises the following steps:

[0028] Calculate the probability P of each word in the sentence with respect to the BIEOU label i :

[0029] P i =softmax(FFN(t i ′))

[0030] In the formula, softmax is the softmax function, FFN is the feedforward neural network;

[0031] Choose the word with probability P i The largest BIEOU label is used as the BIEOU label of the word:

[0032] y i = argmax(P i )

[0033] In the formula, y i represents the BIEOU label of the i-th word in the sentence, and argmax is the argmax function;

[0034] Get the predicted sequence Y based on the BIEOU tag results of the word L ={y 1 ,y 2,…,y M}.

[0035] As a preferred example, generate entity type sequence z L ={z 1 ,z 2 ,…,z M The method comprises the following steps:

[0036] Calculate the probability Q of each word in the sentence belonging to each predefined entity type i :

[0037] Q i =CRF(t i ′)

[0038] In the formula, CRF is the CRF model;

[0039] Choose the word with probability Q i The largest entity type is used as the entity type of the word:

[0040] z i =Viterbi(Q i )

[0041] In the formula, z i Indicates the entity type of the i-th word in the sentence, and Viterbi is the Viterbi algorithm;

[0042] Get the entity type sequence z according to the entity type result of the word L ={z 1 ,z 2 ,…,z M}.

[0043] As a preferred example, the entity type of the word is a predefined entity type, and the predefined entity types include: court, business entity, government agency, regulations, suspect, victim, crime tool, stolen goods, item value, legal name, judge, plaintiff, defendant, political body, employer, individual business owner and job position.

[0044] A system for extracting entities from a few-sample judicial trial document, which uses the above-mentioned method for extracting entities from a few-sample judicial trial document; the entity extraction system comprises:

[0045] A training module is used to perform data enhancement on training samples to generate enhanced data, and then filter the generated enhanced data; the filtered enhanced data is mixed with the training samples to jointly train the model;

[0046] The vectorization module is used to generate three embedding vectors for each sentence in the judicial trial document, which are the context-related embedding feature vectors The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors Then the three embedding vectors are combined into a feature fusion vector t i ;

[0047] The entity extraction module is used to fuse the vector t according to the feature i Generate a prediction sequence Y for the word BIEOU tag in all sentences L ={y 1 ,y 2 ,…,y M};

[0048] The entity type extraction module is used to extract the entity type according to the feature fusion vector t i Generate entity type sequence z for each word in the sentence L ={z 1 ,z 2 ,…,z M}.

[0049] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the entity extraction method in a few-sample judicial trial file as described above.

[0050] The beneficial effects of the present invention are:

[0051] 1. The present invention adopts data enhancement technology to expand the training data set by retaining entity category label mask entities, changing entity category label prediction entities, and adding new entity category mask prediction methods. Then, the enhanced data is mixed with the original data and input into the language model for training, thereby solving the problem of insufficient training samples in the civil complaint of judicial trial documents.

[0052] 2. The present invention uses a language model to generate embedding vectors of context-related, part-of-speech and pattern features. These vectors are fused into feature fusion vectors. Subsequently, the feature fusion vectors are input into the Bi-LSTM network to capture bidirectional information, and combined with the feedforward neural network FFN to predict the BIEOU label to generate a prediction sequence. At the same time, the output of the Bi-LSTM is also input into the conditional random field (CRF) layer to select the most likely entity type based on probability. Finally, entities are extracted according to the predicted sequence, and the entity type, such as names, places, etc., is determined using the label frequency output by the CRF, to achieve accurate recognition of various entities in judicial documents. Compared with existing solutions, the solution of the present invention can accurately identify entity information and entity types from semi-structured text data. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1Flowchart for data augmentation;

[0054] Figure 2 The overall flow chart of a method for extracting entities from judicial trial documents with a small number of samples is shown;

[0055] Figure 3 A flowchart for extracting entities and entity types in a few-sample entity extraction method for judicial trial documents. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "or / and" used herein includes any and all combinations of one or more of the related listed items.

[0058] This embodiment provides a method for extracting entities from a small number of judicial trial documents, which trains all models in the absence of training samples, and then uses the trained models to identify and extract entities and entity types from case information based on trial materials. First, the models involved need to be pre-trained, and since a certain type of judicial trial document may have too few samples, pre-training lacks a large amount of data (i.e., training samples) to train the model, so this solution uses a data enhancement method to train our model. The method for training the model includes the following steps:

[0059] Performing data enhancement on the training samples to generate enhanced data; screening the generated enhanced data; mixing the screened enhanced data with the training samples and inputting both of them as training samples of the model.

[0060] Please refer to Figure 1, when performing data enhancement, three methods are used to perform data enhancement at the same time. The first is to retain the type label of the entity, mask the entity and context, and generate enhanced data. The second is to change the category label of the entity to mask the predicted entity and context, and generate enhanced data. The third is to add an entity category, perform mask prediction of the entity and context, and generate enhanced data. The following is a detailed example: Randomly select an entity segment from a sentence. When using the first method, mask the entity and part of the context segment around it. By masking and regenerating entities and their contexts, the entity diversity is increased while maintaining the consistency of entity types. For example: [Zhang SAN|person]and[li Si|person] <mask> [ <mask>|person] <mask>The enhanced data generated by the first method is: [Zhang SAN|person]and[li Si|person]robed[LiuBei|person]'s phone. The enhanced data generated by the second method is: [Zhang SAN|person]and[li Si|person]looted[phone|thing]from <liubei>The third method randomly selects an entity segment from the sentence and adds an entity category to generate the entity mask prediction. By adding new entities and contexts to the sentence, the entity diversity and context diversity are increased. For example, [Zhang SAN|person]and[li Si|person]stole[LiuBei|person] <mask> [ <mask>|thing] <mask>. The enhanced data generated by the third method is [Zhang SAN|person]and[li Si|person]stole[LiuBei|person]'s[watch|thing]and phone. Delete the enhanced data whose entity category does not match the specific entity, and retain the enhanced data whose entity category matches the specific entity. It is best to mix the screened enhanced data with the original data (original training samples). The purpose of mixing is to prevent the model from being biased towards short sequences, making the final trained model results inaccurate. The mixing formula is as follows:

[0061]

[0062] a~U(1,A) b~U(1,B) x~U(1,C) y~U(1,C)

[0063] In the formula, s aug Represents the mixed training samples. Represents the kth sentence randomly selected from the training sample. represents the qth sentence randomly extracted from the augmented data. x represents the number of sentences randomly extracted from the original data. y represents the number of sentences randomly extracted from the original data. A is the number of sentences in the original dataset. B is the number of sentences in the augmented dataset. C is a hyperparameter representing the maximum number of sentences that can be connected. U(1, A), U(1, B) and U(1, C) all represent uniform distribution, that is, a number is randomly selected from 1 to A, 1 to B and 1 to C respectively. a is the serial number of the sentence randomly extracted from the original dataset. b is the serial number of the sentence randomly extracted from the augmented dataset.

[0064] The above data enhancement method is used to pre-train the model used later. After training, the model is used to extract entities and entity types in judicial trial documents, such as Figure 2 and Figure 3 As shown, the extraction method comprises the following steps:

[0065] S1. Input a judicial trial document with L sentences into the language processing model. Each sentence consists of M words. Input the sentence into the language processing model and extract three embedding vectors for each sentence: context-dependent embedding feature vector The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors Then the three embedding vector sets are concatenated into a feature fusion vector ⊕ represents a vector concatenation operation, such as connecting these vectors end to end. In this step, It can be generated by the pre-trained BERT language model. The BERT language model can provide context-dependent embeddings based on a large amount of text data and capture the complex relationship between words. It can be generated by the pre-trained Word2Vec word vector model. The Word2Vec word vector model obtains the vector representation of each word by training on a large amount of text, which is used to capture the semantic information of the word.

[0066] The key point in the above embedding vector is to embed the pattern feature into the feature vector Introduction. In the civil complaint of the judicial trial documents, there are usually four parts: plaintiff, defendant, litigation request, facts and reasons. For example, plaintiff: xx, male / female, x-ethnic group, born on xx / xx / xx, currently living in xx building, xx community, xx road, xx district, xx city, citizen ID number xx, contact number: xx. Defendant 1: xx, male / female, x-ethnic group, born on xx / xx / xx, currently living in xx building, xx community, xx road, xx district, xx city, citizen ID number xx, contact number: xx. Defendant 2: xx, male / female, x-ethnic group, born on xx / xx / xx, currently living in xx building, xx community, xx road, xx district, xx city, citizen ID number xx, contact number: xx. Since the plaintiff and defendant's content contains telephone number, ID number, age and residential address, it contains a large number of numbers and region names. The writing of these contents has fixed features, so the pattern feature is introduced. The purpose of introducing this feature is to capture specific forms such as telephone numbers, ID numbers, and home addresses, such as mobile phone numbers, ID numbers, and regions. Map all uppercase tokens to a character 'U'. Map all lowercase tokens to 'L'. Map all numeric tokens to 'D'. If a token contains a mixture of uppercase, lowercase, and numbers, map each lowercase letter to 'l', uppercase letters to 'u', and numbers to 'd'. After encoding, it enters a three-layer CNN model with convolution kernels from 1 to 3, and then is sent to a BiLSTM model to generate the above pattern feature embedding feature vector The CNN model (Convolutional Neural Network) is a deep learning model. The core of CNN is the convolution layer, which captures the local features of the input data through filters or called convolution kernels. CNN uses three one-dimensional convolutional neural networks with kernel sizes of 1 to 3. These CNN networks are used to learn pattern features from the above mapped tags. The BiLSTM model is a variant of a recurrent neural network (RNN) that is very effective in processing sequence data such as text and time series. The core of the BiLSTM model is the LSTM unit, which is able to capture long-term dependencies in sequence data.

[0067] S2, feature fusion vector t i Input into the BiLSTM model to obtain the feature fusion vector t containing bidirectional sequence information i ′.

[0068] In this step, the feature fusion vector t i Input into the BiLSTM model to get the forward hidden state and the backward hidden state

[0069]

[0070] The forward hidden state and the backward hidden state Concatenate to get the feature fusion vector t i ′:

[0071]

[0072] In the formula, [t 1 ,t 2 ,…,t M ] is a sentence sequence after feature fusion. ⊕ represents a vector concatenation operation.

[0073] S3, then the feature fusion vector t i ′ is input into the feedforward neural network for BIEOU tag prediction, and the prediction sequence Y of the word BIEOU tag in all sentences is generated L ={y 1 ,y 2 ,…,y M }. At the same time, the feature fusion vector t i ′ is input into the CRF model to calculate the possible probability distribution of the entity type of each word, and then the entity type with the highest probability is selected as the entity type of the word to generate the entity type sequence z of each word in the sentence L ={z 1 ,z 2 ,…,z M }, where z L Represents the entity type sequence of the sentence, z M Represents the entity type of the Mth word in the sentence.

[0074] In this step, the BIEOU tag used is a tag system used for named entity recognition tasks in natural language processing. This system expands the traditional BIE tagging method to better handle nested and overlapping named entities, and can also tag single-word entities. Among them, B represents the beginning of the named entity, and the outer layer of each entity starts with a B tag. I represents the inner part of the named entity, but does not include the beginning and end, and is used for the middle part of continuous named entities. E represents the end of the named entity. For nested entities, the end of the outer entity is marked with E. O represents the non-entity part in the text, and U is used to mark single-word entities.

[0075] Specifically, generate the prediction sequence Y L ={y 1 ,y 2 ,…,y M The method comprises the following steps:

[0076] Calculate the probability P of each word in the sentence with respect to the BIEOU label i :

[0077] P i =softmax(FFN(t i ′))

[0078] In the formula, softmax is the softmax function, which is a function that converts a real vector into a probability distribution. FFN is a feedforward neural network, which is used to predict the label probability of each tag from the hidden state of LSTM. The probability P i It represents the use of FFN and softmax to convert the hidden state into a probability distribution to predict the probability that a word in a sentence belongs to one of the five types of entity BIEOU.

[0079] Choose the word with probability P i The largest BIEOU label is used as the BIEOU label of the word:

[0080] y i = argmax(P i )

[0081] In the formula, y i The BIEOU label of the i-th word in the sentence is a fixed value. argmax is the argmax function, which is a function that returns the parameter that makes the function reach the maximum value.

[0082] Get the predicted sequence Y based on the BIEOU tag results of the word L ={y 1 ,y 2 ,…,y M },y M Represents the BIEOU label type of the Mth word in the sentence.

[0083] In addition, the entity type sequence z is generated L ={z 1 ,z 2 ,…,z M The method comprises the following steps:

[0084] Calculate the probability Q of each word in the sentence belonging to each predefined entity type i :

[0085] Q i =CRF(t i ′)

[0086] In the formula, CRF is a CRF model, which is often used to process sequence data, especially in the field of natural language processing (NLP) for sequence labeling tasks, such as part-of-speech tagging, named entity recognition, etc. The CRF model considers dependencies to predict the probability distribution of which type of entity each word in a sentence belongs to.

[0087] Choose the word with probability Q i The largest entity type is used as the entity type of the word:

[0088] Z i =Viterbi(Q i )

[0089] In the formula, z i Represents the entity type of the i-th word in the sentence. Viterbi is the Viterbi algorithm, which is a dynamic programming algorithm used to find the entity type with the maximum probability for each word in the CRF model.

[0090] Get the entity type sequence z according to the entity type result of the word L ={z 1 ,z 2 ,…,z M }, z M Represents the entity type of the Mth word in the sentence. The standard entity types are all pre-defined in the system. The pre-defined entity types include court (CT), business entity (BUS), government agency (GOVER), law (LS), suspect (SUS), victim (VICT), tool of crime (INST), stolen goods (SI), value of goods (VALUE), legal name (LN), judge (JN), plaintiff (PLAT), defendant (DEAT), political entity (GPE), employer (UU), individual business owner (IBO) and job position (WORK-OF-ART).

[0091] S4. According to the predicted sequence Y L ={y 1 ,y 2 ,…,y M } Extract the entities of all sentences in the judicial trial document; according to the entity type sequence z L ={z 1 ,z 2 ,…,z M }Extract the entity's type.

[0092] In this step, the predicted sequence Y of each sentence is known L ={y 1 ,y 2 ,…,y M } and entity type sequence z L ={z 1 ,z 2 ,…,z M }, and then according to the standard rules of the BIEOU tag system: when encountering a B tag, start a new entity; when encountering an I tag, add the current word to the current entity; when encountering an E tag, end the current entity; when encountering an O tag, end the current entity and start a new entity. For the U tag, the entire word is considered a separate entity. For example, take the sentence "The University of Science and Technology of China is located in Hefei". The BIEOU tag system is annotated as:

[0093] middle country division technology big study Bit At combine Fat B I I I I E O O B E

[0094] This sequence is the predicted sequence Y L , we can know that "University of Science and Technology of China" and "Hefei" are both entities. Prediction sequence Y L Each word in will generate an entity type, which is consistent with the predicted sequence Y L One-to-one correspondence, that is, the entity type sequence z L ={z 1 ,z 2 ,…,z M }, in this sentence, because there are 10 Chinese characters (or each word in English), M takes the value of 10. At this time, in the entity "University of Science and Technology of China", the entity type corresponding to the Chinese characters is the entity type sequence z L Count the first six entity types in the table, and use the entity type with the highest number of occurrences as the entity type of the entity "University of Science and Technology of China". Similarly, assign an entity type to the entity "Hefei" in the same way.

[0095] In another embodiment, a system for extracting entities from a few-sample judicial trial documents is provided, which uses the method for extracting entities from a few-sample judicial trial documents as described above. The entity extraction system includes:

[0096] A training module is used to perform data enhancement on training samples to generate enhanced data, and then filter the generated enhanced data; the filtered enhanced data is mixed with the training samples to jointly train the model;

[0097] The vectorization module is used to generate three embedding vectors for each sentence in the judicial trial document, which are the context-related embedding feature vectors The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors Then the three embedding vectors are combined into a feature fusion vector t i ;

[0098] The entity extraction module is used to fuse the vector t according to the feature i Generate a prediction sequence Y for the word BIEOU tag in all sentences L ={y 1 ,y 2 ,…,y M };

[0099] The entity type extraction module is used to extract the entity type according to the feature fusion vector t i Generate entity type sequence z for each word in the sentence L ={z 1 ,z 2 ,…,z M }.

[0100] In other embodiments, a computer device is also provided. The computer device provided in this embodiment can take various forms, such as an intelligent terminal, a tablet computer, a laptop computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers) that can execute a program. The computer device of this embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus. The memory stores a computer program. When the computer program is executed by the processor, the steps of the entity extraction method in the small sample judicial trial file as described above are implemented.

[0101] In this embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device.

[0102] In other embodiments, the memory may also be an external storage device of a computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device. Of course, the memory may also include both an internal storage unit of the computer device and its external storage device. In this embodiment, the memory stores a computer program. When the computer program is executed by the processor, the steps of the entity extraction method in the few sample judicial trial files as described above are implemented.

[0103] In some embodiments, the processor may be a central processing unit (CPU), a graphics processing unit (GPU), a controller, a microcontroller, a microprocessor, or other data processing chips.

[0104] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described 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.

[0105] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.< / mask> < / mask> < / mask> < / liubei> < / mask> < / mask> < / mask>

Claims

1. A method for extracting entities from a few-sample judicial trial documents, characterized in that: In the absence of training samples, all models are trained, and entities and entity types in judicial trial documents are extracted through the trained models; wherein the method for training the model includes the following steps: Performing data enhancement on training samples to generate enhanced data; the data enhancement method includes: retaining the category label of the entity, masking the entity and context, and generating enhanced data; changing the category label of the entity to mask the predicted entity and context, and generating enhanced data; adding an entity category, performing mask prediction on the entity and context, and generating enhanced data; Screening the generated enhanced data: deleting the enhanced data whose entity category does not match the specific entity, and retaining the enhanced data whose entity category matches the specific entity; Mixing the screened enhanced data with the training samples and inputting them together as training samples of the model; Extracting entities and entity types from judicial trial documents includes the following steps: The judicial trial document consists of L sentences, each of which consists of M words. The sentences are input into the language processing model to generate three embedding vectors: context-dependent embedding feature vector The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors The three embedding vectors are combined into a feature fusion vector t i ; The feature fusion vector t i Input into the BiLSTM model to obtain the feature fusion vector t containing bidirectional sequence information i ′; The feature fusion vector t i ′ is input into the feedforward neural network for BIEOU tag prediction, and the prediction sequence Y of the word BIEOU tag in all sentences is generated L ={y1,y2,…,y M }, where Y L Represents the BIEOU tag sequence of the sentence, y M Indicates the type of BIEOU label to which the Mth word in the sentence belongs; The feature fusion vector t i ′ is input into the CRF model to calculate the possible probability distribution of the entity type of each word, and then the entity type with the highest probability is selected as the entity type of the word to generate the entity type sequence z of each word in the sentence L ={z1,z2,…,z M }, where z L Represents the entity type sequence of the sentence, z M Represents the entity type of the Mth word in the sentence; According to the prediction sequence Y L ={y1,y2,…,y M } Extract the entities of all sentences in the judicial trial document; according to the entity type sequence z L ={z1,z2,…,z M }Extract the entity's type.

2. The entity extraction method in a few-sample judicial trial document according to claim 1 is characterized in that: The formula for mixing the enhanced data with the original training samples is: a~U(1,A)b~U(1,B)x~U(1,C)y~U(1,C) In the formula, s aug represents the mixed training samples, represents the kth sentence randomly selected from the training sample, represents the qth sentence randomly selected from the augmented data, x represents the number of sentences randomly selected from the original training sample, y represents the number of sentences randomly selected from the original training sample, A is the number of sentences in the original training sample, B is the number of sentences in the augmented dataset, C represents the maximum number of sentences that can be connected, U(1,A), U(1,B) and U(1,C) represent randomly selecting a number from 1 to A, 1 to B and 1 to C respectively, a is the serial number of the sentence randomly selected from the original training sample, and b is the serial number of the sentence randomly selected from the augmented dataset.

3. The entity extraction method in a few-sample judicial trial document according to claim 1 is characterized in that: The language processing model includes a BERT language model and a Word2Vec word vector model; the sentence generates an embedded feature vector through the BERT language model The sentence generates an embedded feature vector through the Word2Vec word vector model 4. The entity extraction method in a few-sample judicial trial document according to claim 1, characterized in that: The sentence introduces a pattern feature, which is used to capture a specific form of shape such as a telephone number, ID number, and home address; the pattern feature is encoded and sequentially input into the CNN and BiLSTM models to obtain a pattern feature embedding feature vector 5. The entity extraction method in a few-sample judicial trial document according to claim 1, characterized in that: Get the feature fusion vector t containing bidirectional sequence information i The method comprises the following steps: The feature fusion vector t i Input into the BiLSTM model to get the forward hidden state and the backward hidden state The forward hidden state and the backward hidden state Concatenate to get the feature fusion vector t i ′: In the formula, [t1, t2, …, t M ] is a sentence sequence after feature fusion, Represents a vector concatenation operation.

6. The entity extraction method in a few-sample judicial trial document according to claim 1, characterized in that: Generate prediction sequence Y L ={y1,y2,…,y M The method comprises the following steps: Calculate the probability P of each word in the sentence with respect to the BIEOU label i : <h2 style=";text-align:left;direction:ltr">P<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> =softmax(FFN(t<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ′)) In the formula, softmax is the softmax function, FFN is the feedforward neural network; Choose the word with probability P i The largest BIEOU label is used as the BIEOU label of the word: y i =argmax(P i ) In the formula, y i represents the BIEOU label of the i-th word in the sentence, and argmax is the argmax function; Get the predicted sequence Y based on the BIEOU tag results of the word L ={y1,y2,…,y M }.

7. The entity extraction method in a few-sample judicial trial document according to claim 1, characterized in that: Generate entity type sequence z L ={z1,z2,…,z M The method comprises the following steps: Calculate the probability Q of each word in the sentence belonging to each predefined entity type i : Q i =CRF(t i ′) In the formula, CRF is the CRF model; Choose the word with probability Q i The largest entity type is used as the entity type of the word: z i =Viterbi(Q i ) In the formula, z i Indicates the entity type of the i-th word in the sentence, and Viterbi is the Viterbi algorithm; Get the entity type sequence z according to the entity type result of the word L ={z1,z2,…,z M }.

8. The entity extraction method in a few-sample judicial trial document according to claim 1, characterized in that: The entity type of the word is a predefined entity type, which includes: court, business entity, government agency, regulation, suspect, victim, crime tool, stolen item, item value, legal name, judge, plaintiff, defendant, political entity, employer, individual business owner, and job position.

9. A system for extracting entities from a few-sample judicial trial documents, characterized in that: The method for extracting entities from a small number of judicial trial documents according to any one of claims 1 to 8 is used; the entity extraction system comprises: A training module is used to perform data enhancement on training samples to generate enhanced data, and then filter the generated enhanced data; the filtered enhanced data is mixed with the training samples to jointly train the model; The vectorization module is used to generate three embedding vectors for each sentence in the judicial trial document, which are the context-related embedding feature vectors The word's part-of-speech embedding feature vector and pattern features are embedded in feature vectors Then the three embedding vectors are combined into a feature fusion vector t i ; The entity extraction module is used to fuse the vector t according to the feature i Generate a prediction sequence Y for the word BIEOU tag in all sentences L ={y1,y2,…,y M }; The entity type extraction module is used to extract the entity type according to the feature fusion vector t i Generate entity type sequence z for each word in the sentence L ={z1,z2,…,z M }.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for extracting entities from a few-sample judicial trial documents according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Intelligent semantic retrieval method based on cultural relic knowledge graph

    CN111522910A

  • Chinese named entity recognition model and method based on double neural network fusion

    CN111783462A

  • Judicial fact finding generation method and device based on deep neural network, and medium

    CN112347780A

  • Course trial query generation method and device for generating Seq2Seq model based on pointer, and medium

    CN112417155A

  • Entity relationship recognition method and system based on improved graph attention network

    CN113010683A