Auxiliary case judgment method and system based on generative automatic abstract
By performing feature extraction and modal alignment on multi-modal evidence data, combined with the self-attention mechanism and migration model, comprehensive visual and textual evidence content is generated, solving the problem of multi-modal evidence integration in the auxiliary judgment system and improving automatic summarization. accuracy and efficiency to support more accurate decision-making.
Patent Information
- Application Number
- CN202410762564.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-06
AI Technical Summary
Existing auxiliary judgment systems have challenges when processing multi-modal evidence, especially the integration of different modalities such as images and text, resulting in increased computational complexity and low accuracy in automatic summary generation.
Through feature extraction and modal alignment of multi-modal evidence data, the self-attention mechanism is used to fuse intra-modal visual and text vectors to generate comprehensive evidence content, and the migration model and RoBERTa model are used to extract elements and generate abstracts, filling in pre- Defined legal automatic digest format.
It improves the accuracy and efficiency of automatic summary generation, avoids over-fitting of the model on the training data, enhances the processing capabilities of multi-modal evidence, and provides more accurate case description and judgment prediction support.
Smart Images

Figure CN118608657A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and system for assisting case judgment based on generative automatic summarization. Background Art
[0002] In the case-adjudication assistance system, multimodal fusion and multimodal generation technology as well as generative automatic summarization technology are becoming key driving forces. Multimodal fusion integrates information from different modalities into one model, improving the system's ability to fully understand case information. The joint training model enables the system to simultaneously learn the correlation between multiple modalities, thereby improving the intelligence level of the system. Generative automatic summarization technology can quickly and accurately generate judgment texts and case predictions, providing effective case-adjudication assistance for judges. The application of these technologies makes the case-adjudication assistance system more intelligent and efficient, providing strong support for judicial decision-making.
[0003] In the existing technology, the case-adjudication assistance system faces significant challenges in dealing with multimodal evidence, especially how to efficiently integrate evidence from different modalities such as images and texts. Existing technologies introduce a large number of parameters, which may increase the complexity of calculations and affect the efficiency of the model; at the same time, complex fusion strategies may cause the model to overfit on the training data, resulting in low accuracy in the generation of automatic summarization. Summary of the invention
[0004] The object of the present invention is to provide a method and system for assisting case judgment based on generative automatic summarization, so as to solve the problem of low generation accuracy of existing automatic summarization.
[0005] In order to solve the above technical problems, in a first aspect, the present invention provides an auxiliary case judgment method based on generative automatic summarization, comprising the following steps:
[0006] Acquire multimodal evidence data and determine the legal automatic summarization format based on the multimodal evidence data;
[0007] Perform content annotation on multimodal evidence data to determine target objects in image data and target entities in text data in the multimodal evidence data;
[0008] Based on the target object in the image data and the target entity in the text data in the multimodal evidence data, feature extraction is performed on the multimodal evidence data to determine the image features and text features in the multimodal evidence data;
[0009] Based on the image features and text features in the multimodal evidence data, a modal alignment operation is performed between the image and the text to obtain the image features and text features after the modal alignment operation in the multimodal evidence data;
[0010] The image features and text features after the modal alignment operation in the multimodal evidence data are fused to generate an intramodal visual context vector and an intramodal text context vector;
[0011] The modal visual context vector and the intramodal text context vector are fused to generate a vector through the self-attention mechanism, and then a case description text that integrates visual and textual evidence content is generated;
[0012] Based on the generated case description text, element extraction is performed, and the extracted elements are used to fill in the legal automatic abstract format to generate a legal abstract.
[0013] In combination with the first aspect, in some possible implementations, generating an intramodal visual context vector includes:
[0014] Given local feature vectors representing visual features of all M regions of the input image, a visual global context vector is determined;
[0015] Given the visual fragment features, organize them in spatial order, and then input them into the gated recurrent unit network GRU in sequence to simulate the spatial position information between them, thereby obtaining a set of hidden state vectors;
[0016] Perform mean pooling on the obtained hidden state vector to obtain the visual space position vector feature;
[0017] Obtaining a visual query guidance vector based on the obtained visual global context vector features and visual space position vector features;
[0018] The attention weight of each image region is calculated by putting the visual feature vector and the visual query guidance vector into the attention function. The attention function uses a two-layer feedforward perceptron FFP followed by a softmax function to ensure that all calculated weights sum to 1.
[0019] Based on the attention weights of different image regions in the image, an intramodal visual context vector is determined.
[0020] Furthermore, the visual global context vector is determined, and the calculation formula is:
[0021]
[0022] Among them, v (glo) represents the visual global context vector; P (0) Represents a weight matrix; I n represents the local feature vector of the nth region of the input image; tanh represents the activation function; N represents the number of regions of the input image.
[0023] In combination with the first aspect above, in some possible implementations, the attention weight of each image region is calculated, and the corresponding calculation formula is:
[0024]
[0025] in and Represents the parameters of the perceptron; represents the hidden state of the visual attention function; e represents element-wise multiplication; represents the attention weight; softmax represents the activation function; v (0) represents the visual query guidance vector.
[0026] In combination with the first aspect above, in some possible implementations, the intramodal visual context vector is determined, and the corresponding calculation
[0027] The calculation formula is:
[0028]
[0029] Among them, v (1) represents the intramodal visual context vector; P (1) Represents a weight matrix.
[0030] In combination with the first aspect, in some possible implementations, generating an intramodal text context vector includes:
[0031] Given a vector representing the vocabulary text features in a sentence, it is fused to form a global text representation and obtain a global text context vector;
[0032] Based on the global text context vector, an intramodal text context vector is determined.
[0033] In conjunction with the first aspect above, in some possible implementations, generating a case description text integrating visual and textual evidence content includes:
[0034] The self-attention mechanism is used to calculate the relationship between the intramodal visual context vector and the intramodal text context vector, and the attention weight between the intramodal visual context vector and the intramodal text context vector is obtained;
[0035] According to the attention weight, the intramodal visual context vector and the intramodal text context vector are weighted averaged to obtain a fusion vector;
[0036] The fused vector is positionally encoded and input into the Transformer encoder of the transfer model. The encoder of the transfer model learns the intrinsic relationship of the fused data through self-attention, and the decoder of the transfer model generates text autoregressively according to the output of the Transformer encoder, thereby obtaining a case description text that integrates visual and textual evidence content.
[0037] In combination with the first aspect above, in some possible implementation methods, the RoBERTa model is used for feature extraction based on the generated case description text, and in the process of feature extraction, the RoBERTa model is re-pretrained by constructing unsupervised sentence knowledge, and the feature description information is obtained by constructing supervised type sentence pair knowledge, and the POS information is integrated into the word embedding representation of RoBERTa.
[0038] In combination with the first aspect above, in some possible implementations, the method further includes performing quality enhancement processing on the acquired multimodal evidence data, and the quality enhancement processing step includes:
[0039] For the image data in the multimodal evidence data, a non-local mean denoising algorithm is used to denoise the image data to obtain denoised image data;
[0040] Applying an automatic contrast enhancement algorithm to enhance the denoised image data to obtain enhanced image data;
[0041] The Laplace algorithm is used to perform clarity processing on the enhanced image data, and finally the quality enhanced image data is obtained;
[0042] For the text data in the multimodal evidence data, text normalization is performed on the text data to obtain the normalized text data;
[0043] The language model is used to automatically correct spelling errors and grammatical errors in the standardized text data, and finally the text data with enhanced quality is obtained.
[0044] In order to solve the above technical problems, in a second aspect, the present invention also provides an auxiliary case judgment system based on generative automatic summarization, comprising:
[0045] A data acquisition module is used to: acquire multimodal evidence data and determine the legal automatic abstract format based on the multimodal evidence data;
[0046] The annotation recognition module is used to: annotate the content of the multimodal evidence data and determine the target object in the image data and the target entity in the text data in the multimodal evidence data;
[0047] A feature extraction module is used to: extract features from the multimodal evidence data based on the target object in the image data and the target entity in the text data in the multimodal evidence data, and determine the image features and text features in the multimodal evidence data;
[0048] A modality alignment module is used to: perform a modality alignment operation between the image and the text based on the image features and the text features in the multimodal evidence data, and obtain the image features and the text features after the modality alignment operation in the multimodal evidence data;
[0049] A context vector generation module is used to: fuse the image features and text features after the modal alignment operation in the multimodal evidence data to generate an intramodal visual context vector and an intramodal text context vector;
[0050] The case description text generation module is used to: fuse the modal visual context vector and the intramodal text context vector to generate a vector through the self-attention mechanism, and then generate a case description text that integrates visual and text evidence content;
[0051] The automatic abstract generation module is used to: extract elements based on the generated case description text, and use the extracted elements to fill in the legal automatic abstract format to generate a legal abstract.
[0052] To solve the above technical problems, in a third aspect, the present invention further provides an auxiliary judgment device based on generative automatic summarization, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the method in the above first aspect or any possible implementation of the first aspect.
[0053] To solve the above technical problems, in a fourth aspect, the present invention further provides a computer program product, which includes: a computer program code, when the computer program code runs on a computer, enables the computer to execute the method in the above first aspect or any possible implementation of the first aspect.
[0054] To solve the above technical problems, in a fifth aspect, the present invention further provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above first aspect or any possible implementation of the first aspect.
[0055] The present invention has the following beneficial effects: by extracting features from multimodal evidence data, and better learning single-modal representations before fusion, image-text comparative learning is performed, and modal alignment is completed, so that cross-modal tasks can be better handled; at the same time, the endomodal visual vector and the text vector are fused through a self-attention mechanism to generate a vector, and then processed using a position encoding and a transfer model, so as to efficiently generate a case description text, aiming to integrate the content in visual and text evidence, provide event descriptions, involved entities and key facts, and provide a basis for subsequent case judgment predictions and legal term analysis; finally, based on the generated case description text, element extraction is performed, and the extracted elements are used to fill in a predefined legal automatic abstract format for multimodal data, and finally a legal abstract is generated, thereby improving the efficiency of the model, avoiding overfitting of the model on the training data, and effectively improving the accuracy of automatic abstract generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 The overall logic block diagram of an auxiliary case judgment method based on generative automatic summarization according to an embodiment of the present invention;
[0058] Figure 2 A basic flow chart of a method for assisting case judgment based on generative automatic summarization provided by an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of the AUC curve of the model proposed in the embodiment of the present invention in the recognition task;
[0060] Figure 4 AUC curve diagram of CNN in recognition tasks according to an embodiment of the present invention;
[0061] Figure 5 A schematic diagram of a confusion matrix generated by the image crime element extraction model extraction results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to clearly illustrate the technical features of the present invention, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.
[0063] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0064] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0065] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0066] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0067] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly indicated in the context, they should be understood as "one or more". In the description of the present invention, unless otherwise specified, "multiple" refers to two or more than two, and other quantifiers are similar; "at least one item", "one or more items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one or more items of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of association relationship that describes the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0068] Although operations or steps are described in a specific order in the drawings in the embodiments of the present invention, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or that all the operations or steps shown must be performed to obtain the desired results. In the embodiments of the present invention, these operations or steps may be performed in series; these operations or steps may also be performed in parallel; or some of these operations or steps may be performed.
[0069] At the same time, it is understood that the data involved in the technical solution of the present invention (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the relevant laws, regulations and relevant provisions. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meanings as those generally understood by technicians in the technical field of the present invention, and all parameters or indicators in the formulas involved in the present invention are normalized values that eliminate the influence of dimensions.
[0070] In order to solve the problem of low generation accuracy of existing automatic summarization, an embodiment of the present invention provides an auxiliary case judgment method and system based on generative automatic summarization. The method extracts features from multimodal evidence data, learns single-modal representation better before fusion, performs image-text comparative learning, and completes modal alignment, so as to better handle cross-modal tasks; at the same time, the internal modal visual vector and the text vector are fused through the self-attention mechanism to generate a vector, which is then processed using the position encoding and transfer model, so as to efficiently generate a case description text, aiming to integrate the content in the visual and text evidence, provide event descriptions, involved entities and key facts, and provide a basis for subsequent case judgment prediction and legal term analysis; finally, based on the generated case description text, element extraction is performed, and the extracted elements are used to fill in the pre-defined legal automatic summarization format for multimodal data, and finally a legal abstract is generated, thereby improving the efficiency of the model, avoiding overfitting of the model on the training data, and effectively improving the accuracy of automatic summarization generation.
[0071] The following will introduce in detail a case-judgment assistance method and system based on generative automatic summarization provided by an embodiment of the present invention in conjunction with the accompanying drawings.
[0072] Figure 1 and Figure 2 The overall logic block diagram and basic flow chart of an auxiliary case judgment method based on generative automatic summarization provided by an embodiment of the present invention are respectively shown. The method specifically includes the following steps:
[0073] Step S100: Acquire multimodal evidence data, and perform quality enhancement processing on the multimodal evidence data.
[0074] Existing judicial data sets, namely multimodal evidence data, include image and text data. By performing comprehensive quality enhancement processing on multimodal evidence data, the clarity of the data and the accuracy of the information can be improved, and high-quality input data can be prepared for feature extraction.
[0075] In an embodiment of the present invention, for image data in multimodal evidence data, the steps of performing quality enhancement processing include: first, using a non-local mean denoising algorithm to perform denoising processing on the image data to reduce the noise generated during the image capture process, and reduce the noise while maintaining image details; then applying an automatic contrast enhancement algorithm to enhance the denoised image data to adjust the brightness and contrast of the image so that the main features in the image are more prominent and the visual effect is improved, thereby obtaining enhanced image data; finally, using a Laplacian algorithm to perform clarity processing on the enhanced image data to improve the overall or local clarity of the image so that important details in the image are easier to identify.
[0076] For the text data in the multimodal evidence data, natural language processing technology is used to perform quality enhancement processing. The steps for quality enhancement processing include: first, text standardization processing, including removal of stop words, stemming and lemmatization, etc., to remove meaningless filler words and interference information, and obtain standardized text data; then use the language model (Generative Pre-trained Transformer, GPT) to perform in-depth grammatical analysis and semantic understanding, automatically correct spelling errors and grammatical errors in the text, and improve the semantic clarity and accuracy of the text.
[0077] After quality enhancement processing of multimodal evidence data, the processed image and text data are quality evaluated. Based on preset quality standards, the clarity index of the image and the readability of the text are scored, and low-quality data are automatically identified and further optimized.
[0078] Step S200: Determine the legal automatic summarization format based on multimodal evidence data.
[0079] Define the legal abstract format for multimodal data, analyze and segment the existing legal abstract data, and on this basis, customize the legal automatic abstract format based on multimodal data.
[0080] Step S300: performing content annotation on the multimodal evidence data after quality enhancement processing, and determining a target object in the image data and a target entity in the text data in the multimodal evidence data.
[0081] For the multimodal evidence data after quality enhancement, preliminary content annotation is performed to identify the target objects in the image data and the target entities in the text data in the multimodal evidence data, giving the data a structured form. The target objects here refer to the important objects in the image data, and the target entities refer to the key entities in the text data.
[0082] In an embodiment of the present invention, the steps for implementing preliminary content annotation for image data in multimodal evidence data after quality enhancement processing include: using a ResNet-50 model to automatically identify important objects in the image, including but not limited to people, objects, and scenes; for each important object identified, using the image segmentation technology Mask R-CNN for precise annotation, covering the object's category, location and possible attributes, such as color, size, etc.
[0083] For the text data in the multimodal evidence data after quality enhancement processing, the implementation steps for preliminary content annotation include: using a pre-trained model based on the Transformer architecture (Bidirectional Encoder Representations from Transformers, BERT) to automatically extract key entities from the text, such as names, places, dates, etc., and annotate these entities in detail.
[0084] Step S400: extracting features from multimodal evidence data to determine image features and text features.
[0085] The image data and text data in the multimodal evidence data are input into respective feature extraction networks, thereby extracting high-dimensional features from the multimodal evidence data, and image features and text features can be obtained. In an embodiment of the present invention, for the image data in the multimodal evidence data, a convolutional neural network is used to extract the features of the image data, and the image is converted into a matrix representation; for the text data in the multimodal evidence data, a neural network language model (NNLM) is used to extract the text features of the text data.
[0086] In the process of extracting text features of text data through NNLM, the sentence is input, and the specific input is: t-n+1 ,…,W t-2 ,W t-1 , that is, the input is the tth word W tThe first n-1 words of the network are taken and the word vectors of the first n-1 words are obtained; the first layer of the network (i.e. the input layer): these n-1 word vectors are concatenated end to end to form an m*(n-1) vector x, where m is the dimension of the word vector; the second layer of the network (i.e. the hidden layer): first a fully connected layer d+Hx is used for calculation, where d represents the bias and H represents the weight of the corresponding vector. After passing through the fully connected layer, the tanh activation function is used for activation; the third layer of the network (i.e. the output layer): the third layer is essentially also a fully connected layer, with a total of V output nodes, and each output node y i Indicates the log probability of the next word i, and finally uses the softmax activation function to convert the output y i Perform normalization.
[0087] Step S500: performing an alignment operation between the image and the text based on the image features and the text features in the multimodal evidence data.
[0088] In order to better learn unimodal representations before fusion, three pre-training objectives are set: Image-text Contrastive Learning (ITC) on the unimodal encoder, Masked Language Model (MLM) and Image-text Matching (ITM) on the multimodal encoder to complete the alignment of the modalities, so as to better handle cross-modal tasks, optimize the processing effect of cross-modal tasks, and improve the system's processing ability for the fusion of different modal data.
[0089] In the embodiment of the present invention, image-text contrast learning is first performed, and a metric function s=g is constructed. v (v cls ) · g w (w cls ) so that the corresponding similarity scores of image and text pairs can be calculated, ensuring that they can correspond in parallel and have higher scores. cls and w cls denotes the embedding of [CLS] tokens in the image and text encoding sequences respectively, cls, v and w all represent indices, and g v (v cls ) and g w (w cls ) respectively represent v cls and w cls The linear transformation mapped to the standardized low-dimensional representation, · represents the transpose. Two queues are set to store the most recent M image-text representations of the momentum unimodal encoder. The normalized features of these momentum encoders are recorded as g' v (v'cls ) and g' w (w' cls ). In the study, the definition is:
[0090] s(I,T)=g v (v cls ) · g' w (w' cls );
[0091] s(T,I)=g w (w cls ) · g' v (v' cls );
[0092] Where s(I,T) represents the similarity score between image I and text T; s(T,I) represents the similarity score between text T and image I; v′ cls and w′ cls Represent the feature representations of [CLS] token of image and text data extracted by momentum encoder respectively.
[0093] For any image-text pair, the normalized image-to-text and text-to-image similarities are calculated using the following formula:
[0094]
[0095] in, Represents the image I for the mth text T m similarity; Represents the text T for the mth image I m similarity; τ represents the adjustable temperature parameter; s(I,T m ) represents image I and mth text T m The similarity score between s(T,I m ) represents the text T and the mth image I m The similarity score between them; M represents the number of images or texts; exp represents an exponential function with the natural constant e as the base.
[0096] With y i2t (I) and y t2i (T) represents the one-hot similarity of the true label, where the probability of positive pairs is set to 1 and the probability of negative pairs is set to 0. Based on this, the loss function for the comparison between image and text can be obtained by calculating the cross entropy H of the two:
[0097]
[0098] Among them, Litc represents the loss of contrast between image and text; H(y i2t (I),p i2t (I)) represents y i2t (I) and p i2t (I) cross entropy; H(y t2i (T),p t2i (T)) represents y t2i (T) and p t2i The cross entropy of (T); E (I,T)~D represents the expected value of image I and text T in dataset D; y i2t (I) and y t2i (T) represents the true labels predicted from image to text and from text to image respectively; p i2t (I) and p t2i (T) represents the probability distribution of predicting from image to text and from text to image, respectively.
[0099] In the next stage, the Masked Language Model (MLM) predicts masked words based on the image content and its associated contextual text. The model randomly selects input tokens with a certain probability and masks them, and then predicts the probability distribution of masked tokens. The model is trained by minimizing the cross entropy loss function so that its prediction results are as close to the actual label data as possible. The corresponding calculation formula is:
[0100]
[0101] Among them, L mlm represents the masked language model loss function; Represents image I and masked text Expected value in dataset D; Represents y msk and The cross entropy of y msk represents the true label of the masked words; Represents the model's predicted probability for the masked words; Represents the masked text.
[0102] The last step is to determine whether a set of images and texts correspond to each other through image-text matching (ITM). The model uses the multimodal encoder output to represent the joint representation of image and text pairs, and together with the fully connected layer and softmax activation function, predicts the matching probability of image-text pairs.
[0103] In order to improve the accuracy of model prediction, the strategy of minimizing cross entropy loss is adopted in the training process of the image-text matching (ITM) task. The formula is as follows:
[0104] L itm =E (I,T)~D H(y itm ,p itm (I,T));
[0105] Among them, L itm represents the loss of the image-text matching task; H(y itm ,p itm (I,T)) represents y itm and p itm Minimize the cross entropy of (I,T); y itm is a two-dimensional one-hot vector, representing the true label; p itm (I,T) represents the predicted two-category probabilities.
[0106] By achieving the above three complete pre-training goals, consistent alignment between modalities is completed, thereby achieving performance improvement in cross-modal task processing.
[0107] Step S600: Fusing the image features and text features in the multimodal evidence data to generate an intramodal visual context vector and an intramodal text context vector.
[0108] By fusing the image features and text features in multimodal evidence data, the intramodal context is generated to ensure that the information of the two modalities can be effectively combined, thereby improving the accuracy and efficiency of subsequent analysis.
[0109] In the embodiment of the present invention, given the local feature vectors {I1, I2, ..., I N}, so that the visual global context vector can be determined, and the calculation formula is:
[0110]
[0111] Among them, v (glo) represents the visual global context vector, which is used to encode the global information from the visual modality; P (0) represents a weight matrix that aims to embed the visual feature vector into a common space compatible with the textual context vector; I n represents the local feature vector of the nth region of the input image; tanh represents the activation function.
[0112] Given the visual fragment feature, that is, the local feature vector {I1,I2,…,I N}, first organize them in spatial order, and then input them into the gated recurrent unit network GRU in sequence. GRU is a special type of RNN (Recurrent Neural Networks) that is characterized by efficient and effective calculation to simulate the spatial position information between them. Specifically, the above process can be defined as follows:
[0113]
[0114] in, represents the hidden state of GRU at time step n, Represents the hidden state of GRU at time step n-1, so we can get a set of hidden state vectors And perform mean pooling on them to obtain the visual space position vector features This feature summarizes the spatial location information in the context of the entire image.
[0115] Next, we obtain the visual global context vector feature v (glo) and the visual space position vector feature v (loc) Afterwards, they are combined via element-wise summation to obtain the fused query guidance of the visual modality.
[0116] Specifically, the visual query guidance vector v (0) The formula can be defined as follows:
[0117]
[0118] in, It represents the element-by-element summation. By summing up v (glo) and v (loc) Put it together.
[0119] After that, by transforming the visual feature vector, that is, the local feature vector {I1,I2,…,I N} and the visual query guidance vector v (0) By putting in the attention function, the attention weight of each image region can be calculated. The attention function uses a two-layer feedforward perceptron (FFP) followed by a softmax function to ensure that the sum of all calculated weights is 1. The formula can be defined as follows:
[0120]
[0121] in and Represents the parameters of the perceptron; represents the hidden state of the visual attention function; e represents element-wise multiplication; represents the attention weight.
[0122] After calculating the attention weights of different regions of the image, the intramodal visual context vector v (1) The calculation is done by the following formula:
[0123]
[0124] Among them, P (1) represents a weight matrix that aims to embed the visual feature vector into a common space compatible with the textual context vector in order to measure the similarity between the visual representation and the textual representation.
[0125] Given a vector {S1,…,S L}, and fuse them into a global text representation, which can be defined as the following formula:
[0126]
[0127] Among them, t (0) represents a global text context vector, which encodes the global information from the text modality; S l Represents the text feature vector of the lth word in a sentence, where l represents the index, indicating the position of the word in the sentence; L represents the total number of words in the sentence, that is, the length of the sentence.
[0128] Then, the intramodal text context vector t (1) The calculation is done by the following formula:
[0129]
[0130] in, and Parameters representing FFP; represents the hidden state of the text attention; Represents the attention weight of the lth word in the text attention mechanism.
[0131] Step S700: The modal visual context vector and the intramodal text context vector are fused to generate a vector through the self-attention mechanism, and processed using the position encoding and transfer model to generate a case description text that integrates visual and textual evidence content.
[0132] The intramodal visual context vector and the intramodal textual context vector are fused into a generated vector through the self-attention mechanism, and then processed using the position encoding and transfer model to efficiently generate text. This text aims to integrate the content of visual and textual evidence, provide event descriptions, involved entities and key facts, and provide a basis for subsequent case predictions and legal term analysis.
[0133] In this embodiment of the present invention, the self-attention mechanism is first used to calculate the intramodal visual context vector v (1) and the inner modal text context vector t (1) Specifically, the following steps are performed:
[0134] v (1) and t (1) Perform linear transformation to obtain query vector Q, key vector K and value vector V respectively:
[0135] Q=W q v (1) ;
[0136] K=W k t (1) ;
[0137] V=W v t (1) ;
[0138] Among them, W q , W k and W v is a learnable weight matrix.
[0139] Calculate the dot product between the query vector Q and the key vector K to get the attention score matrix A:
[0140] A=QK T ;
[0141] Here A is a matrix, each element of which is ij Indicates v (1) The i-th element and t (1) The similarity of the jth element in .
[0142] To scale the similarity matrix, use Scaling, where d k is the dimension of the key vector:
[0143] For the scaled attention score matrix Perform a softmax operation to obtain the attention weight matrix α:
[0144]
[0145] Among them, α in the attention weight matrix α ij Indicates v (1) The i-th element in t (1) The attention weight of the j-th element in .
[0146] Use the attention weight matrix α to perform weighted summation on the value vector V to obtain the fused context vector C:
[0147]
[0148] Among them, C in the context vector C i Indicates v (1) The context vector corresponding to the i-th element in after fusion is the fusion vector.
[0149] Then, the fusion vector is positionally encoded and input to the Transformer encoder of the transfer model. The encoder learns the intrinsic relationship of the fusion data through self-attention, and the decoder of the transfer model generates text autoregressively based on the encoder output. The whole process is optimized through the cross entropy loss function, and the model parameters are fine-tuned to improve the accuracy of the generated text. Specifically, it is achieved through the following steps:
[0150] The fused context vector C is positionally encoded to preserve the sequence information. The position encoding vector P is calculated using the following formula:
[0151]
[0152] Where pos is the position, i is the dimension index, and d is the vector dimension.
[0153] Positional encoding helps the model identify the relative positions of elements in the input sequence by generating a unique encoding vector for each input position, thereby better capturing patterns and dependencies in sequence data.
[0154] The context vector C with position encoding is then input into the Transformer encoder, which processes the data through a multi-head self-attention mechanism and a feedforward network layer and outputs the encoded context vector E.
[0155] The encoder output E is input into the Transformer decoder, which generates the target text by autoregression. The decoder also uses the self-attention mechanism and feedforward network layer, and combines the output of the previous time step to generate the text of the current time step.
[0156] The cross entropy loss function is used to calculate the difference between the generated text and the target text, and the model parameters are adjusted through back propagation and optimization algorithms to improve the accuracy of the generated text.
[0157] Step S800: Extract elements based on the generated case description text, and use the extracted elements to fill in the legal automatic abstract format to generate a legal abstract.
[0158] First, construct unsupervised civil case sentence knowledge. By constructing unsupervised sentence knowledge, re-pretrain the RoBERTa (A Robustly Optimized BERT Pretraining Approach) model based on public domain data to obtain a Chinese civil domain language model. Secondly, construct supervised civil case sentence pair knowledge. By constructing supervised sentence pair knowledge, more element description information is obtained to provide sufficient knowledge reserves for element understanding. Then, a word embedding input representation based on POS (Part-of-Speech) information is performed: by integrating POS information into the word embedding representation of RoBERTa, more lexical information is obtained. Among them, the unsupervised sentence knowledge corresponds to the pre-training part of RoBERTa, and a language model is constructed through unsupervised learning to obtain a better understanding and representation of civil case sentences; the supervised sentence corresponds to constructing sentence pair knowledge through supervised learning to extract element description information; the word embedding input representation based on POS information corresponds to integrating POS information into the word embedding representation of RoBERTa.
[0159] The embodiment of the present invention uses the RoBERTa model to process sentence pairs, and generates input word vectors by three methods: aggregate segment embedding, token embedding, and position embedding. This combination enables RoBERTa to effectively capture the semantic information of words. The formula for obtaining word vectors is as follows:
[0160] P m =P seg +P tok +P loc ;
[0161] Among them, P m Represents word vector; p seg represents aggregated segment embedding; p tok Indicates token embedding; p loc Represents positional embedding.
[0162] In order to further enhance the model's understanding of syntactic information, part-of-speech POS information is introduced into the input embedding. The Hagongda parser is used to identify POS tags and embed them to obtain rich input embeddings that contain detailed syntactic information of words. By tokenizing the input sentence and using the converted POS tag matrix to convert it into a POS vector through a linear transformation, semantic and syntactic information are effectively combined, providing a more comprehensive perspective for in-depth understanding of the text.
[0163]
[0164] Among them, P pos represents the embedding vector of the POS tag; P vWord embedding vectors representing vocabulary; Represents the weight parameters learned in the fine-tuning phase; V represents the size of the vocabulary; H represents the hidden layer dimension of the RoBERTa model.
[0165] Then, based on the shallow feature extraction of the multi-layer tensor network notation (Tnn), in the embodiment of the present invention, the RoBERTa model fine-tuned by domain knowledge is adopted to enhance the capture of text features through the recurrent convolution gated unit. Compared with the BERT model, the RoBERTa model uses the GeLU activation function instead of the traditional ReLU in its feedforward network to optimize the performance of the continuous fully connected layer. The formula is as follows:
[0166] FFNNR(h f ) = h′ f =[GeLU(h f W1)]W2;
[0167] Among them, FFNNR represents a feedforward neural network that does not use the ReLU activation function but uses GeLU; H * represents the expansion dimension, which is a predefined hyperparameter. represents the vector space, H represents the dimension of the feature vector; h f Represents the feature vector input to the feedforward neural network; h' f Represents the output feature vector of the feedforward neural network.
[0168] At the same time, the multi-head self-attention mechanism of the transformer architecture is applied to capture the semantic associations of different components in a sentence, thus providing a deeper and more context-related word representation for text classification. In addition, the introduction of layer normalization and residual connections effectively alleviates network degradation and gradient problems while enhancing the depth of the model, ensuring the training stability of the deep neural network. The final output formula is as follows:
[0169]
[0170] in, represents the input of the next coding layer; LN represents layer normalization. After several layers, the output of the RoBERTa model is recorded as T = (T1, T2, ..., T B ), B represents the batch size.
[0171] Next, deep feature extraction is performed based on the RCNN network (Region-based Convolutional Network). At this stage, the embodiment of the present invention designs a recurrent convolution gating unit, which mainly includes two parts: the concatenation of the RoBERTa model output T and the LSTM layer output, and a fully connected layer with a maximum pooling operation. The goal of the recurrent convolution gating unit is to encode the input sentence (which is also the output of RoBERTa) and obtain the core information. The corresponding calculation formula is:
[0172] t=(t1,t2,...t B )=max[(S1,S2...S B )*W];
[0173] Among them, t∈R( B*H ) represents the final output of the recurrent convolutional gating unit; represents the parameters of the fully connected layer, H L represents the hidden size of the LSTM layer; max[i] represents the maximum pooling operation; S i express and the output of LSTM The concatenation is expressed as:
[0174]
[0175] Among them, F and H represent the sequence length and the hidden layer dimension of RoBERTa respectively; represents a certain feature vector of the i-th sample; T i Represents a specific feature of the i-th sample.
[0176] Finally, the text is mapped to the label layer through the softmax function to output the predicted element label. In the output layer, the output t of the recurrent convolutional neural network is passed through the softmax function to output the classification of the factual elements of the civil case. Since the extraction task is converted into a binary classification, the output result is whether the current sample is associated with a certain label. The prediction results are as follows:
[0177]
[0178] in, Represents the output result of the softmax function; W y and b y Represent the weights and bias parameters of the output layer respectively; It represents the output of the softmax function, that is, the predicted probability of each category, and t represents the input of the softmax function, that is, the feature vector calculated by the previous layer of the network.
[0179] The training objective of the proposed entity extraction and knowledge graph construction model (KGCEE) is to minimize the cross entropy between the predicted distribution and the actual label. The corresponding loss function L is:
[0180]
[0181] Where m represents the number of training samples, 1{Truth}=1, 1{False}=0; k represents the number of categories, indicating how many categories there are in the classification problem; y i Represents the true label of the i-th sample; It represents the predicted probability that the i-th sample belongs to the j-th class.
[0182] Step S900: Based on the generated legal abstract, generate case judgment prediction and related legal term analysis through a neural network.
[0183] In the embodiment of the present invention, the obtained text is first segmented according to symbols to obtain a preliminary legal text, and then the obtained preliminary legal text is subjected to keyword extraction in combination with the semantic coding algorithm KeyBert. For better explanation, the principle of KeyBert is given here:
[0184] First, BERT (Bidirectional Encoder Representations from Transformers) is used to extract document embedding to obtain document-level vector representations. Then, word vectors are extracted for N words or phrases. Then, cosine similarity is used to find the words or phrases that are most similar to the document. Finally, the most similar words can be identified as the words that best describe the entire document.
[0185] The knowledge in the knowledge graph is expressed as a posterior regular term of the optimization target to guide the learning of the transfer model. Then the transformer model with the posterior regular term added is used as the backbone, and the obtained keywords are used as input through word embedding to finally obtain the legal abstract and case prediction.
[0186] In order to verify the effectiveness of the present invention, in the part of extracting factual elements of judicial cases, for the same data set, the method proposed in the embodiment of the present invention is experimented with the existing support vector machine (SVM), convolutional neural network (CNN), bidirectional gated recurrent unit (Bi-GRU) and recurrent neural network (RNN). The experimental results are shown in Table 1 below:
[0187] Table 1
[0188]
[0189] It can be seen from Table 1 above that the feature extraction model proposed in the embodiment of the present invention has good performance. Compared with the existing method, the accuracy, recall rate and F1 score are all improved to a certain extent.
[0190] In this experiment, a classification experiment was conducted based on the UCF Crime Dataset to identify whether criminal images involve crimes. The results are as follows: Figure 3 , Figure 4 and Figure 5 As shown. Among them, Figure 3 This is the AUC curve of the model proposed in the embodiment of the present invention in the recognition task. Figure 4 is the AUC curve of CNN in the recognition task, Figure 5 The confusion matrix generated by the image crime element extraction model extraction result. From the above results, it can be seen that in terms of crime image classification, the model proposed in the embodiment of the present invention has higher performance than CNN and has good practicality.
[0191] At the same time, for the same judicial data set Chinese AI and Law (CAIL) 2018, experiments were conducted on the method proposed in the embodiment of the present invention and existing Bayesian classification and naive Bayesian model (Naive Bayes, NB), fast text classification algorithm FastText, long short-term memory network (LSTM, Long Short-Term Memory), TextCNN (Bi-directionalRNN), BERT and other crime prediction methods. The experimental results are shown in Table 2 below:
[0192] Table 2
[0193]
[0194]
[0195] It can be seen from Table 2 above that the crime prediction model proposed in the embodiment of the present invention has good performance. Compared with the existing methods, the accuracy and F1 score are improved to a certain extent.
[0196] An auxiliary judgment method based on generative automatic summarization provided by an embodiment of the present invention can comprehensively utilize multiple information such as text and images by utilizing multimodal fusion technology, so that the understanding of the case is more comprehensive and the decision is more accurate. This comprehensive analysis helps judges better grasp the details and background information of the case. By integrating the multimodal fusion of contrast prediction coding and the joint training model of multimodal generation, the system can more effectively learn the correlation between different modalities, thereby improving the intelligence level of the model. By retaining the specific information of each modality, the model can better capture and utilize the independent information provided by each modality. Through generative automatic summarization technology, legal documents can be generated from complex case information, providing judges with tools to quickly understand the case. This text filling technology can effectively reduce the time of reading and understanding a large amount of case texts and improve the work efficiency of judges.
[0197] Based on the same inventive concept, an embodiment of the present invention further provides an auxiliary case judgment system based on generative automatic summarization, the system comprising:
[0198] A data acquisition module is used to: acquire multimodal evidence data and determine the legal automatic abstract format based on the multimodal evidence data;
[0199] The annotation recognition module is used to: annotate the content of the multimodal evidence data and determine the target object in the image data and the target entity in the text data in the multimodal evidence data;
[0200] A feature extraction module is used to: extract features from the multimodal evidence data based on the target object in the image data and the target entity in the text data in the multimodal evidence data, and determine the image features and text features in the multimodal evidence data;
[0201] A modality alignment module is used to: perform a modality alignment operation between the image and the text based on the image features and the text features in the multimodal evidence data, and obtain the image features and the text features after the modality alignment operation in the multimodal evidence data;
[0202] A context vector generation module is used to: fuse the image features and text features after the modal alignment operation in the multimodal evidence data to generate an intramodal visual context vector and an intramodal text context vector;
[0203] The case description text generation module is used to: fuse the modal visual context vector and the intramodal text context vector to generate a vector through the self-attention mechanism, and then generate a case description text that integrates visual and text evidence content;
[0204] The automatic abstract generation module is used to: extract elements based on the generated case description text, and use the extracted elements to fill in the legal automatic abstract format to generate a legal abstract.
[0205] It should be noted that: the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above.
[0206] Based on the same inventive concept, an embodiment of the present invention also provides an auxiliary judgment device based on generative automatic summarization, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the device executes the above-mentioned auxiliary judgment method based on generative automatic summarization.
[0207] The embodiment of the present invention can divide the functional modules of the device according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0208] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, the computer executes any one of the aforementioned generative automatic summarization-based auxiliary case judgment methods.
[0209] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes any one of the aforementioned generative automatic summarization-based auxiliary case judgment methods.
[0210] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for assisting case judgment based on generative automatic summarization. It is characterized in that The following steps are involved: Acquire multimodal evidence data and determine the legal automatic summarization format based on multimodal evidence data; Perform content annotation on multimodal evidence data to determine target objects in image data and target entities in text data in the multimodal evidence data; Based on the target object in the image data and the target entity in the text data in the multimodal evidence data, feature extraction is performed on the multimodal evidence data to determine the image features and text features in the multimodal evidence data; Based on the image features and text features in the multimodal evidence data, a modal alignment operation is performed between the image and the text to obtain the image features and text features after the modal alignment operation in the multimodal evidence data; The image features and text features after the modal alignment operation in the multimodal evidence data are fused to generate an intramodal visual context vector and an intramodal text context vector; The modal visual context vector and the intramodal text context vector are fused to generate a vector through the self-attention mechanism, and then a case description text that integrates visual and textual evidence content is generated; Based on the generated case description text, element extraction is performed, and the extracted elements are used to fill in the legal automatic abstract format to generate a legal abstract.
2. According to claim 1, a method for assisting case judgment based on generative automatic summarization, It is characterized in that Generate an intramodal visual context vector, including: Given local feature vectors representing visual features of all M regions of the input image, a visual global context vector is determined; Given the visual fragment features, organize them in spatial order, and then input them into the gated recurrent unit network GRU in sequence to simulate the spatial position information between them, thereby obtaining a set of hidden state vectors; Perform mean pooling on the obtained hidden state vector to obtain the visual space position vector feature; Obtaining a visual query guidance vector based on the obtained visual global context vector features and visual space position vector features; The attention weight of each image region is calculated by putting the visual feature vector and the visual query guidance vector into the attention function. The attention function uses a two-layer feedforward perceptron FFP followed by a softmax function to ensure that all calculated weights sum to 1. Based on the attention weights of different image regions in the image, an intramodal visual context vector is determined.
3. The method for assisting case judgment based on generative automatic summarization according to claim 2, It is characterized in that Determine the visual global context vector, the calculation formula is: Among them, v (glo) represents the visual global context vector; P (0) Represents a weight matrix; I n represents the local feature vector of the nth region of the input image; tanh represents the activation function; N represents the number of regions of the input image.
4. The method for assisting case judgment based on generative automatic summarization according to claim 3, It is characterized in that Calculate the attention weight of each image area, the corresponding calculation formula is: in and Represents the parameters of the perceptron; represents the hidden state of the visual attention function; e represents element-wise multiplication; represents the attention weight; softmax represents the activation function; v (0) represents the visual query guidance vector.
5. The method for assisting case judgment based on generative automatic summarization according to claim 4, It is characterized in that Determine the intramodal visual context vector, and the corresponding calculation formula is: Among them, v (1) represents the intramodal visual context vector; P (1) Represents a weight matrix.
6. The method for assisting case judgment based on generative automatic summarization according to claim 1, It is characterized in that Generate an intramodal text context vector, including: Given a vector representing the vocabulary text features in a sentence, it is fused to form a global text representation and obtain a global text context vector; Based on the global text context vector, an intramodal text context vector is determined.
7. The method for assisting case judgment based on generative automatic summarization according to claim 1, It is characterized in that Generate case description text that integrates visual and textual evidence content, including: The self-attention mechanism is used to calculate the relationship between the intramodal visual context vector and the intramodal text context vector, and the attention weight between the intramodal visual context vector and the intramodal text context vector is obtained; According to the attention weight, the intramodal visual context vector and the intramodal text context vector are weighted averaged to obtain a fusion vector; The fused vector is positionally encoded and input into the Transformer encoder of the transfer model. The encoder of the transfer model learns the intrinsic relationship of the fused data through self-attention, and the decoder of the transfer model generates text autoregressively according to the output of the Transformer encoder, thereby obtaining a case description text that integrates visual and textual evidence content.
8. The method for assisting case judgment based on generative automatic summarization according to claim 1, It is characterized in that Based on the generated case description text, the RoBERTa model is used for feature extraction. During the feature extraction process, the RoBERTa model is re-pretrained by constructing unsupervised sentence knowledge. By constructing supervised type sentence pair knowledge, the feature description information is obtained, and the POS information is integrated into the word embedding representation of RoBERTa.
9. The method for assisting case judgment based on generative automatic summarization according to claim 1, It is characterized in that The method further includes performing quality enhancement processing on the acquired multimodal evidence data, and the quality enhancement processing step includes: For the image data in the multimodal evidence data, a non-local mean denoising algorithm is used to denoise the image data to obtain denoised image data; Applying an automatic contrast enhancement algorithm to enhance the denoised image data to obtain enhanced image data; The Laplace algorithm is used to perform clarity processing on the enhanced image data, and finally the quality enhanced image data is obtained; For the text data in the multimodal evidence data, text normalization is performed on the text data to obtain the normalized text data; The language model is used to automatically correct spelling errors and grammatical errors in the standardized text data, and finally the text data with enhanced quality is obtained.
10. A case-judgment assistance system based on generative automatic summarization. It is characterized in that include: A data acquisition module is used to: acquire multimodal evidence data and determine the legal automatic abstract format based on the multimodal evidence data; The annotation recognition module is used to: annotate the content of the multimodal evidence data and determine the target object in the image data and the target entity in the text data in the multimodal evidence data; A feature extraction module is used to: extract features from the multimodal evidence data based on the target object in the image data and the target entity in the text data in the multimodal evidence data, and determine the image features and text features in the multimodal evidence data; A modality alignment module is used to: perform a modality alignment operation between the image and the text based on the image features and the text features in the multimodal evidence data, and obtain the image features and the text features after the modality alignment operation in the multimodal evidence data; A context vector generation module is used to: fuse the image features and text features after the modal alignment operation in the multimodal evidence data to generate an intramodal visual context vector and an intramodal text context vector; The case description text generation module is used to: fuse the modal visual context vector and the intramodal text context vector to generate a vector through the self-attention mechanism, and then generate a case description text that integrates visual and text evidence content; The automatic abstract generation module is used to: extract elements based on the generated case description text, and use the extracted elements to fill in the legal automatic abstract format to generate a legal abstract.
Citation Information
Cited By
Library updating, question answering and resource sharing method and device based on large model, and information display method and device
CN119149790A
Large model-based library updating, question answering, resource sharing method, information display method and device
CN119149790B
Medical diagnosis system based on chain reasoning and multi-modal fusion and application thereof
CN119361138A
Image embedding method and system
CN120032378A
