Outline generation method, model training method, equipment and medium
Artificial intelligence technology is used to extract entity and relational texts from legal documents, and the fusion network model and self-attention mechanism are used to generate court trial outlines, which solves the problems of manual outline making that is time-consuming and labor-intensive and prone to omission bias, and achieves rapid development of court trial outlines. , accuracy and fairness are improved.
Patent Information
- Application Number
- CN202410962974.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-18
AI Technical Summary
In the existing technology, the formulation of court trial outlines relies on manual operations, which is time-consuming and labor-intensive, and is prone to omissions or biases, affecting the trial process and results.
Using artificial intelligence technology, by extracting entity text and relationship text in legal documents, using the fusion network model and self-attention mechanism to generate court hearing outlines, analyze the high-order complex relationships between target entities, determine factual claims and legal claims, and capture focus of dispute, generate target focus of dispute text, and finally generate a court hearing outline.
It realizes the rapid and accurate extraction of key information from a large number of legal documents, reduces manual screening time and energy, improves the efficiency and fairness of court trial outlines, and ensures the accuracy of the outlines.
Smart Images

Figure CN118503411B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an outline generation method, a model training method, a device and a medium. Background Art
[0002] In the judicial system, the trial outline is an important tool that plays a vital role for judges, lawyers and other court staff. It not only summarizes the key information of the case, but also provides a structured framework to guide the trial process and help all parties clarify the focus of the dispute.
[0003] At present, the preparation of trial outlines relies on manual operations. In order to prepare a comprehensive and accurate trial outline, it is usually necessary to conduct in-depth reading and analysis of a large number of legal documents to ensure that every piece of information contained in the outline is accurate and critical. However, manual compilation and writing of trial outlines is very time-consuming and labor-intensive. There may be human factors that may lead to omissions or biases, which will have an adverse impact on the trial process and results. Summary of the invention
[0004] The purpose of this application is to provide an outline generation method, a model training method, a device and a medium, aiming to improve the efficiency of generating trial outlines and make the trial outlines fair and accurate.
[0005] The present application provides a method for generating an outline, including:
[0006] Extracting entity text and relationship text from the original legal document; the entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the original legal document;
[0007] By fusing the network model, performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text, and generating corresponding factual claim text and legal claim text;
[0008] Through the dispute focus extraction model, the self-attention weights of the factual claim text and the legal claim text are calculated to obtain the self-attention weights, the dispute focus text is generated according to the self-attention weights, and the dispute focus text is selected according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text;
[0009] The entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text are input into a processing model for generating a trial outline for processing to generate a corresponding trial outline.
[0010] In some embodiments, extracting entity text and relationship text from the original legal document includes:
[0011] Performing word segmentation processing on the original legal document to obtain entity text;
[0012] Use a preset relational sentence to perform semantic matching with the sentence in which the entity text is located, and extract the legal relationship of the target entity based on the result of the semantic matching to obtain a relational text;
[0013] The similarity of each target entity is evaluated according to a pre-similarity principle, the repeated target entities and the legal relations are eliminated according to the result of the similarity evaluation, and the entity text and the relationship text are output according to the result of the elimination.
[0014] In some embodiments, the fusion network model includes a graph neural network and a convolutional neural network;
[0015] The method of performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text by fusing the network model to generate corresponding factual claim text and legal claim text includes:
[0016] Convert the entity text and the relationship text into nodes in vector form;
[0017] In the graph neural network, the node information of the central node is updated by iteratively aggregating the node information of the adjacent nodes, and the node information after multiple updates is used as the node representation to obtain the relationship transfer result;
[0018] In the convolutional neural network, feature extraction is performed on the nodes to obtain local feature representations of the entity text and the relationship text, and maximum pooling is performed on the local feature representations to obtain global feature representations of the entity text and the relationship text as global feature extraction results;
[0019] The relationship transfer result and the global feature extraction result are fused to obtain a fusion result, and the importance score corresponding to each preset factual claim and legal claim is calculated based on the fusion result, and the corresponding factual claim text and legal claim text are generated based on the importance score.
[0020] In some embodiments, the dispute focus extraction model includes an encoder and a decoder;
[0021] The dispute focus extraction model calculates the self-attention weights of the factual claim text and the legal claim text to obtain the self-attention weights, generates the dispute focus text according to the self-attention weights, and selects the dispute focus text according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text, including:
[0022] In the encoder, word embedding processing is performed on the factual claim text and the legal claim text to obtain factual claim coding and legal claim coding, a preset weight matrix is used to perform weighted fitting processing on the factual claim coding and the legal claim coding to obtain factual claim feature vectors and legal claim feature vectors, and the factual claim feature vectors and the legal claim feature vectors are normalized to obtain factual claim probability representations and legal claim probability representations as encoding output information;
[0023] In the decoder, the current encoded output information and the disputed focus text output by the decoder last are used to update the disputed focus text currently output by the decoder, and a correlation evaluation process is performed on the disputed focus text currently output with respect to the factual claim text and the legal claim text, and the target disputed focus text is output based on the result of the correlation evaluation process.
[0024] In some embodiments, the expressions of the factual claim encoding and the legal claim encoding are:
[0025] ,
[0026] ,
[0027] Among them, L vec Encoding legal claims, F vec is the fact claim encoding, L is the legal claim text, F is the fact claim text, and E is the pre-trained word embedding matrix;
[0028] The factual claim probability representation and the legal claim probability representation are:
[0029] ,
[0030] ,
[0031] Among them, O1 and O2 are normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the query weight matrix, W K is the key weight matrix, d k is the dimension of the key, W V is the weight matrix of the values;
[0032] The expression for updating the dispute focus text currently output by the decoder is:
[0033] ,
[0034] Among them, Context t is the current coded output information, which is generated based on O1 and O2. t is the controversial text currently output by the decoder, D t-1 The controversial text output by the decoder last time;
[0035] The expression for evaluating the correlation between the factual claim text and the legal claim text for the currently output dispute focus text is:
[0036] ,
[0037] Among them, R i is the relevance score of the i-th controversial text generated by the decoder, D i The i-th controversial text generated by the decoder.
[0038] In some embodiments, the inputting of the entity text, the relationship text, the factual claim text, the legal claim text, and the target dispute focus text into a processing model for generating a trial outline for processing to generate a corresponding trial outline includes:
[0039] Importing the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into corresponding positions in a preset outline template to generate an outline text;
[0040] Taking the target entity involved in the outline text as a vertex, constructing edges according to the legal relationship, factual claims, legal claims and target dispute focus involved in the outline text, and generating a case information graph;
[0041] Output the outline text and the case information diagram to generate the trial outline.
[0042] The present application also provides a model training method for outline generation, including:
[0043] Extracting entity text and relationship text from the sample file; the entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the sample file;
[0044] Through the first network, performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text to generate corresponding factual claim text and legal claim text;
[0045] Through the second network, the self-attention weights are calculated for the factual claim text and the legal claim text to obtain the self-attention weights, a dispute focus text is generated according to the self-attention weights, and according to the relevance of the dispute focus text to the entity text and the relationship text, the dispute focus text is selected to obtain a target dispute focus text;
[0046] Determine the real factual claim text and the real legal claim text corresponding to the entity text and the relationship text, and determine the real dispute focus text corresponding to the real factual claim text and the real legal claim text;
[0047] Determine first loss information based on the factual claim text and the real factual claim text, and based on the legal claim text and the real legal claim text; the first loss information represents the degree of matching between the factual claim text and the real factual claim text, and between the legal claim text and the real legal claim text;
[0048] Based on the target dispute focus text and the real dispute focus text, second loss information is determined; the second loss information represents the degree of matching between the target dispute focus text and the real dispute focus text;
[0049] Determining total loss information based on the first loss information and the second loss information;
[0050] Based on the gradient descent method, the total loss information is used to update the weight parameters of the first network and the second network. When the total loss information meets the termination condition, a fusion network model and a dispute focus extraction model are obtained.
[0051] In some embodiments, the calculation formula of the first loss information is:
[0052] ,
[0053] The calculation formula of the second loss information is:
[0054] ,
[0055] The calculation formula of the total loss information is:
[0056] ,
[0057] Among them, L FN is the first loss value, yFN Calculate the loss value parameters for the factual claim text and the legal claim text. The loss value calculation parameter L is corresponding to the true factual claim text and the true legal claim text. DFN is the second loss value, y DFN Calculate the loss value parameter corresponding to the target controversial text. is the loss value calculation parameter corresponding to the real controversial text, L total is the total loss value;
[0058] The calculation formula for updating the weight parameters of the first network and the second network using the total loss information is:
[0059] ,
[0060] Among them, W t+1 is the weight parameter obtained by the t+1th update, W t is the weight parameter obtained by the tth update, α is the learning rate, For L total Relative to W t gradient.
[0061] An embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above method when executing the computer program.
[0062] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0063] The beneficial effects of the present application are as follows: entity text containing target entity information and relationship text containing legal relationship information between target entities are extracted from original legal documents, and a fusion network model is used to perform relationship transfer and global feature extraction on the target entities in the entity text and relationship text, so as to analyze the high-order complex relationships between the target entities and determine the factual claims and legal claims to be put forward, thereby generating factual claim text and legal claim text, and then using a dispute focus extraction model based on a self-attention mechanism to determine the correlation between the factual claim text and the legal claim text relative to the dispute focus text, so as to capture the dependency of the generated factual claims and legal claims relative to the preset dispute focus, thereby determining the target dispute focus to be put forward, generating the target dispute focus text, and finally using the entity text, relationship text, factual claim text, legal claim text and target dispute focus text to generate a trial outline, so as to achieve rapid and accurate extraction of key information from huge legal documents, reduce the time and effort of manual screening, improve the efficiency of generating trial outlines, and make the trial outlines fair and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is an optional flowchart of the outline generation method provided in the embodiment of the present application.
[0065] Figure 2 It is a flowchart of the specific method of step S101 provided in an embodiment of the present application.
[0066] Figure 3 It is a flowchart of the specific method of step S102 provided in an embodiment of the present application.
[0067] Figure 4 It is a flowchart of the specific method of step S103 provided in an embodiment of the present application.
[0068] Figure 5 It is a flowchart of the specific method of step S104 provided in an embodiment of the present application.
[0069] Figure 6 It is an optional flowchart of the model training method for outline generation provided in an embodiment of the present application.
[0070] Figure 7 It is an optional structural diagram of the outline generation device provided in the embodiment of the present application.
[0071] Figure 8 It is an optional structural diagram of a model training device for outline generation provided in an embodiment of the present application.
[0072] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0074] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0075] 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 this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0076] First, some nouns involved in this application are analyzed:
[0077] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0078] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0079] Information Extraction: A text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.
[0080] Encoder: Converts the input sequence into a vector of fixed length.
[0081] Cross Entropy: It is an important concept in Shannon information theory, mainly used to measure the difference information between two probability distributions. The performance of language models is usually measured by cross entropy and complexity (perplexity). The meaning of cross entropy is the difficulty of text recognition using the model, or from the perspective of compression, how many bits are used to encode each word on average. The meaning of complexity is the average number of branches that the model uses to represent the text, and its reciprocal can be regarded as the average probability of each word. Smoothing refers to assigning a probability value to the unobserved N-gram combination to ensure that the word sequence can always get a probability value through the language model. Commonly used smoothing techniques include Turing estimation, deletion interpolation smoothing, Katz smoothing and Kneser-Ney smoothing.
[0082] At present, the preparation of trial outlines relies on manual operations. In order to prepare a comprehensive and accurate trial outline, it is usually necessary to conduct in-depth reading and analysis of a large number of legal documents to ensure that every piece of information contained in the outline is accurate and critical. However, manual compilation and writing of trial outlines is very time-consuming and labor-intensive. There may be human factors that may lead to omissions or biases, which will have an adverse impact on the trial process and results.
[0083] Based on this, the embodiments of the present application provide an outline generation method, a training method, a device and a medium, which aim to improve the efficiency of generating a trial outline and make the trial outline fair and accurate.
[0084] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0085] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0086] The outline generation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The outline generation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or can be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN) and cloud servers that provide basic cloud computing services such as big data and artificial intelligence platforms; the software can be an application that implements a text classification method, etc., but is not limited to the above forms.
[0087] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers (Personal Computer, PC), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0088] See also Figure 1 , Figure 1 is an optional flow chart of the outline generation method provided in the embodiment of the present application. In some embodiments of the present application, Figure 1 The method may specifically include but is not limited to steps S101 to S104. Figure 1 These four steps are introduced in detail.
[0089] Step S101, extracting entity text and relationship text from the original legal document.
[0090] The entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the original legal document.
[0091] Step S102, by fusing the network model, performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text, and generating corresponding factual claim text and legal claim text.
[0092] Step S103, through the dispute focus extraction model, the self-attention weights of the factual claim text and the legal claim text are calculated to obtain the self-attention weights, the dispute focus text is generated according to the self-attention weights, and the dispute focus text is selected according to the correlation between the dispute focus text and the entity text and the relationship text to obtain the target dispute focus text.
[0093] Step S104, inputting the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into a processing model for generating a trial outline for processing, thereby generating a corresponding trial outline.
[0094] It can be understood that the original legal document refers to the relevant documents used by the prosecution and the defense during the trial, such as the indictment, the defense, the evidence and the cause of action, etc. The content of the original legal document is related to the trial case, and contains entity text used to describe the target entity and relationship text used to describe the legal relationship between the target entities. Among them, the target entity is the entity related to the case in the original legal document, for example, it can be the subject involved, the request, the cause, the compensation, the penalty, the evidence, the legal clause and / or the case type. The legal relationship between the target entities describes the legal relationship generated by the legal behavior of at least two target entities, for example, it can be a contract signed between target entity A and target entity B, or target entity A sues target entity B.
[0095] In step S101 of some embodiments, the target entity is first extracted from the original legal document through text recognition technology, and the entity text and relationship text are extracted. The original legal document is first segmented, and a dictionary is constructed based on the result of the segmentation processing. The segmented words in the dictionary are labeled using a preset annotation model to obtain segmented words with labels, and the segmented words are identified based on the labels to extract the entity text in the original legal document. For the extracted entity text, a relationship extraction method based on pattern matching is used to determine the legal relationship between the target entities, and a relationship text is constructed based on the extracted legal relationship between the target entities, thereby extracting the entity text in the original legal document.
[0096] In step S102 of some embodiments, a trained fusion network model (Fusion Network, FN) is called to perform a fusion analysis on the legal information about the trial case in the extracted entity text and relationship text, and the legal relationship information of each target entity is transferred to other target entities, and the key feature information of each target entity is extracted and fused to obtain its global feature, so as to perform relationship transfer and global feature extraction on the target entities in the entity text to obtain a fusion analysis result, and then the fusion analysis result is matched with the preset legal claims and factual claims for correlation, and the correlation strength between the fusion analysis result and the preset legal claims and factual claims is determined based on the correlation matching result, and a number of legal claims and factual claims with strong correlation are selected to generate corresponding factual claim texts and legal claim texts.
[0097] In step S103 of some embodiments, a trained focus of dispute extraction model is called, and the generated factual claim text and legal claim text are input into the trained focus of dispute extraction model. In this embodiment, the focus of dispute extraction model is designed based on the transformer architecture, and is specifically used to mine and identify focus of dispute from legal claims and factual claims. Its self-attention mechanism can effectively capture long-distance dependencies in the text, which is particularly useful for legal documents, which are usually complex in structure and have a large amount of information.
[0098] Specifically, in the dispute focus extraction model, the self-attention mechanism is used to extract features of the factual claim text and the legal claim text, that is, the key features of the factual claim text and the legal claim text are downsampled and data enhancement, convolution pooling and linear transformation are performed to obtain sparse feature representations of the factual claim text and the legal claim text, and the downsampled features are obtained. The downsampled features are processed by the multi-head attention mechanism to obtain self-attention weights, and then these self-attention weights are used in combination with the historically generated dispute focuses to generate several currently required dispute focuses, and then the relevance of each currently generated dispute focus relative to the entity text and the relationship text is determined, and quantitative calculations are performed to obtain the relevance score, and several dispute focuses with the highest relevance scores are used as target dispute focuses. Finally, the target dispute focuses are converted into easy-to-read target dispute focus texts, and the target dispute focus texts are output.
[0099] In step S104 of some embodiments, the above-mentioned entity text, relationship text, factual claim text, legal claim text and target dispute focus text are input into a processing model for generating a trial outline for processing. In the processing model, the above-mentioned texts are correspondingly imported into the corresponding positions in the preset outline template to generate a trial outline. Specifically, the associated positions of each text in the outline template are determined according to the type of the text, the associated features of the type of the text and each associated position in the outline template are identified, the type of the text and the associated features of the associated position are matched, and the associated positions of the corresponding texts in the preset outline template are determined, and then the entity text, relationship text, factual claim text, legal claim text and target dispute focus text are respectively inserted into the corresponding associated positions in the outline template. When all texts are inserted, the trial outline can be generated. For example, the associated features of the associated positions in the outline template can be case background, legal claim overview, factual claim overview and / or dispute focus overview, etc. The case background can be inserted into the entity text and relationship text, the legal claim overview can be inserted into the legal claim text, the factual claim overview can be inserted into the factual claim text, and the dispute focus overview can be inserted into the target dispute focus text.
[0100] Steps S101 to S104 shown in the embodiment of the present application extract entity text containing target entity information and relationship text containing legal relationship information between target entities from the original legal document, and use a fusion network model to perform relationship transfer and global feature extraction on the target entities in the entity text and relationship text, so as to analyze the high-order complex relationship between the target entities and determine the factual claims and legal claims to be put forward, and then generate factual claim text and legal claim text, and then use a dispute focus extraction model based on a self-attention mechanism to determine the relevance of the factual claim text and the legal claim text relative to the dispute focus text, so as to capture the dependency of the generated factual claims and legal claims relative to the preset dispute focus, thereby determining the target dispute focus to be put forward, and generating a target dispute focus text, and finally use the entity text, relationship text, factual claim text, legal claim text and target dispute focus text to generate a trial outline, so as to achieve rapid and accurate extraction of key information from huge legal documents, reduce the time and effort of manual screening, improve the efficiency of generating trial outlines, and make the trial outlines fair and accurate.
[0101] See also Figure 2 , Figure 2 is a flowchart of a specific method of step S101 provided in an embodiment of the present application. In some embodiments of the present application, step S101 may specifically include but is not limited to steps S201 to S203. Figure 2 These three steps are introduced in detail.
[0102] Step S201, performing word segmentation processing on the original legal document to obtain entity text.
[0103] Step S202, using a preset relational sentence to perform semantic matching with the sentence in which the entity text is located, and extracting the legal relationship of the target entity based on the result of the semantic matching to obtain a relational text.
[0104] Step S203, evaluating the similarity of each target entity according to a pre-similarity principle, eliminating duplicate target entities and legal relationships according to the result of the similarity evaluation, and outputting the entity text and the relationship text according to the result of the elimination.
[0105] In step S201 of some embodiments, the original legal document is segmented. First, target sentences are selected one by one from the original legal document, and the target sentences are segmented according to their parts of speech to obtain multiple parts of speech of first participles. Then, the target sentences are syntactically analyzed according to the parts of speech of the first participles to obtain multiple second participles, and stop words in the second participles are deleted. Finally, the second participles are screened and re-divided using a pre-built custom dictionary or a segmentation model to obtain multiple entity texts of the original legal document.
[0106] Specifically, the embodiment of the present application can use the Jieba word segmentation tool to perform part-of-speech segmentation on the target sentence. The custom dictionary can be a legal vocabulary captured from the Internet using big data technology or crawler technology. The word segmentation model can be an application conditional random field (CRF) model. The word segmentation model is trained on a dataset in the legal field to mark the target entity in the second word segmentation, such as a person's name, place, time, etc. Suppose the word sequence in the second word segmentation is w1, w2, ..., w n , then the label sequence l1,l2,...,l n .
[0107] In some embodiments, before the original legal document is segmented, it is first standardized to remove formatted content (such as headers, footers, page numbers, etc.) and unnecessary punctuation marks of the original legal document.
[0108] In step S202 of some embodiments, for the identified entity text, the sentence containing the entity text is extracted from the original legal text, and then the preset relationship sentence is semantically matched with the sentence containing the entity text to determine the semantic matching strength between the preset relationship sentence and the sentence containing the entity text. If the semantic matching strength reaches the preset condition, it can be determined that the preset relationship sentence and the sentence containing the entity text both describe the same legal relationship, that is, the legal relationship between entities in the relationship sentence is the same as the legal relationship between target entities in the sentence containing the entity text. Therefore, the legal relationship of the target entity can be extracted through the legal relationship between entities described by the relationship sentence.
[0109] Exemplarily, the preset relationship statements may be "X sues Y" and "X signs a contract with Y", etc., where X and Y are entity placeholders. Then, these relationship statements are used in turn to traverse the statements where the entity text is located, and the relationship statements are semantically matched with the statements where the entity text is located. If the match is successful, for example, when "Zhang San sues Li Si" appears in the text, it can be determined that the relationship between Zhang San and Li Si is "plaintiff-defendant".
[0110] In some embodiments, after obtaining the entity text and the relationship text, a case element table with a unified data structure is constructed. The table may include the following fields:
[0111] Parties involved: clear marking of plaintiff, defendant, third party, etc.;
[0112] Key facts: such as the specific circumstances of the accident and the main terms of the contract;
[0113] Time nodes: clearly mark the key time points of the case;
[0114] Location: clearly mark the location where the event took place;
[0115] Chain of evidence: List all the evidence involved and where it came from.
[0116] Suppose entity text set E={e1,e2,...,e n} and the relational text set R={r1,r2,...,r i ,...,r n}, then the case element table T is T=(e1,r i ,e2)|e1,e2∈E,r i ∈R, represents the legal relationship between target entities e1 and e2.
[0117] In step S203 of some embodiments, for the extracted entity text and relationship text, cosine similarity is used to evaluate the similarity of the entity text, thereby eliminating duplicate entity texts. Duplicate relationship texts are eliminated together with duplicate entity texts. The calculation formula of cosine similarity is:
[0118] ,
[0119] Among them, S 12 is the similarity between e1 and e2, both e1 and e2 are entity texts.
[0120] See also Figure 3 , Figure 3 is a flowchart of a specific method of step S102 provided in an embodiment of the present application. In some embodiments of the present application, step S102 may specifically include but is not limited to steps S301 to S304. Figure 3 These four steps are introduced in detail.
[0121] In this embodiment, the fusion network model includes a graph neural network and a convolutional neural network.
[0122] Step S301: convert the entity text and the relationship text into nodes in vector form.
[0123] Step S302: In the graph neural network, the node information of the central node is updated by iteratively aggregating the node information of adjacent nodes, and the node information after multiple updates is used as the node representation to obtain the relationship transfer result.
[0124] Step S303: In the convolutional neural network, feature extraction is performed on the node to obtain local feature representations of the entity text and the relationship text, and maximum pooling is performed on the local feature representation to obtain global feature representations of the entity text and the relationship text as a global feature extraction result.
[0125] Step S304, fusing the relationship transfer result and the global feature extraction result to obtain a fusion result, calculating the importance score corresponding to each preset factual claim and legal claim based on the fusion result, and generating the corresponding factual claim text and legal claim text based on the importance score.
[0126] In step S301 of some embodiments, a trained embedding vector is assigned to each entity text and relationship text. For example, these vector representations can be initialized by using embedding vectors trained on legal documents using pre-trained models such as Word2Vec or FastText to obtain embedding vectors corresponding to entity texts (e.g., people, places, and time, etc.) and relationship texts (e.g., plaintiff-case and case-evidence, etc.), respectively. Each embedding vector is then represented as a node to obtain a node set.
[0127] In step S302 of some embodiments, the co-occurrence of target entities between entity text and relationship text is represented as edges to obtain an edge set, and a graph of the entity text and relationship text is constructed using the node set and the edge set to obtain an entity-relationship graph. Then, the current embedding vector of the node and the neighbor node information of the node are input into a pre-trained graph neural network, and a layer-by-layer graph convolution operation is performed. The embedding vector of the node is updated in each graph convolution operation, and the embedding vector of the node updated by the last graph convolution operation is used as a node representation to obtain a relationship transfer result.
[0128] In some embodiments, the neighbor node information of a node can be obtained from the adjacency matrix of the entity-relationship graph, and the graph neural network performs a layer-by-layer graph convolution operation on the node, which can be expressed as:
[0129] ,
[0130] Among them, h v (k+1) is the embedding vector of node v in the k+1th layer of the graph neural network, σ is the nonlinear activation function, μ∈N(v), N(v) is the set of adjacent nodes of node v, and W(k) is the weight parameter of the kth layer in the graph neural network.
[0131] In step S303 of some embodiments, the current embedding vector of the node is input into a pre-trained convolutional neural network, and convolution operations are performed layer by layer in the convolution layer. The embedding vector of the node is updated in each convolution operation to gradually extract local features of the entity text and relationship text. The local features of the entity text and relationship text are extracted using the last convolution operation as local feature representations of the extracted entity text and relationship text. The local features of the entity text and relationship text are input into the pooling layer, and maximum pooling processing is performed on the local feature representation. The features of the elements in the local feature representation are selected to extract the maximum value of each area in the local feature representation, strengthen the representation of key features, and then obtain the global feature representation of the entity text and relationship text as the global feature extraction result.
[0132] In step S304 of some embodiments, a fusion result obtained by fusion relationship transfer result and global feature extraction result is input into a fully connected layer, a linear activation function is used to calculate the feature vector of the fusion result, and the nodes corresponding to the fusion result are classified according to the feature vector of the fusion result to determine the category to which the node belongs. Then, the importance score corresponding to each preset factual claim and legal claim is calculated based on the node category. The more consistent the node category or the greater the number of consistent nodes, the higher the importance score. When the importance score reaches a preset screening threshold, the factual claim and / or legal claim is output. After completing the importance scoring of all preset factual claims and legal claims, the output factual claims and legal claims are used to generate factual claim text and legal claim text.
[0133] In some embodiments, generating factual claim text and legal claim text may be to convert the legal relationship between target entities and target entities into a sentence description form to generate corresponding factual claim text or legal claim text. Specifically, for the factual claim text or legal claim text to be generated, the legal relationship between the target entities and target entities contained therein is first determined, and then the legal relationship between these target entities and target entities is converted into a complete sentence description using a templated sentence generation method, and finally the generated sentences are further language processed and optimized to ensure that they are grammatically and semantically correct. For example, if the target entities are "Zhang San" and "Qian Si", and the legal relationship between the target entities is "plaintiff-case", then the generated sentence may be "Zhang San, as the plaintiff, sues Qian Si..."
[0134] See also Figure 4 , Figure 4 is a flowchart of a specific method of step S103 provided in an embodiment of the present application. In some embodiments of the present application, step S103 may specifically include but is not limited to steps S401 to S403. Figure 4 These four steps are introduced in detail.
[0135] In this embodiment, the dispute focus extraction model includes an encoder and a decoder, wherein steps S401 and S402 are performed in the encoder, and steps S403 and S404 are performed in the decoder.
[0136] Step S401, performing word embedding processing on the factual claim text and the legal claim text to obtain a factual claim code and a legal claim code.
[0137] Step S402, use a preset weight matrix to perform weighted fitting processing on the factual claim coding and the legal claim coding to obtain a factual claim feature vector and a legal claim feature vector, normalize the factual claim feature vector and the legal claim feature vector to obtain a factual claim probability representation and a legal claim probability representation as encoding output information.
[0138] Step S403: Use the current encoding output information and the disputed focus text output by the decoder last time to update the disputed focus text currently output by the decoder.
[0139] Step S404, performing a correlation evaluation process on the currently outputted dispute focus text regarding the factual claim text and the legal claim text, and outputting the target dispute focus text based on the result of the correlation evaluation process.
[0140] In step S401 of some embodiments, the expressions of the factual claim code and the legal claim code are:
[0141] ,
[0142] ,
[0143] Among them, L vec Encoding legal claims, F vec is the code for factual claims, L is the legal claim text, F is the factual claim text, E i is the pre-trained word embedding matrix;
[0144] In step S402 of some embodiments, after obtaining the factual claim code and the legal claim code, the factual claim code and the legal claim code are input into an encoder, and the encoder calculates the correlation (or weight) between each factual claim code and legal claim code in the sequence and all other factual claim codes and / or legal claim codes based on a self-attention mechanism. These weights reflect the relationship between each factual claim code and / or legal claim code.
[0145] Specifically, first, the factual claim encoding and the legal claim encoding are weightedly fitted using a preset weight matrix to obtain the feature vectors of the factual claim encoding and the legal claim encoding through linear transformation. The feature vector includes a query vector, a key vector, and a value vector. Then the feature vector is input into the softmax function for normalization, and each element of the feature vector is converted into a probability representation to obtain a normalized vector as a probability representation of the factual claim or legal claim. The sum of each element of the normalized vector is equal to 1. The self-attention mechanism of the encoder is expressed as:
[0146] ,
[0147] ,
[0148] Among them, O1 and O2 are normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the query weight matrix, W K is the key weight matrix, d k is the dimension of the key, W V is the weight matrix of the values.
[0149] In step S403 of some embodiments, the expression of the dispute focus text currently output by the decoder is updated as follows:
[0150] ,
[0151] Among them, Context t is the current encoding output information. The encoder output text information is generated based on O1 and O2. t is the controversial text currently output by the decoder, D t-1 The controversial text that was last output by the decoder.
[0152] In step S404 of some embodiments, the relevance of the currently output dispute focus text relative to the factual claim text and the legal claim text is evaluated, and the relevance degree is quantified as a relevance score value. Then, the generated dispute focus texts are sorted according to the relevance score value to output a sorted dispute focus list, and several dispute focus texts with the highest relevance score values are selected from the dispute focus list in turn, and the selected dispute focus texts are used to generate the target dispute focus text. Among them, the expression for evaluating the relevance of the currently output dispute focus text relative to the factual claim text and the legal claim text is:
[0153] ,
[0154] Among them, R i is the relevance score of the i-th controversial text generated by the decoder, D i The i-th controversial text generated by the decoder.
[0155] See also Figure 5 , Figure 5 is a flowchart of a specific method of step S104 provided in an embodiment of the present application. In some embodiments of the present application, step S104 may specifically include but is not limited to steps S501 to S503. Figure 5 These three steps are introduced in detail.
[0156] Step S501, importing the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into corresponding positions in a preset outline template respectively to generate an outline text.
[0157] Step S502, taking the target entity involved in the outline text as a vertex, constructing edges according to the legal relationship, the factual claims, the legal claims and the target dispute focus involved in the outline text, and generating a case information graph.
[0158] Step S503, output the outline text and the case information diagram to generate the trial outline.
[0159] In some embodiments, the outline template may include case background, legal claim overview, factual claim overview and dispute focus overview, and the entity text and relationship text are inserted into the text filling area corresponding to the case background, the legal claim text is inserted into the text filling area corresponding to the legal claim overview, the factual claim text is inserted into the text filling area corresponding to the factual claim overview, and the target dispute focus text is inserted into the text filling area corresponding to the dispute focus overview, thereby generating an outline text.
[0160] In some embodiments, the target entities involved in the outline text are used as vertices, and the legal relationships, factual claims, legal claims, and target dispute focus involved in the outline text are used as edges connecting the target entities to generate a case information graph, and the case information graph is visualized. For example, if a dispute focus involves a legal provision and specific evidence, there will be an edge between the legal provision and the evidence representing the dispute focus.
[0161] See also Figure 6 , Figure 6 is an optional flow chart of a model training method for outline generation provided in an embodiment of the present application. In some embodiments of the present application, Figure 6 The method may specifically include but is not limited to steps S601 to S608. Figure 6 These eight steps are introduced in detail.
[0162] Step S601: extract entity text and relationship text from a sample file.
[0163] The entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the sample file.
[0164] Step S602: Through the first network, the target entity in the entity text and the relationship text is processed by relationship transfer and global feature extraction to generate corresponding factual claim text and legal claim text.
[0165] Step S603: Through the second network, the self-attention weights of the factual claim text and the legal claim text are calculated to obtain the self-attention weights, and the dispute focus text is generated according to the self-attention weights. According to the relevance of the dispute focus text to the entity text and the relationship text, the dispute focus text is selected to obtain the target dispute focus text.
[0166] Step S604, determining the real factual claim text and the real legal claim text corresponding to the entity text and the relationship text, and determining the real dispute focus text corresponding to the real factual claim text and the real legal claim text.
[0167] Step S605: determining first loss information based on the factual claim text and the true factual claim text, and based on the legal claim text and the true legal claim text.
[0168] Among them, the first loss information represents the degree of matching between the factual claim text and the true factual claim text and between the legal claim text and the true legal claim text.
[0169] Step S606: Determine the second loss information based on the target dispute focus text and the actual dispute focus text.
[0170] Among them, the second loss information represents the degree of matching between the target dispute focus text and the real dispute focus text.
[0171] Step S607: determine total loss information based on the first loss information and the second loss information.
[0172] Step S608, based on the gradient descent method, using the total loss information to update the weight parameters of the first network and the second network, when the total loss information meets the end condition, a fusion network model and a dispute focus extraction model are obtained.
[0173] It can be understood that the sample file is essentially the original legal document. The sample file serves as the training material for the fusion network model and the dispute focus extraction model. The specific process of step S601, step S602 and step S603 is essentially the same as the specific process of the above-mentioned step S101, step S102 and step S103, and will not be repeated here.
[0174] In step S604 of some embodiments, determining the true factual claim text, the true legal claim text and the true dispute focus text may be achieved through manual proofreading or using a trained classification model.
[0175] In steps S605 to S607 of some embodiments, based on the difference between the factual claim text and the true factual claim text, and the difference between the legal claim text and the true legal claim text, the first loss information is calculated by a first minimization loss function, and the first minimization loss function is defined as a cross-entropy loss, which represents the difference between the factual claim text and the true factual claim text, and the difference between the legal claim text and the true legal claim text. Similarly, the second loss information is calculated by a second minimization loss function, and the second minimization loss function is defined as a cross-entropy loss, which represents the difference between the target dispute focus text and the true dispute focus text. Finally, the sum of the first loss information and the second loss information is used as the total loss information. Specifically, the calculation formula for the first loss information is:
[0176] ,
[0177] The calculation formula for the second loss information is:
[0178] ,
[0179] The calculation formula for total loss information is:
[0180] ,
[0181] Among them, L FN is the first loss value, y FN Calculate the loss value parameters for the factual claim text and the legal claim text. The loss value calculation parameter L is corresponding to the true factual claim text and the true legal claim text. DFN is the second loss value, y DFN Calculate the loss value parameter corresponding to the target controversial text. is the loss value calculation parameter corresponding to the real controversial text, L total is the total loss value.
[0182] In step S608 of some embodiments, the total loss information is calculated with respect to the gradient of the weight parameters of the first network and the weight parameters of the second network, and the weight parameters of the first network and the weight parameters of the second network are iteratively updated according to the preset learning rate and the calculated gradient until the model loss information meets the loss condition (the loss value is no longer significantly reduced) or the number of iterations reaches the threshold number, and the training is terminated to obtain a trained fusion network model and a trained dispute focus extraction model. Specifically, the calculation formula for updating the weight parameters of the first network and the second network using the total loss information is:
[0183] ,
[0184] Among them, W t+1 is the weight parameter obtained by the t+1th update, W t is the weight parameter obtained by the tth update, α is the learning rate, For L total Relative to W t gradient.
[0185] See also Figure 7 The embodiment of the present application further provides an outline generation device, which can implement the above outline generation method, and the device includes:
[0186] The first module 701 is used to extract entity text and relationship text from the original legal document; the entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the original legal document;
[0187] The second module 702 is used to perform relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text through a fusion network model to generate corresponding factual claim text and legal claim text;
[0188] The third module 703 is used to calculate the self-attention weights of the factual claim text and the legal claim text through the dispute focus extraction model to obtain the self-attention weights, generate the dispute focus text according to the self-attention weights, and select the dispute focus text according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text;
[0189] The fourth module 704 is used to input the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into the processing model for generating a trial outline for processing, so as to generate a corresponding trial outline.
[0190] The specific implementation of the outline generation device is basically the same as the specific implementation of the above outline generation method, and will not be repeated here.
[0191] See also Figure 8 The embodiment of the present application further provides a model training device for outline generation, which can implement the above-mentioned model training method for outline generation, and the device includes:
[0192] The first training module 801 is used to extract entity text and relationship text from the sample file; the entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the sample file;
[0193] The second training module 802 is used to perform relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text through the first network to generate corresponding factual claim text and legal claim text;
[0194] The third training module 803 is used to calculate the self-attention weights of the factual claim text and the legal claim text through the second network to obtain the self-attention weights, generate the dispute focus text according to the self-attention weights, and select the dispute focus text according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text;
[0195] The fourth training module 804 is used to determine the real factual claim text and the real legal claim text corresponding to the entity text and the relationship text, and determine the real dispute focus text corresponding to the real factual claim text and the real legal claim text;
[0196] A fifth training module 805 is used to determine first loss information based on the factual claim text and the real factual claim text, and based on the legal claim text and the real legal claim text; the first loss information represents the degree of matching between the factual claim text and the real factual claim text, and between the legal claim text and the real legal claim text;
[0197] The sixth training module 806 is used to determine second loss information based on the target dispute focus text and the real dispute focus text; the second loss information represents the matching degree between the target dispute focus text and the real dispute focus text;
[0198] A seventh training module 807, configured to determine total loss information based on the first loss information and the second loss information;
[0199] The eighth training module 808 is used to update the weight parameters of the first network and the second network using the total loss information based on the gradient descent method, and obtain the fusion network model and the dispute focus extraction model when the total loss information meets the termination condition.
[0200] The specific implementation of the model training device for outline generation is basically the same as the specific implementation of the model training method for outline generation mentioned above, and will not be repeated here.
[0201] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.
[0202] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0203] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), a display unit 940, etc.
[0204] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps according to various exemplary embodiments of the present disclosure described in the above method section of this specification. For example, the processing unit 910 can perform the following steps: Figure 1 , Figure 2 , Figure 3 and Figure 4 Follow the steps shown in .
[0205] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .
[0206] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0207] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0208] The electronic device 900 may also communicate with one or more external devices 900' (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 960. The network adapter 960 may communicate with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0209] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above method when executed by a processor.
[0210] The outline generation method, model training method, device and medium provided in the embodiments of the present application extract entity text containing target entity information and relationship text containing legal relationship information between target entities from original legal documents, and use a fusion network model to perform relationship transfer and global feature extraction on the target entities in the entity text and relationship text, so as to analyze the high-order complex relationship between the target entities and determine the factual claims and legal claims to be put forward, and then generate factual claim text and legal claim text, and then use a dispute focus extraction model based on a self-attention mechanism to determine the correlation between the factual claim text and the legal claim text with respect to the dispute focus text, so as to capture the dependency relationship between the generated factual claims and legal claims with respect to the preset dispute focus, thereby determining the target dispute focus to be put forward, and generating the target dispute focus text, and finally use the entity text, relationship text, factual claim text, legal claim text and target dispute focus text to generate a trial outline, so as to realize fast and accurate extraction of key information from huge legal documents, reduce the time and effort of manual screening, improve the efficiency of generating trial outlines, and make the trial outlines fair and accurate.
[0211] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0212] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0213] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0214] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0215] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0216] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0217] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A method for generating an outline, characterized in that: include: Extract entity text and relationship text from original legal documents; The entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the original legal document; By fusing the network model, performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text, and generating corresponding factual claim text and legal claim text; Through the dispute focus extraction model, the self-attention weights of the factual claim text and the legal claim text are calculated to obtain the self-attention weights, the dispute focus text is generated according to the self-attention weights, and the dispute focus text is selected according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text; Inputting the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into a processing model for generating a trial outline for processing, thereby generating a corresponding trial outline; The dispute focus extraction model includes an encoder and a decoder; The dispute focus extraction model calculates the self-attention weights of the factual claim text and the legal claim text to obtain the self-attention weights, generates the dispute focus text according to the self-attention weights, and selects the dispute focus text according to the relevance of the dispute focus text with the entity text and the relationship text to obtain the target dispute focus text, including: In the encoder, word embedding processing is performed on the factual claim text and the legal claim text to obtain factual claim coding and legal claim coding, a preset weight matrix is used to perform weighted fitting processing on the factual claim coding and the legal claim coding to obtain factual claim feature vectors and legal claim feature vectors, and the factual claim feature vectors and the legal claim feature vectors are normalized to obtain factual claim probability representations and legal claim probability representations as encoding output information; In the decoder, the dispute focus text currently output by the decoder is updated using the current encoding output information and the dispute focus text output by the decoder last time, and the dispute focus text currently output is evaluated for the relevance between the factual claim text and the legal claim text, and the target dispute focus text is output based on the result of the relevance evaluation processing; The expressions of the factual claim coding and the legal claim coding are: , , Among them, L vec Encoding legal claims, F vec is the fact claim encoding, L is the legal claim text, F is the fact claim text, and E is the pre-trained word embedding matrix; The factual claim probability representation and the legal claim probability representation are: , , Among them, O1 and O2 are normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the query weight matrix, W K is the key weight matrix, d k is the dimension of the key, W V is the weight matrix of the values; The expression for updating the controversial focus text currently output by the decoder is: , Among them, Context t is the current coded output information, which is generated based on O1 and O2. t is the controversial text currently output by the decoder, D t-1 The controversial text output by the decoder last time; The expression for evaluating the correlation between the factual claim text and the legal claim text for the currently output dispute focus text is: , Among them, R i is the relevance score of the i-th controversial text generated by the decoder, D i The i-th controversial text generated by the decoder.
2. The outline generation method according to claim 1, characterized in that: The extracting of entity text and relationship text in the original legal document includes: Performing word segmentation processing on the original legal document to obtain entity text; Use a preset relational sentence to perform semantic matching with the sentence in which the entity text is located, and extract the legal relationship of the target entity based on the result of the semantic matching to obtain a relational text; The similarity of each target entity is evaluated according to a pre-similarity principle, the repeated target entities and the legal relations are eliminated according to the result of the similarity evaluation, and the entity text and the relationship text are output according to the result of the elimination.
3. The outline generation method according to claim 1, characterized in that: The fusion network model includes a graph neural network and a convolutional neural network; The method of performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text by fusing the network model to generate corresponding factual claim text and legal claim text includes: Convert the entity text and the relationship text into nodes in vector form; In the graph neural network, the node information of the central node is updated by iteratively aggregating the node information of the adjacent nodes, and the node information after multiple updates is used as the node representation to obtain the relationship transfer result; In the convolutional neural network, feature extraction is performed on the nodes to obtain local feature representations of the entity text and the relationship text, and maximum pooling is performed on the local feature representations to obtain global feature representations of the entity text and the relationship text as global feature extraction results; The relationship transfer result and the global feature extraction result are fused to obtain a fusion result, and the importance score corresponding to each preset factual claim and legal claim is calculated based on the fusion result, and the corresponding factual claim text and legal claim text are generated based on the importance score.
4. The outline generation method according to claim 1, characterized in that: The inputting of the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into a processing model for generating a trial outline for processing to generate a corresponding trial outline includes: Importing the entity text, the relationship text, the factual claim text, the legal claim text and the target dispute focus text into corresponding positions in a preset outline template to generate an outline text; Taking the target entity involved in the outline text as a vertex, constructing edges according to the legal relationship, factual claims, legal claims and target dispute focus involved in the outline text, and generating a case information graph; Output the outline text and the case information diagram to generate the trial outline.
5. A model training method for outline generation, characterized in that: include: Extract entity text and relationship text from sample files; The entity text contains information about the target entity, the relationship text contains information about the legal relationship between the target entities, and the target entity is an entity related to the case in the sample file; Through the first network, performing relationship transfer and global feature extraction processing on the target entity in the entity text and the relationship text to generate corresponding factual claim text and legal claim text; Through the second network, the self-attention weights are calculated for the factual claim text and the legal claim text to obtain the self-attention weights, a dispute focus text is generated according to the self-attention weights, and according to the relevance of the dispute focus text to the entity text and the relationship text, the dispute focus text is selected to obtain a target dispute focus text; Determine the real factual claim text and the real legal claim text corresponding to the entity text and the relationship text, and determine the real dispute focus text corresponding to the real factual claim text and the real legal claim text; Determining first loss information based on the factual claim text and the true factual claim text, and based on the legal claim text and the true legal claim text; The first loss information represents the matching degree between the factual claim text and the real factual claim text and between the legal claim text and the real legal claim text; Determining second loss information based on the target dispute focus text and the real dispute focus text; The second loss information represents the matching degree between the target dispute focus text and the real dispute focus text; Determining total loss information based on the first loss information and the second loss information; Based on the gradient descent method, the weight parameters of the first network and the second network are updated using the total loss information, and when the total loss information meets the termination condition, a fusion network model and a dispute focus extraction model are obtained; The second network includes an encoder and a decoder; The method of calculating the self-attention weights of the factual claim text and the legal claim text through the second network to obtain the self-attention weights, generating the dispute focus text according to the self-attention weights, and selecting the dispute focus text according to the relevance of the dispute focus text to the entity text and the relationship text to obtain the target dispute focus text includes: In the encoder, word embedding processing is performed on the factual claim text and the legal claim text to obtain factual claim coding and legal claim coding, a preset weight matrix is used to perform weighted fitting processing on the factual claim coding and the legal claim coding to obtain factual claim feature vectors and legal claim feature vectors, and the factual claim feature vectors and the legal claim feature vectors are normalized to obtain factual claim probability representations and legal claim probability representations as encoding output information; In the decoder, the dispute focus text currently output by the decoder is updated using the current encoding output information and the dispute focus text output by the decoder last time, and the dispute focus text currently output is evaluated for the relevance between the factual claim text and the legal claim text, and the target dispute focus text is output based on the result of the relevance evaluation processing; The expressions of the factual claim coding and the legal claim coding are: , , Among them, L vec Encoding legal claims, F vec is the fact claim encoding, L is the legal claim text, F is the fact claim text, and E is the pre-trained word embedding matrix; The factual claim probability representation and the legal claim probability representation are: , , Among them, O1 and O2 are normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the query weight matrix, W K is the key weight matrix, d k is the dimension of the key, W V is the weight matrix of the values; The expression for updating the controversial focus text currently output by the decoder is: , Among them, Context t is the current coded output information, which is generated based on O1 and O2. t is the controversial text currently output by the decoder, D t-1 The controversial text output by the decoder last time; The expression for evaluating the correlation between the factual claim text and the legal claim text for the currently output dispute focus text is: , Among them, R i is the relevance score of the i-th controversial text generated by the decoder, D i The i-th controversial text generated by the decoder.
6. The model training method for syllabus generation according to claim 5, characterized in that: The calculation formula of the first loss information is: , The calculation formula of the second loss information is: , The calculation formula of the total loss information is: , Among them, L FN is the first loss value, y FN Calculate the loss value parameters for the factual claim text and the legal claim text. The loss value calculation parameter L is corresponding to the true factual claim text and the true legal claim text. DFN is the second loss value, y DFN Calculate the loss value parameter corresponding to the target controversial text. is the loss value calculation parameter corresponding to the real controversial text, L total is the total loss value; The calculation formula for updating the weight parameters of the first network and the second network using the total loss information is: , Among them, W t+1 is the weight parameter obtained by the t+1th update, W t is the weight parameter obtained by the tth update, α is the learning rate, For L total Relative to W t gradient.
7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
