CN118503411B - Outline generation method, model training method, device and medium - Google Patents
Outline generation method, model training method, device and medium Download PDFInfo
- Publication number
- CN118503411B CN118503411B CN202410962974.1A CN202410962974A CN118503411B CN 118503411 B CN118503411 B CN 118503411B CN 202410962974 A CN202410962974 A CN 202410962974A CN 118503411 B CN118503411 B CN 118503411B
- Authority
- CN
- China
- Prior art keywords
- text
- legal
- factual
- entity
- relationship
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000012549 training Methods 0.000 title claims abstract description 26
- 238000000605 extraction Methods 0.000 claims abstract description 58
- 238000012545 processing Methods 0.000 claims abstract description 56
- 230000004927 fusion Effects 0.000 claims abstract description 31
- 238000012546 transfer Methods 0.000 claims abstract description 23
- 239000013598 vector Substances 0.000 claims description 46
- 238000004364 calculation method Methods 0.000 claims description 26
- 239000011159 matrix material Substances 0.000 claims description 22
- 230000014509 gene expression Effects 0.000 claims description 12
- 230000011218 segmentation Effects 0.000 claims description 12
- 238000013528 artificial neural network Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 10
- 238000013527 convolutional neural network Methods 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 7
- 238000011176 pooling Methods 0.000 claims description 6
- 238000011156 evaluation Methods 0.000 claims description 5
- 238000011478 gradient descent method Methods 0.000 claims description 4
- 230000004931 aggregating effect Effects 0.000 claims description 3
- 230000008030 elimination Effects 0.000 claims description 3
- 238000003379 elimination reaction Methods 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 19
- 238000013473 artificial intelligence Methods 0.000 abstract description 15
- 238000004458 analytical method Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000007246 mechanism Effects 0.000 description 8
- 238000003058 natural language processing Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000009499 grossing Methods 0.000 description 5
- 238000012854 evaluation process Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012216 screening Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 2
- 230000007123 defense Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000002360 preparation method Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000001915 proofreading effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/34—Browsing; Visualisation therefor
- G06F16/345—Summarisation for human users
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/042—Knowledge-based neural networks; Logical representations of neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/18—Legal services
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- Business, Economics & Management (AREA)
- Tourism & Hospitality (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Human Resources & Organizations (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Economics (AREA)
- Databases & Information Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本申请涉及人工智能技术领域,公开一种提纲生成方法、模型训练方法、设备及介质。提纲生成方法包括:提取原始法律文件中的实体文本和关系文本;通过融合网络模型,对目标实体进行关系传递和全局特征提取处理,生成事实主张文本和法律主张文本;将事实主张文本和法律主张文本输入争议焦点提取模型,以生成争议焦点文本,依据争议焦点文本与实体文本和关系文本的相关性,对争议焦点文本中进行选取,得到目标争议焦点文本;将实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,生成庭审提纲。本申请实施例可以提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。
The present application relates to the field of artificial intelligence technology, and discloses an outline generation method, a model training method, a device and a medium. The outline generation method includes: extracting entity text and relationship text from the original legal document; performing relationship transfer and global feature extraction processing on the target entity through a fusion network model to generate a factual claim text and a legal claim text; inputting the factual claim text and the legal claim text into a dispute focus extraction model to generate a dispute focus text, and selecting the dispute focus text based on the correlation between the dispute focus text and the entity text and the relationship text to obtain a target dispute focus text; inputting the entity text, relationship text, factual claim text, legal claim text and target dispute focus text into a processing model for generating a trial outline for processing to generate a trial outline. The embodiments of the present application can improve the efficiency of generating a trial outline, so that the trial outline is fair and accurate.
Description
技术领域Technical Field
本申请涉及人工智能技术领域,尤其是一种提纲生成方法、模型训练方法、设备及介质。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
在司法系统中,庭审提纲作为一个重要的工具,对于法官、律师和其他法庭工作人员来说,都有着至关重要的作用,它不仅总结了案件的关键信息,还提供了一个结构化的框架,用于引导庭审过程和帮助各方明确争议焦点。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.
目前,庭审提纲的制定依赖人工操作,为制定一个全面且准确的庭审提纲,通常需要对大量法律文件进行深入的阅读和分析,确保提纲中包含的每一项信息都是准确且关键的,然而,人工整理和书写庭审提纲十分耗时耗力,可能存在人为因素可能导致疏漏或偏见,对庭审过程和结果产生不利影响。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. Human factors may cause omissions or biases, which may have an adverse impact on the trial process and results.
发明内容Summary of the invention
本申请的目的是提供一种提纲生成方法、模型训练方法、设备及介质,旨在提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。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.
本申请实施例提供一种提纲生成方法,包括:The present application provides a method for generating an outline, including:
提取原始法律文件中的实体文本和关系文本;所述实体文本包含目标实体的信息,所述关系文本包含所述目标实体之间的法律关系的信息,所述目标实体为所述原始法律文件中与案件相关的实体;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;
通过融合网络模型,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本;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;
将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,生成对应的庭审提纲。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.
在一些实施例中,所述提取原始法律文件中的实体文本和关系文本,包括:In some embodiments, extracting entity text and relationship text from 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.
在一些实施例中,所述融合网络模型包含图神经网络和卷积神经网络;In some embodiments, 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.
在一些实施例中,所述争议焦点提取模型包括编码器和解码器;In some embodiments, 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 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.
在一些实施例中,所述事实主张编码和所述法律主张编码的表达式为:In some embodiments, the expressions of the factual claim encoding and the legal claim encoding are:
, ,
, ,
其中,Lvec为法律主张编码,Fvec为事实主张编码,L为法律主张文本,F为事实主张文本,E为预训练的词嵌入矩阵;Where L vec is the legal claim encoding, F vec is the factual claim encoding, L is the legal claim text, F is the factual claim text, and E is the pre-trained word embedding matrix;
所述事实主张概率表示和所述法律主张概率表示为:The factual claim probability representation and the legal claim probability representation are:
, ,
, ,
其中,O1和O2均为归一化向量,分别作为事实主张概率表示和法律主张概率表示,WQ为查询的权重矩阵,WK为键的权重矩阵,dk为键的维度,WV为值的权重矩阵;Among them, O 1 and O 2 are both normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the weight matrix of the query, W K is the weight matrix of the key, d k is the dimension of the key, and W V is the weight matrix of the value;
所述更新所述解码器当前输出的所述争议焦点文本的表达式为:The expression for updating the dispute focus text currently output by the decoder is:
, ,
其中,Contextt为当前的编码输出信息,编码输出信息依据O1和O2生成,Dt为解码器当前输出的争议焦点文本,Dt-1为解码器上一次输出的争议焦点文本;Wherein, Context t is the current coded output information, which is generated based on O 1 and O 2 , D t is the dispute focus text currently output by the decoder, and D t-1 is the dispute focus 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:
, ,
其中,Ri为解码器生成的第i个争议焦点文本的相关性评分值,Di为解码器生成的第i个争议焦点文本。Among them, Ri is the relevance score value of the i-th controversial focus text generated by the decoder, and Di is the i-th controversial focus text generated by the decoder.
在一些实施例中,所述将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,生成对应的庭审提纲,包括: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:
将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本分别导入至预设的提纲模板中相应的位置,生成提纲文本;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 graph to generate the trial outline.
本申请实施例还提供一种用于提纲生成的模型训练方法,包括:The present application also provides a model training method for outline generation, including:
提取样本文件中的实体文本和关系文本;所述实体文本包含目标实体的信息,所述关系文本包含所述目标实体之间的法律关系的信息,所述目标实体为所述样本文件中与案件相关的实体;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;
通过第一网络,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本;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;
基于所述事实主张文本和所述真实事实主张文本,以及基于所述法律主张文本和所述真实法律主张文本,确定第一损失信息;所述第一损失信息表征所述事实主张文本和所述真实事实主张文本之间以及所述法律主张文本和所述真实法律主张文本之间的匹配程度;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;
基于所述目标争议焦点文本和所述真实争议焦点文本,确定第二损失信息;所述第二损失信息表征所述目标争议焦点文本和所述真实争议焦点文本之间的匹配程度;Determining second loss information based on the target dispute focus text and the real dispute focus text; the second loss information represents the degree of matching 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 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.
在一些实施例中,所述第一损失信息的计算式为:In some embodiments, 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:
, ,
其中,LFN为第一损失值,yFN为事实主张文本和法律主张文本对应的损失值计算参数,为真实事实主张文本和真实法律主张文本对应的损失值计算参数,LDFN为第二损失值,yDFN为目标争议焦点文本对应的损失值计算参数,为真实争议焦点文本对应的损失值计算参数,Ltotal为总损失值;Among them, L FN is the first loss value, y FN is the loss value calculation parameter corresponding to the factual claim text and the legal claim text, is the loss value calculation parameter corresponding to the true factual claim text and the true legal claim text, L DFN is the second loss value, y DFN is the loss value calculation parameter corresponding to the target dispute focus text, is the loss value calculation parameter corresponding to the real controversial text, and 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:
, ,
其中,Wt+1为第t+1次更新得到的权重参数,Wt为第t次更新得到的权重参数,α为学习率,为Ltotal相对于Wt的梯度。Among them, Wt+1 is the weight parameter obtained by the t+1th update, Wt is the weight parameter obtained by the tth update, α is the learning rate, is the gradient of L total relative to W t .
本申请实施例还提供一种电子设备,所述电子设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述的方法。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.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述的方法。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.
本申请的有益效果:从原始法律文件中提取包含目标实体信息的实体文本和包含目标实体之间的法律关系信息的关系文本,使用融合网络模型对实体文本和关系文本中的目标实体进行关系传递和全局特征提取,可以分析目标实体之间的高阶复杂关系并确定所要提出的事实主张和法律主张,进而生成事实主张文本和法律主张文本,然后使用基于自注意力机制的争议焦点提取模型确定事实主张文本和法律主张文本相对于争议焦点文本的相关性,以捕捉所生成的事实主张和法律主张相对于预设争议焦点的依赖关系,从而确定所要提出的目标争议焦点,生成目标争议焦点文本,最后使用实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本生成庭审提纲,实现从庞大的法律文件中快速、准确提取关键信息,减少人工筛查的时间和精力,提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。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 that the high-order complex relationship between the target entities can be analyzed and the factual claims and legal claims to be put forward can be determined, 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
图1是本申请实施例提供的提纲生成方法的一个可选的流程图。FIG1 is an optional flowchart of the outline generation method provided in an embodiment of the present application.
图2是本申请实施例提供的步骤S101的具体方法的流程图。FIG. 2 is a flowchart of a specific method of step S101 provided in an embodiment of the present application.
图3是本申请实施例提供的步骤S102的具体方法的流程图。FIG. 3 is a flowchart of a specific method of step S102 provided in an embodiment of the present application.
图4是本申请实施例提供的步骤S103的具体方法的流程图。FIG. 4 is a flowchart of a specific method of step S103 provided in an embodiment of the present application.
图5是本申请实施例提供的步骤S104的具体方法的流程图。FIG. 5 is a flowchart of a specific method of step S104 provided in an embodiment of the present application.
图6是本申请实施例提供的用于提纲生成的模型训练方法的一个可选的流程图。FIG6 is an optional flowchart of a model training method for outline generation provided in an embodiment of the present application.
图7是本申请实施例提供的提纲生成装置的一个可选的结构示意图。FIG. 7 is a schematic diagram of an optional structure of an outline generating device provided in an embodiment of the present application.
图8是本申请实施例提供的用于提纲生成的模型训练装置的一个可选的结构示意图。FIG8 is an optional structural diagram of a model training device for outline generation provided in an embodiment of the present application.
图9是本申请实施例提供的电子设备的硬件结构示意图。FIG. 9 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。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.
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。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.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。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.
首先,对本申请中涉及的若干名词进行解析:First, some nouns involved in this application are analyzed:
人工智能(artificialintelligence,AI):是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学;人工智能是计算机科学的一个分支,人工智能企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器,该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。人工智能可以对人的意识、思维的信息过程的模拟。人工智能还是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。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.
自然语言处理(naturallanguageprocessing,NLP):NLP用计算机来处理、理解以及运用人类语言(如中文、英文等),NLP属于人工智能的一个分支,是计算机科学与语言学的交叉学科,又常被称为计算语言学。自然语言处理包括语法分析、语义分析、篇章理解等。自然语言处理常用于机器翻译、手写体和印刷体字符识别、语音识别及文语转换、信息意图识别、信息抽取与过滤、文本分类与聚类、舆情分析和观点挖掘等技术领域,它涉及与语言处理相关的数据挖掘、机器学习、知识获取、知识工程、人工智能研究和与语言计算相关的语言学研究等。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.
信息抽取(InformationExtraction):从自然语言文本中抽取指定类型的实体、关系、事件等事实信息,并形成结构化数据输出的文本处理技术。信息抽取是从文本数据中抽取特定信息的一种技术。文本数据是由一些具体的单位构成的,例如句子、段落、篇章,文本信息正是由一些小的具体的单位构成的,例如字、词、词组、句子、段落或是这些具体的单位的组合。抽取文本数据中的名词短语、人名、地名等都是文本信息抽取,当然,文本信息抽取技术所抽取的信息可以是各种类型的信息。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.
编码(encoder):将输入序列转化成一个固定长度的向量。Encoder: Converts the input sequence into a vector of fixed length.
交叉熵(CrossEntropy):是Shannon信息论中一个重要概念,主要用于度量两个概率分布间的差异性信息。语言模型的性能通常用交叉熵和复杂度(perplexity)来衡量。交叉熵的意义是用该模型对文本识别的难度,或者从压缩的角度来看,每个词平均要用几个位来编码。复杂度的意义是用该模型表示这一文本平均的分支数,其倒数可视为每个词的平均概率。平滑是指对没观察到的N元组合赋予一个概率值,以保证词序列总能通过语言模型得到一个概率值。通常使用的平滑技术有图灵估计、删除插值平滑、Katz平滑和Kneser-Ney平滑。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.
目前,庭审提纲的制定依赖人工操作,为制定一个全面且准确的庭审提纲,通常需要对大量法律文件进行深入的阅读和分析,确保提纲中包含的每一项信息都是准确且关键的,然而,人工整理和书写庭审提纲十分耗时耗力,可能存在人为因素可能导致疏漏或偏见,对庭审过程和结果产生不利影响。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. Human factors may cause omissions or biases, which may have an adverse impact on the trial process and results.
基于此,本申请实施例提供一种提纲生成方法、训练方法、设备及介质,旨在提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。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.
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(ArtificialIntelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。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.
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
本申请实施例提供的提纲生成方法,涉及人工智能技术领域。本申请实施例提供的提纲生成方法可应用于终端中,也可应用于服务器端中,还可以是运行于终端或服务器端中的软件。在一些实施例中,终端可以是智能手机、平板电脑、笔记本电脑、台式计算机等;服务器端可以配置成独立的物理服务器,也可以配置成多个物理服务器构成的服务器集群或者分布式系统,还可以配置成提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(ContentDeliveryNetwork,CDN)以及大数据和人工智能平台等基础云计算服务的云服务器;软件可以是实现文本分类方法的应用等,但并不局限于以上形式。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.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络个人计算机(PersonalComputer,PC)、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。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 electronic devices, 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.
请参阅图1,图1是本申请实施例提供的提纲生成方法的一个可选的流程图。在本申请的一些实施例中,图1中的方法具体可以包括但不限于步骤S101至步骤S104,下面结合图1对这四个步骤进行详细介绍。Please refer to Figure 1, which 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, the method in Figure 1 may specifically include but is not limited to steps S101 to S104, and these four steps are described in detail below in conjunction with Figure 1.
步骤S101,提取原始法律文件中的实体文本和关系文本。Step S101, 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.
步骤S102,通过融合网络模型,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本。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.
步骤S103,通过争议焦点提取模型,对所述事实主张文本和所述法律主张文本进行自注意力权重计算,得到自注意力权重,依据所述自注意力权重生成争议焦点文本,依据所述争议焦点文本与所述实体文本和所述关系文本的相关性,对所述争议焦点文本中进行选取,得到目标争议焦点文本。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 relevance of the dispute focus text to the entity text and the relationship text to obtain the target dispute focus text.
步骤S104,将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,生成对应的庭审提纲。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.
可以理解的是,原始法律文件是指庭审过程中控辩双方所使用到的相关文书,例如起诉状、答辩状、证据和案由等,原始法律文件的内容与庭审案件相关,包含用于描述目标实体的实体文本和用于描述目标实体之间的法律关系的关系文本。其中,目标实体是原始法律文件中与案件相关的实体,例如,可以是涉事主体、请求事项、事由、赔偿事项、处罚事项、证据、法律条款和/或案件类型,目标实体之间的法律关系描述至少两个目标实体的法律行为所产生的法律关系,例如,可以是目标实体A与目标实体B签订合同,或者是目标实体A起诉目标实体B。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 acts 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.
在一些实施例的步骤S101中,首先是通过文本识别技术从原始法律文件中提取目标实体,提取实体文本和关系文本,首先是对原始法律文件进行分词处理,依据分词处理的结果构建词典,使用预设的标注模型对词典中的分词进行标注,得到带有标签的分词,依据该标签来对分词进行识别,从而提取出原始法律文件中的实体文本,对于提取出的实体文本,采用基于模式匹配的关系抽取方法来确定目标实体之间的法律关系,依据抽取得到目标实体之间的法律关系构建关系文本,从而提取出原始法律文件中的实体文本。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.
在一些实施例的步骤S102中,调用训练好的融合网络模型(Fusion Network,FN),对提取得到的实体文本和关系文本中关于庭审案件的法律信息进行融合分析,通过对每个目标实体的法律关系信息传递至其他目标实体,以及对每个目标实体的关键特征信息进行提取并融合得到其全局特征,以对实体文本中的目标实体进行关系传递和全局特征提取,得到融合分析结果,再将融合分析结果与预设的法律主张和事实主张进行相关性匹配,依据相关性匹配结果确定融合分析结果与预设的法律主张和事实主张的相关性强度,选取相关性较强的若干个法律主张和事实主张,从而生成相应的事实主张文本和法律主张文本。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.
在一些实施例的步骤S103中,调用训练好的争议焦点提取模型,将生成的事实主张文本和法律主张文本输入至训练好的争议焦点提取模型,本实施例中,争议焦点提取模型是基于变换器架构(Transformer)设计的,专门用于从法律主张和事实主张中挖掘和识别争议焦点,其自注意机制(Self-Attention Mechanism),能够有效捕获文本中的长距离依赖关系,对于法律文档这种通常结构复杂、信息量大的文档尤为有用。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.
具体而言,在争议焦点提取模型中,通过自注意力机制对事实主张文本和法律主张文本进行特征抽取,也即对事实主张文本和法律主张文本的关键特征进行下采样以及进行数据增强、卷积池化以及线性变换,以获取事实主张文本和法律主张文本的稀疏特征表示,得到下采样特征,通过多头注意力机制对下采样特征进行注意力处理,得到自注意力权重,然后使用这些自注意力权重以及结合历史生成的争议焦点生成若干个当前所需的争议焦点,再确定当前生成的各个争议焦点相对实体文本和关系文本的相关性,量化计算以得到相关性评分,以相关性评分最高的若干个争议焦点作为目标争议焦点,最后将目标争议焦点转换为易于阅读的目标争议焦点文本,输出目标争议焦点文本。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.
在一些实施例的步骤S104中,将上述的实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,在处理模型中,上述文本对应导入至预设的提纲模板中相应的位置,以生成庭审提纲。具体而言,依据文本的类型确定各个文本在提纲模板中的关联位置,识别文本的类型和提纲模板中各个关联位置的关联特征,将文本的类型和关联位置的关联特征进行匹配,确定对应的文本在预设的提纲模板中的关联位置,进而将实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本分别插入至提纲模板中对应的关联位置,全部文本插入完成时,即可生成庭审提纲告。例如,提纲模板中关联位置的关联特征可以是案件背景、法律主张概述、事实主张概述和/或争议焦点概述等,案件背景可以是插入实体文本和关系文本,法律主张概述可以是插入法律主张文本,事实主张概述可以是插入事实主张文本,争议焦点概述可以是插入目标争议焦点文本。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.
本申请实施例所示意的步骤S101至步骤S104,从原始法律文件中提取包含目标实体信息的实体文本和包含目标实体之间的法律关系信息的关系文本,使用融合网络模型对实体文本和关系文本中的目标实体进行关系传递和全局特征提取,可以分析目标实体之间的高阶复杂关系并确定所要提出的事实主张和法律主张,进而生成事实主张文本和法律主张文本,然后使用基于自注意力机制的争议焦点提取模型确定事实主张文本和法律主张文本相对于争议焦点文本的相关性,以捕捉所生成的事实主张和法律主张相对于预设争议焦点的依赖关系,从而确定所要提出的目标争议焦点,生成目标争议焦点文本,最后使用实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本生成庭审提纲,实现从庞大的法律文件中快速、准确提取关键信息,减少人工筛查的时间和精力,提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。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.
请参阅图2,图2是本申请实施例提供的步骤S101的具体方法的流程图。在本申请的一些实施例中,步骤S101具体可以包括但不限于步骤S201至步骤S203,下面结合图2对这三个步骤进行详细介绍。Please refer to Figure 2, which 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, and these three steps are described in detail below in conjunction with Figure 2.
步骤S201,对所述原始法律文件进行分词处理,得到实体文本。Step S201, performing word segmentation processing on the original legal document to obtain entity text.
步骤S202,使用预设的关系语句与所述实体文本所处的语句进行语义匹配,依据语义匹配的结果对所述目标实体进行法律关系抽取,得到关系文本。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.
步骤S203,依据预先相似度原理评估各所述目标实体的相似度,依据相似度评估的结果消除重复的所述目标实体和所述法律关系,依据消除的结果输出所述实体文本和所述关系文本。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.
在一些实施例的步骤S201中,对原始法律文件进行分词处理,首先是从原始法律文件中逐个选取目标语句,对目标语句进行词性分词,得到多个第一分词的词性,然后根据第一分词的词性对目标语句进行句法分析,得到多个第二分词,并删除第二分词中的停用词,最后利用预构建的自定义词典或者是分词模型对第二分词进行筛选及重新划分,得到原始法律文件的多个实体文本。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.
具体地,本申请实施例可以采用jieba分词工具对目标语句进行词性分词,自定义词典可以为利用大数据技术或爬虫技术等从网络上抓取的法律词汇,分词模型可以是应用条件随机场(CRF)模型,分词模型训练在法律领域的数据集上,以标注第二分词中的目标实体,如人名、地点、时间等,设第二分词中的词序列为w1,w2,...,wn,则分词模型输出的标签序列l1,l2,...,ln。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 entities in the second word segmentation, such as names, places, times, etc. Suppose the word sequence in the second word segmentation is w1 , w2 , ..., wn , then the label sequence output by the word segmentation model is l1 , l2 , ..., ln .
在一些实施例中,对原始法律文件进行分词处理之前,首先对原始法律文件进行标准化处理,去除原始法律文件的格式化内容(如页眉、页脚、页码等)及不必要的标点符号。In some embodiments, before the original legal document is segmented, the original legal document is first standardized to remove formatted content (such as headers, footers, page numbers, etc.) and unnecessary punctuation marks of the original legal document.
在一些实施例的步骤S202中,对于识别得到的实体文本,从原始法律文本中提取实体文本所处的语句,再将预设的关系语句与实体文本所处的语句进行语义匹配,以确定预设的关系语句与实体文本所处的语句的语义匹配强度,若语义匹配强度达到预设条件,则可以确定该预设的关系语句与实体文本所处的语句均是描述同一法律关系,即关系语句中实体之间的法律关系与实体文本所处的语句中目标实体之间的法律关系相同,由此,可以通过关系语句所描述实体之间的法律关系来实现对目标实体的法律关系抽取。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.
示例性地,预设的关系语句可以是“X起诉Y”和“X与Y签订合同”等,其中,X和Y为实体占位符,然后,依次使用这些关系语句遍历实体文本所处的语句,将关系语句与实体文本所处的语句进行语义匹配,若匹配成功,例如,当文本中出现“张三起诉李四”时,可以确定张三和李四之间的关系为“原告-被告”。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".
在一些实施例中,得到实体文本和关系文本之后,构建一个统一的数据结构的案件元素表,该表格可以是包括以下字段: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:
涉及方:原告、被告、第三方等的明确标注;Parties involved: clear marking of plaintiff, defendant, third party, etc.;
关键事实:如事故发生的具体情况、合同的主要条款;Key facts: such as the specific circumstances of the accident and the main terms of the contract;
时间节点:明确标注案件的关键时间点;Time nodes: clearly mark the key time points of the case;
地点:明确标注事件发生的地点;Location: clearly mark the location where the event took place;
证据链:列出涉及的所有证据及其来源。Chain of evidence: List all the evidence involved and where it came from.
设有实体文本集E={e1,e2,...,en}和关系文本集R={r1,r2,...,ri,...,rn},则案件元素表T为T=(e1,ri,e2)|e1,e2∈E,ri∈R,表示目标实体e1与e2之间的法律关系。Suppose there is an entity text set E={e 1 ,e 2 ,...,e n } and a relationship text set R={r 1 ,r 2 ,..., ri ,...,r n }, then the case element table T is T=(e 1 , ri ,e 2 )|e 1 ,e 2 ∈E, ri ∈R, which represents the legal relationship between the target entities e 1 and e 2 .
在一些实施例的步骤S203中,对于抽取得到的实体文本和关系文本,使用余弦相似度来评估实体文本的相似性,从而消除重复的实体文本,重复的关系文本在消除重复的实体文本时一同消除,余弦相似度的计算公式为: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:
, ,
其中,S12为e1和e2的相似度,e1和e2均为实体文本。Among them, S12 is the similarity between e1 and e2 , and both e1 and e2 are entity texts.
请参阅图3,图3是本申请实施例提供的步骤S102的具体方法的流程图。在本申请的一些实施例中,步骤S102具体可以包括但不限于步骤S301至步骤S304,下面结合图3对这四个步骤进行详细介绍。Please refer to Figure 3, which 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, and these four steps are described in detail below in conjunction with Figure 3.
本实施例中,融合网络模型包含图神经网络和卷积神经网络。In this embodiment, the fusion network model includes a graph neural network and a convolutional neural network.
步骤S301,将所述实体文本和所述关系文本转换为向量形式的节点。Step S301: convert the entity text and the relationship text into nodes in vector form.
步骤S302,在所述图神经网络中,通过迭代聚合邻接节点的节点信息来更新中心节点的节点信息,使用多次更新后的节点信息作为节点表征,得到关系传递结果。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.
步骤S303,在所述卷积神经网络中,对所述节点进行特征提取,得到所述实体文本和所述关系文本的局部特征表示,对所述局部特征表示进行最大池化处理,得到所述实体文本和所述关系文本的全局特征表示,作为全局特征提取结果。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.
步骤S304,融合所述关系传递结果和所述全局特征提取结果,得到融合结果,依据所述融合结果计算每种预设的事实主张和法律主张所对应的重要性评分,依据所述重要性评分生成相应的所述事实主张文本和所述法律主张文本。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.
在一些实施例的步骤S301中,向每个实体文本和关系文本分配一个训练好的嵌入向量,例如,可以是采用Word2Vec或FastText等预训练模型在法律文档上训练得到的嵌入向量来初始化这些向量表示,得到实体文本(例如,人、地点和时间等)和关系文本(例如,原告-案件和案件-证据等)分别对应的嵌入向量,然后将各个嵌入向量都表示为节点,得到节点集。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.
在一些实施例的步骤S302中,将实体文本和关系文本之间目标实体的共现表示为边,得到边集,使用节点集和边集构造实体文本和关系文本的图,得到实体-关系图,然后将节点当前的嵌入向量和该节点的邻居节点信息输入至预先训练好的图神经网络,进行逐层图卷积操作,在每次图卷积操作中更新节点的嵌入向量,使用最后一次图卷积操作更新节点的嵌入向量作为节点表征,得到关系传递结果。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.
在一些实施例中,节点的邻居节点信息可以是从实体-关系图的邻接矩阵获取得到,图神经网络对节点进行逐层图卷积操作可以表示为:In some embodiments, the neighbor node information of a node may be obtained from the adjacency matrix of the entity-relationship graph, and the graph neural network may perform a layer-by-layer graph convolution operation on the node as follows:
, ,
其中,hv (k+1)为节点v在图神经网络中第k+1层的嵌入向量,σ为非线性激活函数,μ∈N(v),N(v)为节点v的邻接节点集,W(k)为图神经网络中第k层的权重参数。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.
在一些实施例的步骤S303中,将节点当前的嵌入向量输入至预先训练好的卷积神经网络,在卷积层中进行逐层卷积操作,在每次卷积操作中更新节点的嵌入向量,以逐步提取实体文本和关系文本的局部特征,使用最后一次卷积操作提取实体文本和关系文本的局部特征作为提取实体文本和关系文本的局部特征表示,将实体文本和关系文本的局部特征输入至池化层,对局部特征表示进行最大池化处理,对局部特征表示中元素的特征进行挑选,以提取局部特征表示中各个区域的最大值,强化关键特征的表示,进而得到实体文本和关系文本的全局特征表示,作为全局特征提取结果。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.
在一些实施例的步骤S304中,将融合关系传递结果和全局特征提取结果得到的融合结果输入至全连接层,使用线性激活函数计算融合结果的特征向量,通过融合结果的特征向量对融合结果所对应的节点进行分类,以确定该节点的所属类别,然后依据节点的类别计算每种预设的事实主张和法律主张所对应的重要性评分,节点的类别越吻合或者是吻合的节点数量越多,则重要性评分越高,当重要性评分达到预设的筛选阈值时,输出该事实主张和/或法律主张,完成全部预设的事实主张和法律主张的重要性评分后,使用输出的事实主张和法律主张,以生成事实主张文本和法律主张文本。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.
在一些实施例中,生成事实主张文本和法律主张文本,可以是将目标实体和目标实体之间的法律关系转换为句子描述形式,以生成对应的事实主张文本或法律主张文本。具体而言,对于所要生成的事实主张文本或法律主张文本,首先是确定其所包含的目标实体和目标实体之间的法律关系,然后使用模板化句子生成方法,将这些目标实体和目标实体之间的法律关系转化为完整的句子描述,最后对生成的句子进行进一步的语言处理和优化,以确保其在语法和语义上都是正确的。例如,如果目标实体为"张三"和"钱四",目标实体之间的法律关系为"原告-案件",那么生成的句子可以是"张三作为原告控告钱四..."。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..."
请参阅图4,图4是本申请实施例提供的步骤S103的具体方法的流程图。在本申请的一些实施例中,步骤S103具体可以包括但不限于步骤S401至步骤S403,下面结合图4对这四个步骤进行详细介绍。Please refer to Figure 4, which 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, and these four steps are described in detail below in conjunction with Figure 4.
本实施例中,争议焦点提取模型包括编码器和解码器。其中,在编码器中执行步骤S401和步骤S402,在解码器中执行步骤S403和步骤S404。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.
步骤S401,对所述事实主张文本和所述法律主张文本进行词嵌入处理,得到事实主张编码和法律主张编码。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.
步骤S402,使用预设的权重矩阵对所述事实主张编码和所述法律主张编码进行加权拟合处理,得到事实主张特征向量和法律主张特征向量,对所述事实主张特征向量和所述法律主张特征向量进行归一化处理,得到事实主张概率表示和法律主张概率表示,作为编码输出信息。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.
步骤S403,使用当前的编码输出信息和所述解码器上一次输出的所述争议焦点文本更新所述解码器当前输出的所述争议焦点文本。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.
步骤S404,对当前输出的所述争议焦点文本进行关于所述事实主张文本和所述法律主张文本的相关性评价处理,依据相关性评价处理的结果输出所述目标争议焦点文本。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.
在一些实施例的步骤S401中,事实主张编码和法律主张编码的表达式为:In step S401 of some embodiments, the expressions of the factual claim code and the legal claim code are:
, ,
, ,
其中,Lvec为法律主张编码,Fvec为事实主张编码,L为法律主张文本,F为事实主张文本,Ei为预训练的词嵌入矩阵;Where L vec is the legal claim encoding, F vec is the factual claim encoding, L is the legal claim text, F is the factual claim text, and E i is the pre-trained word embedding matrix;
在一些实施例的步骤S402中,在获得事实主张编码和法律主张编码后,将事实主张编码和法律主张编码输入至编码器,在编码器中依据自注意力机制计算序列中每个事实主张编码和法律主张编码与其他所有事实主张编码和/或法律主张编码的关联度(或称为权重),这些权重反映了各个事实主张编码和/或法律主张编码之间的相互关系。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.
具体而言,首先,使用预设的权重矩阵对事实主张编码和法律主张编码进行加权拟合处理,以通过线性变换得到事实主张编码和法律主张编码的特征向量,特征向量包括一个查询向量、一个键向量以及一个值向量,然后将特征向量输入至softmax函数进行归一化处理,将特征向量的每个元素转换成概率的表示,得到归一化向量,作为事实主张或法律主张的概率表示,归一化向量的每个元素的和等于1。编码器的自注意力机制表示为:Specifically, first, the preset weight matrix is used to perform weighted fitting processing on the factual claim encoding and the legal claim encoding to obtain the feature vector 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 processing, 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:
, ,
, ,
其中,O1和O2均为归一化向量,分别作为事实主张概率表示和法律主张概率表示,WQ为查询的权重矩阵,WK为键的权重矩阵,dk为键的维度,WV为值的权重矩阵。Among them, O 1 and O 2 are both normalized vectors, representing the probability of factual claims and the probability of legal claims respectively, W Q is the weight matrix of the query, W K is the weight matrix of the key, d k is the dimension of the key, and W V is the weight matrix of the value.
在一些实施例的步骤S403中,更新解码器当前输出的争议焦点文本的表达式为:In step S403 of some embodiments, the expression of the dispute focus text currently output by the decoder is updated as follows:
, ,
其中,Contextt为当前的编码输出信息,编码器输出文本信息依据O1和O2生成,Dt为解码器当前输出的争议焦点文本,Dt-1为解码器上一次输出的争议焦点文本。Among them, Context t is the current encoded output information, the encoder output text information is generated based on O 1 and O 2 , D t is the controversial focus text currently output by the decoder, and D t-1 is the controversial focus text output by the decoder last time.
在一些实施例的步骤S404中,评价当前输出的争议焦点文本相对于事实主张文本和法律主张文本的相关性,将相关性程度量化为相关性评分值,然后根据相关性评分值对各个生成的争议焦点文本进行排序输出排序后的争议焦点列表,从争议焦点列表中依次选取相关性评分值最高的若干个争议焦点文本,使用选取到的争议焦点文本生成目标争议焦点文本。其中,评价当前输出的争议焦点文本相对于事实主张文本和法律主张文本的相关性的表达式为: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:
, ,
其中,Ri为解码器生成的第i个争议焦点文本的相关性评分值,Di为解码器生成的第i个争议焦点文本。Among them, Ri is the relevance score value of the i-th controversial focus text generated by the decoder, and Di is the i-th controversial focus text generated by the decoder.
请参阅图5,图5是本申请实施例提供的步骤S104的具体方法的流程图。在本申请的一些实施例中,步骤S104具体可以包括但不限于步骤S501至步骤S503,下面结合图5对这三个步骤进行详细介绍。Please refer to Figure 5, which 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, and these three steps are described in detail below in conjunction with Figure 5.
步骤S501,将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本分别导入至预设的提纲模板中相应的位置,生成提纲文本。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.
步骤S502,以所述提纲文本中所涉及到的所述目标实体作为顶点,依据所述提纲文本中所涉及到的所述法律关系、所述事实主张、所述法律主张和所述目标争议焦点构建边,生成案件信息图。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.
步骤S503,输出所述提纲文本和所述案件信息图,生成所述庭审提纲。Step S503, output the outline text and the case information diagram to generate the trial outline.
在一些实施例中,提纲模板可以是包括案件背景、法律主张概述、事实主张概述和争议焦点概述,将实体文本和关系文本插入至案件背景所对应的文本填写区域内,将法律主张文本插入至法律主张概述所对应的文本填写区域内,将事实主张文本插入至事实主张概述所对应的文本填写区域内,将目标争议焦点文本插入至争议焦点概述所对应的文本填写区域内,从而生成提纲文本。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.
在一些实施例中,以提纲文本中所涉及到的目标实体作为顶点,提纲文本中所涉及到的法律关系、事实主张、法律主张和目标争议焦点作为连接各个目标实体的边,生成案件信息图,并对案件信息图进行可视化显示。例如,若一个争议焦点涉及到某条法律条文和特定的证据,则该法律条文和证据之间会有一条表示这个争议焦点的边。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 certain legal provision and specific evidence, there will be an edge between the legal provision and the evidence representing the dispute focus.
请参阅图6,图6是本申请实施例提供的用于提纲生成的模型训练方法的一个可选的流程图。在本申请的一些实施例中,图6中的方法具体可以包括但不限于步骤S601至步骤S608,下面结合图6对这八个步骤进行详细介绍。Please refer to Figure 6, which 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, the method in Figure 6 may specifically include but is not limited to steps S601 to S608. These eight steps are described in detail below in conjunction with Figure 6.
步骤S601,提取样本文件中的实体文本和关系文本。Step S601, extracting entity text and relationship text from a 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.
步骤S602,通过第一网络,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本。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.
步骤S603,通过第二网络,对所述事实主张文本和所述法律主张文本进行自注意力权重计算,得到自注意力权重,依据所述自注意力权重生成争议焦点文本,依据所述争议焦点文本与所述实体文本和所述关系文本的相关性,对所述争议焦点文本中进行选取,得到目标争议焦点文本。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.
步骤S604,确定所述实体文本和所述关系文本对应的真实事实主张文本和真实法律主张文本,确定所述真实事实主张文本和所述真实法律主张文本对应的真实争议焦点文本。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.
步骤S605,基于所述事实主张文本和所述真实事实主张文本,以及基于所述法律主张文本和所述真实法律主张文本,确定第一损失信息。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.
其中,第一损失信息表征事实主张文本和真实事实主张文本之间以及法律主张文本和真实法律主张文本之间的匹配程度。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.
步骤S606,基于所述目标争议焦点文本和所述真实争议焦点文本,确定第二损失信息。Step S606: Determine the second loss information based on the target dispute focus text and the actual dispute focus text.
其中,第二损失信息表征目标争议焦点文本和真实争议焦点文本之间的匹配程度。Among them, the second loss information represents the degree of matching between the target dispute focus text and the real dispute focus text.
步骤S607,基于所述第一损失信息和所述第二损失信息,确定总损失信息。Step S607: determine total loss information based on the first loss information and the second loss information.
步骤S608,基于梯度下降法,使用所述总损失信息更新所述第一网络和所述第二网络的权重参数,在所述总损失信息符合结束条件时,得到融合网络模型和争议焦点提取模型。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.
可以理解的是,样本文件本质上是原始法律文件,样本文件作为融合网络模型和训练争议焦点提取模型的训练素材,步骤S601、步骤S602和步骤S603的具体过程与上述步骤S101、步骤S102和步骤S103的具体过程实质相同,在此不再赘述。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.
在一些实施例的步骤S604中,确定真实事实主张文本、真实法律主张文本和真实争议焦点文本,可以是人工校对或使用已经训练好的分类模型实现。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 by manual proofreading or by using a trained classification model.
在一些实施例的步骤S605至步骤S607中,依据事实主张文本和真实事实主张文本之间的差异以及法律主张文本和真实法律主张文本之间的差异,通过第一最小化损失函数计算第一损失信息,定义第一最小化损失函数为交叉熵损失,表示事实主张文本和真实事实主张文本之间的差异以及法律主张文本和真实法律主张文本之间的差异。同理,通过第二最小化损失函数计算第二损失信息,定义第二最小化损失函数为交叉熵损失,表示目标争议焦点文本和真实争议焦点文本之间的差异。最后,使用第一损失信息和第二损失信息之和作为总损失信息。具体而言,第一损失信息的计算式为: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:
, ,
第二损失信息的计算式为:The calculation formula for the second loss information is:
, ,
总损失信息的计算式为:The calculation formula for total loss information is:
, ,
其中,LFN为第一损失值,yFN为事实主张文本和法律主张文本对应的损失值计算参数,为真实事实主张文本和真实法律主张文本对应的损失值计算参数,LDFN为第二损失值,yDFN为目标争议焦点文本对应的损失值计算参数,为真实争议焦点文本对应的损失值计算参数,Ltotal为总损失值。Among them, L FN is the first loss value, y FN is the loss value calculation parameter corresponding to the factual claim text and the legal claim text, is the loss value calculation parameter corresponding to the true factual claim text and the true legal claim text, L DFN is the second loss value, y DFN is the loss value calculation parameter corresponding to the target dispute focus text, is the loss value calculation parameter corresponding to the real controversial focus text, and L total is the total loss value.
在一些实施例的步骤S608中,计算总损失信息关于第一网络的权重参数和第二网络的权重参数的梯度,根据预设的学习率和计算得到的梯度,迭代更新第一网络的权重参数和第二网络的权重参数,直至模型损失信息符合损失条件(损失值不再显著降低)或迭代次数达到阈值次数时,结束训练,得到训练好的融合网络模型和训练好的争议焦点提取模型。具体而言,使用总损失信息更新第一网络和第二网络的权重参数的计算式为: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:
, ,
其中,Wt+1为第t+1次更新得到的权重参数,Wt为第t次更新得到的权重参数,α为学习率,为Ltotal相对于Wt的梯度。Among them, Wt+1 is the weight parameter obtained by the t+1th update, Wt is the weight parameter obtained by the tth update, α is the learning rate, is the gradient of L total relative to W t .
请参阅图7,本申请实施例还提供一种提纲生成装置,可以实现上述提纲生成方法,该装置包括:Referring to FIG. 7 , the present application embodiment further provides an outline generation device, which can implement the above outline generation method, and the device includes:
第一模块701,用于提取原始法律文件中的实体文本和关系文本;所述实体文本包含目标实体的信息,所述关系文本包含所述目标实体之间的法律关系的信息,所述目标实体为所述原始法律文件中与案件相关的实体;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;
第二模块702,用于通过融合网络模型,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本;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;
第三模块703,用于通过争议焦点提取模型,对所述事实主张文本和所述法律主张文本进行自注意力权重计算,得到自注意力权重,依据所述自注意力权重生成争议焦点文本,依据所述争议焦点文本与所述实体文本和所述关系文本的相关性,对所述争议焦点文本中进行选取,得到目标争议焦点文本;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;
第四模块704,用于将所述实体文本、所述关系文本、所述事实主张文本、所述法律主张文本和所述目标争议焦点文本输入至用于生成庭审提纲的处理模型中进行处理,生成对应的庭审提纲。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.
该提纲生成装置的具体实施方式与上述提纲生成方法的具体实施例基本相同,在此不再赘述。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.
请参阅图8,本申请实施例还提供一种用于提纲生成的模型训练装置,可以实现上述用于提纲生成的模型训练方法,该装置包括:Referring to FIG. 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:
第一训练模块801,用于提取样本文件中的实体文本和关系文本;所述实体文本包含目标实体的信息,所述关系文本包含所述目标实体之间的法律关系的信息,所述目标实体为所述样本文件中与案件相关的实体;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;
第二训练模块802,用于通过第一网络,对所述实体文本和所述关系文本中的所述目标实体进行关系传递和全局特征提取处理,生成相应的事实主张文本和法律主张文本;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;
第三训练模块803,用于通过第二网络,对所述事实主张文本和所述法律主张文本进行自注意力权重计算,得到自注意力权重,依据所述自注意力权重生成争议焦点文本,依据所述争议焦点文本与所述实体文本和所述关系文本的相关性,对所述争议焦点文本中进行选取,得到目标争议焦点文本;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;
第四训练模块804,用于确定所述实体文本和所述关系文本对应的真实事实主张文本和真实法律主张文本,确定所述真实事实主张文本和所述真实法律主张文本对应的真实争议焦点文本;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;
第五训练模块805,用于基于所述事实主张文本和所述真实事实主张文本,以及基于所述法律主张文本和所述真实法律主张文本,确定第一损失信息;所述第一损失信息表征所述事实主张文本和所述真实事实主张文本之间以及所述法律主张文本和所述真实法律主张文本之间的匹配程度;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;
第六训练模块806,用于基于所述目标争议焦点文本和所述真实争议焦点文本,确定第二损失信息;所述第二损失信息表征所述目标争议焦点文本和所述真实争议焦点文本之间的匹配程度;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;
第七训练模块807,用于基于所述第一损失信息和所述第二损失信息,确定总损失信息;A seventh training module 807, configured to determine total loss information based on the first loss information and the second loss information;
第八训练模块808,用于基于梯度下降法,使用所述总损失信息更新所述第一网络和所述第二网络的权重参数,在所述总损失信息符合结束条件时,得到融合网络模型和争议焦点提取模型。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.
该用于提纲生成的模型训练装置的具体实施方式与上述用于提纲生成的模型训练方法的具体实施例基本相同,在此不再赘述。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.
图9是根据一示例性实施例示出的一种电子设备的框图。Fig. 9 is a block diagram of an electronic device according to an exemplary embodiment.
下面参照图9来描述根据本公开的这种实施方式的电子设备900。图9显示的电子设备900仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。The electronic device 900 according to this embodiment of the present disclosure is described below with reference to Fig. 9. The electronic device 900 shown in Fig. 9 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
如图9所示,电子设备900以通用计算设备的形式表现。电子设备900的组件可以包括但不限于:至少一个处理单元910、至少一个存储单元920、连接不同系统组件(包括存储单元920和处理单元910)的总线930、显示单元940等。As shown in Fig. 9, 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.
其中,存储单元存储有程序代码,程序代码可以被处理单元910执行,使得处理单元910执行本说明书上述的方法部分中描述的根据本公开各种示例性实施方式的步骤。例如,处理单元910可以执行如图1、图2、图3和图4中所示的步骤。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 method section above. For example, the processing unit 910 can perform the steps shown in Figures 1, 2, 3, and 4.
存储单元920可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)9201和/或高速缓存存储单元9202,还可以进一步包括只读存储单元(ROM)9203。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 .
存储单元920还可以包括具有一组(至少一个)程序模块9205的程序/实用工具9204,这样的程序模块9205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。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.
总线930可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。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.
电子设备900也可以与一个或多个外部设备900’(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备900交互的设备通信,和/或与使得该电子设备900能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口950进行。并且,电子设备900还可以通过网络适配器960与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器960可以通过总线930与电子设备900的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备900使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 900 may also communicate with one or more external devices 900' (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 900, and/or may 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.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述的方法。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.
本申请实施例提供的提纲生成方法、模型训练方法、设备及介质,从原始法律文件中提取包含目标实体信息的实体文本和包含目标实体之间的法律关系信息的关系文本,使用融合网络模型对实体文本和关系文本中的目标实体进行关系传递和全局特征提取,可以分析目标实体之间的高阶复杂关系并确定所要提出的事实主张和法律主张,进而生成事实主张文本和法律主张文本,然后使用基于自注意力机制的争议焦点提取模型确定事实主张文本和法律主张文本相对于争议焦点文本的相关性,以捕捉所生成的事实主张和法律主张相对于预设争议焦点的依赖关系,从而确定所要提出的目标争议焦点,生成目标争议焦点文本,最后使用实体文本、关系文本、事实主张文本、法律主张文本和目标争议焦点文本生成庭审提纲,实现从庞大的法律文件中快速、准确提取关键信息,减少人工筛查的时间和精力,提升生成庭审提纲的效率,使庭审提纲具有公正性和准确性。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 relative to the dispute focus text, so as to capture the dependency relationship between 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 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.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、或者网络设备等)执行根据本公开实施方式的上述方法。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.
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。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 (non-exhaustive list) of readable storage media 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.
计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读存储介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。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 of the above. 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 code 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 of the above.
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。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).
本领域技术人员可以理解上述各模块可以按照实施例的描述分布于装置中,也可以进行相应变化唯一不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。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.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施例的方法。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.
以上具体地示出和描述了本公开的示例性实施例。应可理解的是,本公开不限于这里描述的详细结构、设置方式或实现方法;相反,本公开意图涵盖包含在所附权利要求的精神和范围内的各种修改和等效设置。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 (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410962974.1A CN118503411B (en) | 2024-07-18 | 2024-07-18 | Outline generation method, model training method, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410962974.1A CN118503411B (en) | 2024-07-18 | 2024-07-18 | Outline generation method, model training method, device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118503411A CN118503411A (en) | 2024-08-16 |
CN118503411B true CN118503411B (en) | 2024-09-27 |
Family
ID=92234798
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410962974.1A Active CN118503411B (en) | 2024-07-18 | 2024-07-18 | Outline generation method, model training method, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118503411B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119180282B (en) * | 2024-09-18 | 2025-07-22 | 中国人民解放军海军工程大学 | Method and device for extracting document information, storage medium and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111813947A (en) * | 2019-04-09 | 2020-10-23 | 北京国双科技有限公司 | Method and device for automatic generation of outline of court inquiry |
CN112329464A (en) * | 2020-11-27 | 2021-02-05 | 浙江大学 | Method, device and medium for generating first question of judicial trial based on deep neural network |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113011185A (en) * | 2020-07-17 | 2021-06-22 | 上海浦东华宇信息技术有限公司 | Legal field text analysis and identification method, system, storage medium and terminal |
CN113222251A (en) * | 2021-05-13 | 2021-08-06 | 太极计算机股份有限公司 | Case dispute focus-based auxiliary judgment result prediction method and system |
-
2024
- 2024-07-18 CN CN202410962974.1A patent/CN118503411B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111813947A (en) * | 2019-04-09 | 2020-10-23 | 北京国双科技有限公司 | Method and device for automatic generation of outline of court inquiry |
CN112329464A (en) * | 2020-11-27 | 2021-02-05 | 浙江大学 | Method, device and medium for generating first question of judicial trial based on deep neural network |
Also Published As
Publication number | Publication date |
---|---|
CN118503411A (en) | 2024-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106202010B (en) | Method and apparatus based on deep neural network building Law Text syntax tree | |
CN109145294B (en) | Text entity identification method and device, electronic equipment and storage medium | |
CN111382565B (en) | Method and system for extracting emotion-cause pairs based on multi-label | |
CN113987169A (en) | Method, device, device and storage medium for generating text summaries based on semantic blocks | |
CN104391842A (en) | Translation model establishing method and system | |
CN110347790B (en) | Text duplicate checking method, device and equipment based on attention mechanism and storage medium | |
CN114429132A (en) | Named entity identification method and device based on mixed lattice self-attention network | |
CN110442880B (en) | Translation method, device and storage medium for machine translation | |
CN111966797B (en) | Method for machine reading and understanding by using word vector introduced with semantic information | |
CN116204674B (en) | Image description method based on visual concept word association structural modeling | |
CN114818717B (en) | Chinese named entity recognition method and system integrating vocabulary and syntax information | |
CN110874536A (en) | Corpus quality evaluation model generation method and bilingual sentence pair inter-translation quality evaluation method | |
CN116796744A (en) | Entity relation extraction method and system based on deep learning | |
CN111881256B (en) | Text entity relation extraction method and device and computer readable storage medium equipment | |
CN113268576B (en) | Deep learning-based department semantic information extraction method and device | |
CN111597807B (en) | Word segmentation data set generation method, device, equipment and storage medium thereof | |
CN114943230A (en) | A Chinese Domain-Specific Entity Linking Method Integrating Common Sense Knowledge | |
CN118503411B (en) | Outline generation method, model training method, device and medium | |
CN112613316A (en) | Method and system for generating ancient Chinese marking model | |
CN110852066B (en) | A method and system for multilingual entity relation extraction based on adversarial training mechanism | |
CN113065349A (en) | A Conditional Random Field-Based Named Entity Recognition Method | |
CN113221553A (en) | Text processing method, device and equipment and readable storage medium | |
CN114757184A (en) | Method and system for realizing knowledge question answering in aviation field | |
CN114328894A (en) | Document processing method, document processing device, electronic equipment and medium | |
CN116956925A (en) | Electronic medical record named entity identification method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250107 Address after: Room 602, Building A, Shenzhen International Innovation Center, No. 1006 Shennan Avenue, Xintian Community, Huafu Street, Futian District, Shenzhen City, Guangdong Province, 518000 (a company with multiple locations) Patentee after: SHENZHEN DIB ENTERPRISE RISK MANAGEMENT TECHNOLOGY CO.,LTD. Country or region after: China Patentee after: Intermediate people's Court of Shenzhen City, Guangdong Province Address before: 518048 West 6th Floor, Building A, International Innovation Center, No. 1006 Shennan Avenue, Futian District, Shenzhen City, Guangdong Province Patentee before: SHENZHEN DIB ENTERPRISE RISK MANAGEMENT TECHNOLOGY CO.,LTD. Country or region before: China |