Determination method of legal event and training method of legal event detection model
By combining the BERT model and the legal event detection model of graph convolutional network, the problem of difficulty in accurately identifying legal events in the prior art is solved, and effective extraction of legal entity information and entity relationships and accurate identification of legal events are achieved.
Patent Information
- Application Number
- CN202510005305.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2045-01-03
AI Technical Summary
It is difficult for the prior art to accurately identify the legal events involved in the consultation information entered by the user, especially in the legal consultation scenario, and traditional methods are difficult to effectively extract legal entity information and entity relationships.
A legal event detection model combining the BERT model and graph convolutional network (GCN) model is used to process the user's input question information through a multi-layer neural network layer, extract entity characteristics and entity relationships, and then determine legal events.
It improves the ability to accurately identify legal events in user input question information, can more effectively extract legal entity information and entity relationships, and provide more accurate legal advice.
Smart Images

Figure CN119398055A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for determining a legal event and a method for training a legal event detection model. Background Art
[0002] In the legal consultation scenario, users can consult information related to legal cases through the legal consultation system. When the legal consultation system generates a corresponding response based on the consultation information input by the user, it needs to detect the legal events involved in the consultation information. Among them, legal events refer to the legal relationships that legal subjects may be involved in. Therefore, the legal consultation system can further process the consultation information based on the determined legal events (such as retrieving relevant cases and legal basis, etc.) to provide users with accurate consulting opinions. Summary of the invention
[0003] The embodiment of the present application provides a method for determining a legal event and a method for training a legal event detection model, which can accurately obtain the core information of each entity in the question information input by the user and the core relationship between the entities, thereby improving the accuracy of determining the legal event in the question information. Specifically, the embodiment of the present application discloses the following technical solutions:
[0004] A first aspect of an embodiment of the present application provides a method for determining a legal event, which is applied to a legal event detection model. The method includes: obtaining first question information input by a user, and determining multiple entities in the first question information and entity relationships between each of the multiple entities through a first neural network model in the legal event detection model; determining question information features corresponding to the first question information and initial features corresponding to each of the entities based on the first question information and the multiple entities through a second neural network model in the legal event detection model; wherein the initial features corresponding to each of the entities represent context information corresponding to each of the entities; determining question information features corresponding to the first question information and initial features corresponding to each of the entities based on the first question information and the multiple entities through a second neural network model in the legal event detection model; wherein the initial features corresponding to each of the entities represent context information corresponding to each of the entities; determining question information features corresponding to the first question information and initial features corresponding to each of the entities based on the first question information through multiple neural network layers in a third neural network model in the legal event detection model The corresponding syntactic graph and the initial features corresponding to the above-mentioned entities are updated to obtain the updated features corresponding to the above-mentioned entities determined by each of the above-mentioned neural network layers; wherein the above-mentioned syntactic graph includes multiple nodes and multiple edges, each of the above-mentioned multiple nodes corresponds to the above-mentioned entities, and each of the above-mentioned multiple edges corresponds to the entity relationship between the above-mentioned entities; the updated features corresponding to the above-mentioned entities determined by the last neural network layer in the above-mentioned multiple neural network layers are determined as the core information corresponding to the above-mentioned first question information; the target event information corresponding to the above-mentioned first question information is determined by the fourth neural network model in the above-mentioned legal event detection model based on the above-mentioned question information features and the core information corresponding to the above-mentioned first question information.
[0005] In some embodiments, the above-mentioned determination of the entity relationships between the multiple entities in the above-mentioned first question information and each of the above-mentioned multiple entities through the first neural network model in the above-mentioned legal event detection model includes: obtaining historical event information, and vectorizing the above-mentioned historical event information through the above-mentioned first neural network model to obtain a supervision vector; extracting features of the legal elements in the above-mentioned first question information through the above-mentioned first neural network model to obtain multiple element features corresponding to the above-mentioned first question information; determining the content features corresponding to the above-mentioned first question information based on the above-mentioned multiple element features corresponding to the above-mentioned first question information and the above-mentioned supervision vector through the above-mentioned first neural network model, and determining the above-mentioned content features as the above-mentioned multiple entities; extracting entity relationships from the above-mentioned content features through the above-mentioned first neural network model to obtain entity relationships between each of the above-mentioned entities.
[0006] In some embodiments, the multiple neural network layers in the third neural network model in the legal event detection model update the initial features corresponding to each of the above-mentioned entities based on the syntactic graph corresponding to the above-mentioned first question information and the initial features corresponding to each of the above-mentioned entities, and obtain the updated features corresponding to each of the above-mentioned entities determined by each of the above-mentioned neural network layers in the above-mentioned multiple neural network layers, including: obtaining the first features corresponding to each of the above-mentioned entities determined by the above-mentioned first neural network layer through the first neural network layer in the above-mentioned multiple neural network layers based on the initial features corresponding to each of the above-mentioned entities, the adjacency matrix corresponding to the above-mentioned syntactic graph, the self-connection matrix and the weight matrix corresponding to the above-mentioned first neural network layer; wherein the above-mentioned first neural network layer is the first neural network layer in the above-mentioned multiple neural network layers; obtaining the second features corresponding to each of the above-mentioned entities determined by the above-mentioned second neural network layer through the second neural network layer in the above-mentioned multiple neural network layers based on the first features corresponding to each of the above-mentioned entities, the adjacency matrix corresponding to the above-mentioned syntactic graph, the self-connection matrix and the weight matrix corresponding to the above-mentioned second neural network layer; wherein the updated features corresponding to each of the above-mentioned entities include the first features corresponding to each of the above-mentioned entities and the second features corresponding to each of the above-mentioned entities.
[0007] In some embodiments, the fourth neural network model in the legal event detection model determines the target event information corresponding to the first question information based on the question information features and the core information corresponding to the first question information, including: fusing the question information features and the core information corresponding to the first question information to obtain a fused feature; and classifying the legal events corresponding to the fused feature through the fourth neural network model to obtain the target event information.
[0008] In some embodiments, the fourth neural network model in the legal event detection model determines the target event information corresponding to the first question information based on the question information characteristics and the core information corresponding to the first question information, including: determining the first event information corresponding to the first question information based on the question information characteristics and the core information corresponding to the first question information through the fourth neural network model; determining event determination information based on the first event information through the fifth neural network model, and determining and outputting the second question information based on the event determination information and the first question information; obtaining the reply information input by the user to the second question information, and determining the target question information based on the first question information and the reply information; determining the target event information based on the target question information characteristics corresponding to the target question information and the core information corresponding to the target question information through the fourth neural network model.
[0009] In some embodiments, the event judgment information is determined based on the first event information through the fifth neural network model, including: determining multiple preset texts associated with the first event information in a preset database based on the first event information through the fifth neural network model; processing the first preset text through the fifth neural network model to obtain multiple retrieval pairs corresponding to the first preset text; wherein the first preset text is any preset text among the multiple preset texts, and each of the multiple retrieval pairs includes a retrieval identifier and a retrieval content; clustering the multiple retrieval pairs corresponding to the first preset text through the fifth neural network model to obtain multiple candidate seed retrieval pairs; determining a target seed retrieval pair that meets preset conditions among the multiple candidate seed retrieval pairs through the fifth neural network model, and determining the retrieval content of the target seed retrieval pair as the event judgment information.
[0010] In some embodiments, the above-mentioned fifth neural network model is used to cluster the multiple retrieval pairs corresponding to the above-mentioned first preset text to obtain multiple candidate seed retrieval pairs, including: in the current round of clustering process, the above-mentioned fifth neural network model is used to obtain the multiple first seed retrieval pairs obtained in the previous round of clustering process and the multiple first retrieval pairs that are not clustered; wherein the above-mentioned multiple retrieval pairs include the above-mentioned multiple first seed retrieval pairs and the above-mentioned multiple first retrieval pairs, and the sum of the number of the above-mentioned multiple first seed retrieval pairs and the above-mentioned multiple first retrieval pairs is equal to the preset number; the above-mentioned multiple first seed retrieval pairs and the above-mentioned multiple first retrieval pairs are clustered by the above-mentioned fifth neural network model to obtain multiple first retrieval pairs corresponding to each of the above-mentioned legal categories in the multiple legal categories. two search pairs; determine the second seed search pairs corresponding to each of the above-mentioned legal categories among the above-mentioned multiple second search pairs corresponding to each of the above-mentioned legal categories through the above-mentioned fifth neural network model, and determine the multiple unclustered second search pairs among the above-mentioned multiple search pairs according to the above-mentioned preset number, the above-mentioned multiple first search pairs and the multiple second seed search pairs; cluster the multiple second seed search pairs and the multiple second search pairs in the next round of clustering process through the above-mentioned fifth neural network model until there are no unclustered search pairs in the above-mentioned multiple search pairs, and obtain the multiple candidate seed search pairs determined by the last round of clustering process; wherein each of the above-mentioned multiple candidate seed search pairs corresponds to a different legal category.
[0011] In some embodiments, the above-mentioned determination of the second seed retrieval pairs corresponding to each of the above-mentioned legal categories among the above-mentioned multiple second retrieval pairs corresponding to each of the above-mentioned legal categories by the above-mentioned fifth neural network model includes: determining the semantic vector corresponding to each of the above-mentioned second retrieval pairs in each of the above-mentioned legal categories by the above-mentioned fifth neural network model; determining the total distance between each first semantic vector and the second semantic vector in each of the above-mentioned legal categories according to the semantic vector corresponding to each of the above-mentioned second retrieval pairs by the above-mentioned fifth neural network model; wherein the above-mentioned first semantic vector is the semantic vector corresponding to any second retrieval pair among the above-mentioned multiple second retrieval pairs corresponding to each of the above-mentioned legal categories, and the above-mentioned second semantic vector is the semantic vector corresponding to the second retrieval pair other than the second retrieval pair corresponding to the above-mentioned first semantic vector; determining the target semantic vector with the shortest total distance to the above-mentioned second semantic vector among the multiple first semantic vectors by the above-mentioned fifth neural network model, and determining the second retrieval pair corresponding to the above-mentioned target semantic vector as the above-mentioned second seed retrieval pair corresponding to each of the above-mentioned legal categories.
[0012] In some embodiments, the above-mentioned determination of a target seed retrieval pair that meets preset conditions among the above-mentioned multiple candidate seed retrieval pairs through the above-mentioned fifth neural network model includes: determining a target confidence score for each of the above-mentioned multiple candidate seed retrieval pairs; wherein the above-mentioned target confidence score is related to the correlation between each of the above-mentioned candidate seed retrieval pairs and the above-mentioned first event information, and the number of retrieval pairs in the legal category corresponding to each of the above-mentioned candidate seed retrieval pairs; and determining the candidate seed retrieval pair among the above-mentioned multiple candidate seed retrieval pairs whose target confidence score is greater than or equal to the preset score as the above-mentioned target seed retrieval pair.
[0013] A second aspect of an embodiment of the present application provides a training method for a legal event detection model, wherein the legal event detection model includes a third neural network model, and the method includes: obtaining a syntactic graph sample and a target vector representation of each of the sample nodes in a plurality of nodes; wherein the syntactic graph sample includes the plurality of sample nodes; performing vectorization processing on the plurality of nodes in the syntactic graph sample to obtain an initial vector representation of each of the plurality of sample nodes; obtaining the syntactic graph sample through the third neural network model to be trained, and performing vectorization processing on the plurality of nodes in the syntactic graph sample based on the initial vector representation of each of the sample nodes and the plurality of sample nodes through each of the plurality of neural network layers to be trained; The initial vector representation of the adjacent sample nodes corresponding to the sample node is updated to obtain the updated vector representation of each of the sample nodes determined by each of the neural network layers to be trained; wherein the third neural network model to be trained includes the multiple neural network layers to be trained; based on the target vector representation of each of the sample nodes and the updated vector representation of each of the nodes determined by the last neural network layer in the multiple neural network layers, the loss function corresponding to the third neural network model to be trained is determined; based on the loss function, the parameters in the third neural network model are optimized to obtain the trained third neural network model.
[0014] According to a third aspect of an embodiment of the present application, there is provided a device for determining a legal event, which is configured in a legal event detection model. The device includes: an acquisition module, which is configured to acquire first question information input by a user, and determine multiple entities in the first question information and entity relationships between each of the multiple entities through a first neural network model in the legal event detection model; a first determination module, which is configured to determine question information features corresponding to the first question information and initial features corresponding to each of the entities through a second neural network model in the legal event detection model based on the first question information and the multiple entities; wherein the initial features corresponding to each of the entities represent context information corresponding to each of the entities; a first update module, which is configured to update the legal event detection model based on the first question information and the multiple entities through a plurality of neural network layers in a third neural network model in the legal event detection model; The syntactic graph corresponding to the question information and the initial features corresponding to the above-mentioned entities are updated to obtain the updated features corresponding to the above-mentioned entities determined by each of the above-mentioned neural network layers; wherein the above-mentioned syntactic graph includes multiple nodes and multiple edges, each of the above-mentioned multiple nodes corresponds to the above-mentioned entities, and each of the above-mentioned multiple edges corresponds to the entity relationship between the above-mentioned entities; the second determination module is configured to determine the updated features corresponding to the above-mentioned entities determined by the last neural network layer in the above-mentioned multiple neural network layers as the core information corresponding to the above-mentioned first question information; the third determination module is configured to determine the target event information corresponding to the above-mentioned first question information based on the above-mentioned question information features and the core information corresponding to the above-mentioned first question information through the fourth neural network model in the above-mentioned legal event detection model.
[0015] According to a fourth aspect of an embodiment of the present application, there is provided a training device for a legal event detection model, wherein the legal event detection model includes a third neural network model, and the device includes: a second acquisition module, configured to acquire a syntactic graph sample and a target vector representation of each of the sample nodes in a plurality of nodes; wherein the syntactic graph sample includes the plurality of sample nodes; a vectorization processing module, configured to vectorize the plurality of nodes in the syntactic graph sample to obtain an initial vector representation of each of the plurality of sample nodes; and a second update module, configured to acquire the syntactic graph sample through the third neural network model to be trained, and to update the syntactic graph sample based on the initial vector representation of each of the sample nodes through each of the plurality of neural network layers to be trained. The first step is to determine the loss function corresponding to the third neural network model to be trained by updating the vector representation of each of the above-mentioned sample nodes and the initial vector representation of the adjacent sample nodes corresponding to each of the above-mentioned sample nodes to obtain the updated vector representation of each of the above-mentioned sample nodes determined by each of the above-mentioned neural network layers to be trained; wherein the above-mentioned third neural network model to be trained includes the above-mentioned multiple neural network layers to be trained; the fourth determination module is configured to determine the loss function corresponding to the above-mentioned third neural network model to be trained based on the target vector representation of each of the above-mentioned sample nodes and the updated vector representation of each of the above-mentioned nodes determined by the last neural network layer in the above-mentioned multiple neural network layers; the optimization module is configured to optimize the parameters in the above-mentioned third neural network model based on the above-mentioned loss function to obtain the trained third neural network model.
[0016] A fifth aspect of an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory, the memory being configured to: store one or more programs; wherein, when the one or more programs are executed by one or more processors, the one or more processors implement the method for determining legal events described in the first aspect above, or implement the method for training the legal event detection model described in the second aspect above.
[0017] The sixth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions. When the computer reads the instructions, it executes the method for determining legal events described in the first aspect above, or implements the method for training the legal event detection model described in the second aspect above.
[0018] A seventh aspect of an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the method for determining legal events described in the first aspect above, or implements the method for training the legal event detection model described in the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a legal event detection model provided for some embodiments of the present application; Figure 2 A flowchart of a method for determining a legal event provided in some embodiments of the present application; Figure 3 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Figure 4 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Figure 5 A schematic diagram of a syntax diagram provided for some embodiments of the present application; Figure 6 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Figure 7 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Figure 8 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Fig. 9 A scene diagram for legal event detection provided for some embodiments of the present application; Fig.10 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Fig.11 A flowchart of another method for determining a legal event provided in some embodiments of the present application; Fig.12 A flowchart of a method for training a legal event retrieval model provided in some embodiments of the present application; Fig.13 A schematic diagram of a device for determining a legal event provided in some embodiments of the present application; Fig.14 A schematic diagram of a training device for a legal event detection model provided in some embodiments of the present application; Fig.15 A schematic diagram of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention and to make the above-mentioned purposes, features and advantages of the embodiments of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0022] Since legal events are usually complex, it is usually difficult to accurately determine the semantic information of each entity in the consulting information and the relationship between the entities by detecting keywords in the consulting information input by the user, and thus it is impossible to accurately determine the legal events involved in the consulting information.
[0023] Based on the above technical problems, the present application provides a method for determining legal events and a training method for a legal event detection model, which can combine the BERT model and the Graph Convolutional Networks (GCN) model to better identify the legal events involved in the consulting information input by the user.
[0024] It should be noted that the training samples used in the training process of the neural network model involved in this application are all from authorized legal documents, judgments, case descriptions, etc., and the conclusions obtained by the method for determining legal events provided in this application are only used to form consulting opinions for users for reference.
[0025] Figure 1 A schematic diagram of a legal event detection model provided in some embodiments of the present application. Figure 1 As shown, the legal event detection model 100 may include a first neural network model 110 , a second neural network model 120 , a third neural network model 130 , a fourth neural network model 140 and a sixth neural network model 150 .
[0026] In some examples, the first neural network model 110 may include a named entity recognition (NER) model and a relation extraction (RE) model. After obtaining the consulting information (hereinafter referred to as the first question information) input by the user, the legal event detection model 100 may identify the entities in the first question information through the NER model in the first neural network model 110, and identify the relationships between the entities in the first question information through the RE model, thereby obtaining the entities in the first question information and the entity relationships between the entities.
[0027] In some examples, the first neural network model 110 may also be a legal information extraction model including an information extraction layer and a relationship extraction layer; wherein the information extraction layer includes a supervision model and a content model; and the relationship extraction layer may include a graph neural network (GNN). After obtaining the first question information input by the user, the legal event detection model 100 may extract features of the legal event detection results (i.e., historical legal events) obtained in the previous legal event detection process through the supervision model in the information extraction layer to obtain a supervision vector; and extract legal elements from the first question information input by the user through the content model in the information extraction layer to obtain multiple element features; and then determine the content features based on the above multiple element features and the supervision vector through the content model, and the content features are the entity information in the first question information. Then, the content features are processed through the relationship extraction layer in the first neural network model 110 to determine the entity relationship between each entity information.
[0028] Exemplarily, the sixth neural network model 150 is a syntactic graph construction model. After obtaining the entities in the first question information and the entity relationships between the entities through the first neural network model 110, the corresponding syntactic graph can be constructed based on the above entities and the entity relationships between the entities through the sixth neural network model 150. The syntactic graph can represent all possible relationships between the entities (nodes).
[0029] Exemplarily, the second neural network model 120 may be a BERT model. The BERT model obtains the multiple entities determined by the first neural network model 110 and the first question information input by the user, and extracts the context information corresponding to each entity in the first question information. The BERT model may input the context information corresponding to each entity into the third neural network model 130 as the initial features corresponding to each entity.
[0030] Exemplarily, the third neural network model 130 may be composed of a multi-layer graph convolutional network model (GCN). The third neural network model 130 obtains the syntactic graph determined by the syntactic graph construction model and the initial features corresponding to each entity determined by the BERT model, and updates the initial features corresponding to each entity layer by layer through each layer of GCN based on the syntactic graph and the initial features corresponding to each entity, using hierarchical propagation and aggregation of neighbor nodes; finally, the updated features corresponding to each entity obtained by the last layer of GCN are determined as the core information corresponding to the first question information, that is, the core information corresponding to each entity and the core relationship between the entities.
[0031] Exemplarily, the fourth neural network model 140 may be a classification model, which may be implemented based on a fully connected layer, which is not limited in this embodiment. The core information corresponding to the first question information and the question information features corresponding to the first question information determined by the BERT model may be fused to obtain fused features; then the fused features may be classified by the classification model, and the classification result obtained is the legal event information corresponding to the first question information (i.e., the target event information).
[0032] Through the above scheme, the contextual relationship corresponding to each entity in the question information input by the user (that is, the initial features corresponding to each entity) can be extracted through the BERT model, and the initial features corresponding to each entity are updated layer by layer through the multi-layer GCN model, so as to finally obtain the core information corresponding to each entity and the core relationship between each entity, and then the legal event information corresponding to the first question information can be accurately determined based on the core information corresponding to each entity and the core relationship between each entity through the classification model.
[0033] The following is a detailed description of the method for determining the legal events provided by this application.
[0034] Figure 2 A flowchart of a method for determining a legal event provided in some embodiments of the present application, wherein: Figure 2 The method of determining legal events shown can be applied to Figure 1 The legal event detection model shown in Figure 2 is shown in Figure 2. Figure 2 As shown, the method for determining the legal event may include steps 210 to 240.
[0035] Step 210, obtaining first question information input by the user, and determining multiple entities in the first question information and entity relationships between each of the multiple entities through a first neural network model in the legal event detection model.
[0036] In some embodiments, a user may input legal consulting information (hereinafter referred to as first question information) in a user interface provided by a legal consulting system (hereinafter referred to as a central control system). The central control system may call a corresponding legal tool in response to the first question information input by the user to process the first question information to obtain a processing result, thereby summarizing the processing results obtained by each legal tool, obtaining a final consulting opinion, and outputting it to the user. The legal tool may include a legal event detection model, which may identify the legal events involved in the first question information input by the user and obtain a legal event detection result, so that legal cases or legal provisions may be retrieved based on the legal event detection result to provide legal consulting opinions to the user.
[0037] For example, after the central control system calls the legal event detection model, it can perform entity recognition and entity relationship extraction on the user's input through the first neural network model in the legal event detection model, thereby determining the entity information in the first question information and the entity relationship between the entities. In the legal consultation scenario, entities can include people, places, time, etc.; entity relationships between entities can include loan relationships, personal injury compensation relationships, etc.
[0038] Exemplarily, the first neural network model may include a named entity recognition (NER) model and a relation extraction (RE) model. The entities in the first question information may be identified by the NER model to obtain the entities in the first question information. Then, the relationship between the entities in the first question information may be identified by the RE model to obtain the entity relationship between the entities in the first question information.
[0039] Exemplarily, the first neural network model may also be a legal information extraction model including an information extraction layer and a relationship extraction layer; wherein the information extraction layer includes a supervision model and a content model, and both the supervision model and the content model may adopt a BERT model or a Transformer model; and the relationship extraction layer may include a graph neural network (GNN). The supervision model in the information extraction layer may be used to extract features of the legal event detection results (i.e., historical legal events) obtained in the previous legal event detection process to obtain a supervision vector; and the content model in the information extraction layer may be used to extract legal elements from the first question information input by the user to obtain multiple element features; and then the content model may be used to determine the content features based on the above multiple element features and the supervision vector, and the content features are the entity information in the first question information. Then, the content features are processed by the relationship extraction layer in the first neural network model to determine the entity relationships between the entities.
[0040] In some examples, the legal information extraction model can be a legal tool independent of the legal event detection model and can be called by the central control system. That is, the central control system can call the legal information extraction model and the legal event detection model in response to the first question information input by the user, so as to determine the entity information and entity relationship corresponding to the first question information through the legal information extraction model, and determine the target event information corresponding to the first question information through the legal event detection model based on the entity information and entity relationship output by the legal information extraction model.
[0041] For example, taking the first question information input by the user as "Zhang San borrowed 100,000 yuan from Li Si, and the two parties agreed to repay the loan one year later. One year later, Zhang San failed to repay the loan on time and ignored Li Si's reminders for payment", after the first neural network model performs entity extraction on the first question information, the multiple entities obtained may include: Zhang San (person), Li Si (person), 100,000 yuan (loan amount), one year (loan time); after performing entity relationship extraction on the above multiple entities, the entity relationships between the entities obtained may include: Zhang San borrowed money from Li Si (loan relationship), Zhang San failed to repay the loan on time (breach of contract), and Li Si urges for payment (collection behavior).
[0042] Step 220: Determine, through a second neural network model in the legal event detection model, question information features corresponding to the first question information and initial features corresponding to each entity based on the first question information and the multiple entities.
[0043] In some embodiments, the context information corresponding to each entity in the first question information can be extracted by the second neural network model in the legal event detection model, and the context information corresponding to each entity can be determined as the initial features corresponding to each entity. The second neural network model can be a BERT model. The initial features corresponding to each entity determined by the BERT model usually cover a wider range, that is, they usually cover all possible contextual relationships related to each entity in the first question information.
[0044] Using the above example, the initial features corresponding to each entity in the first question information of the BERT model can be: Zhang San: [0.1, 0.2, 0.3, ...], Li Si: [0.2, 0.3, 0.4, ...], 100,000 RMB: [0.3, 0.4, 0.5, ...], one year: [0.4, 0.5, 0.6, ...]. It should be noted that the values in the initial features corresponding to the above entities are only examples.
[0045] In some embodiments, the first question information may also be vectorized using a second neural network model to obtain question information features corresponding to the first question information.
[0046] Step 230, determining the core information corresponding to the first question information based on the multiple entities, the entity relationships between the entities and the initial features corresponding to the entities through the third neural network model in the legal event detection model.
[0047] In some embodiments, since the initial features corresponding to each entity obtained by the above-mentioned second neural network model usually cover a wider range, the initial features corresponding to each entity can be processed by a third neural network model so that the initial features corresponding to each entity gradually converge to the core information corresponding to each entity and the core relationship between each entity.
[0048] Exemplarily, the third neural network model may be composed of a multi-layer graph convolutional network model (GCN). The initial features corresponding to each entity may be updated layer by layer by using hierarchical propagation and aggregation of neighbor nodes based on the syntactic graph and the initial features corresponding to each entity. Among them, the syntactic graph may be determined based on entities and the entity relationships between entities. Finally, the updated features corresponding to each entity obtained by the last layer of GCN are determined as the core information corresponding to the first question information (i.e., the core information corresponding to each entity and the core relationship between each entity).
[0049] Step 240: Determine the target event information corresponding to the first question information based on the question information features and the core information corresponding to the first question information through the fourth neural network model in the legal event detection model.
[0050] In some embodiments, the target event information corresponding to the first question information can be determined by the fourth neural network model in the legal event detection model based on the question information features determined by the BERT model and the core information corresponding to the first question information determined by the GCN.
[0051] Exemplarily, the fourth neural network model may be a classification model. The core information corresponding to the first question information and the question information features corresponding to the first question information determined by the BERT model may be fused to obtain fused features and input them into the classification model; the fused features are then classified by the classification model, and the classification result obtained is the legal event information corresponding to the first question information (i.e., the target event information).
[0052] Through the above scheme, the contextual relationship corresponding to each entity in the question information input by the user (that is, the initial features corresponding to each entity) can be extracted, and the initial features corresponding to each entity can be updated by hierarchical propagation and aggregation of neighbor nodes, so as to finally obtain the core information corresponding to each entity and the core relationship between each entity, and then, based on the core information corresponding to each entity and the core relationship between each entity, the legal event information corresponding to the first question information can be accurately determined.
[0053] Figure 3 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Figure 3 As shown, the above step 210 may include steps 310 to 340.
[0054] Step 310, obtain historical event information, and vectorize the historical event information through a first neural network model to obtain a supervision vector.
[0055] In some embodiments, the first neural network model can be implemented using a named entity recognition (NER) model and a relation extraction (RE) model. However, when extracting entities and entity relationships, the existing NER model and RE model can usually only focus on common entity information such as names, place names, and institution names, while in the legal consultation scenario, legal entity information needs to be extracted, and the legal entity information in different legal cases is also different. For example, the legal entity information involved in civil tort incidents may include tortious acts, damage facts, causal relationships, subjective faults, etc.; the legal entity information involved in criminal cases may include criminal objects, objective aspects of crimes, criminal subjects, subjective aspects of crimes, etc. Therefore, the process of extracting legal entity information using NER models and RE models will be more complicated, and it is impossible to use supervised learning to let the model learn the entities and entity relationships to be extracted; and the legal information content in the consultation information input by the user is usually long and does not appear in the form of continuous characters, that is, the legal entity information usually has different degrees of overlap, which will further cause the traditional NER model and RE model to be unable to well extract legal entity information and entity relationships.
[0056] Therefore, the first neural network model can adopt a legal information extraction model composed of an information extraction layer and a relationship extraction layer. The information extraction layer in the legal information extraction model is used to determine the entity information in the first question information input by the user; the relationship extraction layer in the legal information extraction model is used to determine the entity relationship between entities based on the entity information in the first question information. Among them, the information extraction layer includes a supervision model and a content model, and both the supervision model and the content model can be composed of a BERT model or a Transformer model.
[0057] In some examples, the legal information extraction model can use the event detection results (i.e., historical legal events) of the legal event detection model as the input of the supervision model, so that the supervision model can determine the supervision vector based on the historical legal events to assist the content model in more accurately determining the entity information in the first question information. Then, the legal event detection model can obtain the legal event information in the first question information based on the entity information in the first question information determined by the legal information extraction model. Further, the above-mentioned legal event information obtained by the legal event detection model can be input into the supervision model as a historical legal event to re-determine the entity information in the first question information; the legal event detection model can re-determine the legal event information in the first question information based on the re-determined entity information. Then, when the legal event information determined for the first time is different from the legal event information determined for the second time, the legal event information determined for the second time can continue to be used as the input of the supervision model. And so on, until the legal event information determined twice before and after is consistent, the legal event information is determined as the final target event information.
[0058] Exemplarily, when the supervision model determines the supervision vector based on a historical legal event, it can determine the legal information type corresponding to the historical legal event, and perform feature extraction (ie, vectorization processing) on the legal information type to obtain the supervision vector.
[0059] Step 320: extract features of the legal elements in the first question information through the first neural network model to obtain multiple element features corresponding to the first question information.
[0060] In some embodiments, the content model in the first neural network model may include multiple element extraction models. Each of the multiple element extraction models is used to extract different legal elements in the first question information, thereby obtaining multiple element features corresponding to the first question information, and these element features cover all possible entities in the first question information and the relationship between each entity. Among them, legal elements refer to common content existing in different legal fields, such as subject, object, behavior, object, subjective intention, etc. In other words, the subject, object, behavior, object, subjective intention and other element features in the first question information can be extracted by each element extraction model to obtain the above-mentioned multiple element features corresponding to the first question information.
[0061] For example, in the process of classifying and identifying legal elements, each element model can automatically complete the classification based on the training of a large amount of training data, that is, each element model focuses on specific element features. On this basis, the element features that need to be identified can also be set for each element model through manual annotation to enhance the classification effect of the model.
[0062] Step 330: Determine content features corresponding to the first question information through a first neural network model based on a plurality of element features and a supervision vector corresponding to the first question information, and determine the content features as a plurality of entities.
[0063] In some embodiments, after obtaining the multiple element features and supervision vectors corresponding to the first question information, the content model can further fuse the multiple element features and supervision vectors to obtain content features corresponding to the first question information. The content features are multiple entity information in the first question information.
[0064] Exemplarily, the content model may also include a feature fusion layer. When the content model fuses multiple element features and supervision vectors, it may concatenate or dot-multiply the element features determined by each element model with the supervision vector, thereby strengthening or weakening the representation of each element feature, thereby realizing remote supervision of each element feature through the supervision vector. Furthermore, each element feature may be weighted through the attention mechanism in the feature fusion layer, and the weight-adjusted element features may be fused to obtain the content feature corresponding to the first question information.
[0065] In some embodiments, based on the above feature fusion layer, a conditional random field (CRF) layer can be set in the content model. The CRF layer can further optimize the extraction of entity information by obtaining the dependency relationship between each entity information, thereby improving the accuracy of entity information extraction.
[0066] Step 340: extract entity relationships from content features using a first neural network model to obtain entity relationships between entities.
[0067] In some embodiments, after obtaining the above content features through the information extraction layer, the relationship extraction layer in the first neural network model can extract entity relationships from the content features to obtain entity relationships between entities. The relationship extraction layer can include a graph neural network (GNN).
[0068] Through the above scheme, the legal event detection model can achieve better entity extraction effect through the legal information extraction model, and the iterative relationship between the legal event detection model and the legal information extraction model can further ensure the accuracy of legal event information recognition.
[0069] Figure 4 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Figure 4 As shown, the above step 230 may include steps 410 to 430 .
[0070] Step 410, using the sixth neural network model in the legal event detection model, a syntactic graph is determined using each entity as a node and entity relationships between entities as edges.
[0071] In some embodiments, after obtaining the above-mentioned multiple entities and entity relationships between the entities, a syntactic graph can be constructed based on the multiple entities and entity relationships between the entities through the sixth neural network model in the legal event detection model. The sixth neural network model is a syntactic graph construction model.
[0072] For example, when constructing a syntax graph, each entity is used as a node of the syntax graph, and the entity relationship between each entity is used as an edge between each node. Figure 5 A schematic diagram of a syntax diagram is shown in Figure 5 As shown, taking the first question information as "Zhang San and Li Si are neighbors. Zhang San borrowed RMB 100,000 from Li Si, and the two parties agreed to repay the loan in one year. One year later, Zhang San did not repay the loan on time and ignored Li Si's reminders", the multiple nodes in the syntactic graph corresponding to the first question information are: Zhang San, Li Si, RMB 100,000, and one year; the edges in the syntactic graph include: Zhang San---Neighbor---> Li Si, Zhang San---Loan---> RMB 100,000-Li Si, Zhang San---Breach of Contract---> One Year-Li Si, Li Si---Reminders---> Zhang San.
[0073] For example, the syntactic graph can represent all the relationships between entities (nodes), and there may be some non-core relationships, such as "Zhang San and Li Si are neighbors", etc. Therefore, the entity relationships between the entities obtained can be subsequently processed by the third neural network model, so that the entity relationships between the entities gradually converge to the core relationships between the entities, so as to exclude the non-core relationships between the entities.
[0074] Step 420, based on the syntactic graph and the initial features corresponding to each entity, the initial features corresponding to each entity are updated through multiple neural network layers in the third neural network model to obtain updated features corresponding to each entity determined by each neural network layer in the multiple neural network layers.
[0075] In some embodiments, after obtaining the above-mentioned syntax graph and the initial features corresponding to each entity determined by the BERT model, the initial features corresponding to each entity can be updated based on the syntax graph and the initial features corresponding to each entity by a third neural network model in the legal event detection model. The third neural network model may include a multi-layer graph convolutional network (GCN).
[0076] Exemplarily, the third neural network model can update the features corresponding to each entity by means of hierarchical propagation and aggregation of neighbor node features through multi-layer GCN. Taking the target node among multiple nodes as an example, the current features corresponding to the target node can be updated by the previous layer of GCN in the multi-layer GCN based on the current features corresponding to the target node and the current features corresponding to the neighbor nodes (i.e., adjacent nodes) of the target node, to obtain the updated features corresponding to the target node; and so on, until the updated features corresponding to the target node are obtained through the last layer of GCN in the multi-layer GCN. Among them, the current features corresponding to the target node in the first layer of GCN are the initial features corresponding to the target node.
[0077] Step 430, determining the updated features corresponding to each entity determined by the last neural network layer in the multiple neural network layers as the core information corresponding to each entity and the core relationship between each entity.
[0078] In some embodiments, the updated features corresponding to each entity (node) obtained by the last layer GCN in the above multi-layer GCN are the core information corresponding to each entity and the core relationship between the entities (ie, the core information corresponding to the first question information).
[0079] Through the above scheme, the initial features corresponding to each entity output by the BERT model are updated based on the syntactic graph through multi-layer GCN, which can exclude non-core entity information and non-core relationships between entities, so that better classification results can be obtained when legal events are subsequently classified based on entity information and entity relationships.
[0080] Figure 6 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Figure 6 As shown, the above step 420 may include steps 610 to 620.
[0081] Step 610, obtaining the first features corresponding to each entity determined by the first neural network layer based on the initial features corresponding to each entity, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the first neural network layer through the first neural network layer among the multiple neural network layers.
[0082] In some embodiments, taking a target node among multiple nodes and the first two layers of GCN in a multi-layer GCN as an example, the first layer of GCN (i.e., the first neural network layer) first updates the initial features corresponding to the target node based on the initial features corresponding to the target node and the initial features corresponding to the adjacent nodes of the target node, and obtains the updated initial features corresponding to the target node (i.e., the first features).
[0083] Exemplarily, the first layer GCN can update the initial features corresponding to the target node based on the adjacency matrix corresponding to the syntactic graph, the self-loop matrix, the weight matrix corresponding to the first layer GCN, and the nonlinear activation function to obtain the first features corresponding to the target node.
[0084] In some examples, the method of updating the features of each entity (node) through multi-layer GCN can refer to formula (1): ; (1) in, For the The current features corresponding to each entity (node) determined by the layer GCN ( That is, the initial features corresponding to each entity (node); For the The updated features corresponding to each entity (node) of the layer.
[0085] , is the N×N adjacency matrix corresponding to the syntactic graph, which is used to represent the connection between each node and other nodes; if there is an edge between node i and node j, then [i][j]=1, if there is no edge between node i and node j, then [i][j]=0; is an N×N identity matrix, where N is the number of nodes; It means that each node in the syntactic graph is connected to itself, that is, the characteristics of the node itself are taken into account.
[0086] yes The degree matrix is a diagonal matrix where each diagonal element [i][i] represents the degree of node i, that is, the number of edges connected to node i.
[0087] is the degree matrix The inverse square root of Normalization is performed to avoid the impact of large differences in node degrees on model training.
[0088] For the The weight matrix corresponding to the layer GCN is a trainable parameter matrix used to linearly transform node features.
[0089] A non-linear activation function, such as the Rectified Linear Unit (ReLU), enables the third neural network model to capture complex patterns.
[0090] It means that the first The current feature corresponding to the node determined by the layer GCN To disseminate and aggregate; Indicates that the node features after propagation and aggregation are linearly transformed to obtain the node features after linear transformation; the updated node features are compared with Multiplying means applying a nonlinear activation function to the linearly transformed node features to increase the expressive power of the model, thereby obtaining the updated node features .
[0091] Step 620, obtaining the second features corresponding to each entity determined by the second neural network layer based on the first features corresponding to each entity, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the second neural network layer through the second neural network layer among the multiple neural network layers.
[0092] In some embodiments, after the first layer GCN obtains the first feature corresponding to the target node, the second layer GCN (i.e., the second neural network layer) updates the first feature corresponding to the target node based on the first feature corresponding to the target node and the first features corresponding to the adjacent nodes of the target node to obtain the updated first feature corresponding to the target node (i.e., the second feature).
[0093] Through the above scheme, the multi-layer GCN structure can realize the layer-by-layer update of the relationship between entities represented by the syntactic graph and the entity context relationship represented by the initial features of the entity, thereby improving the convergence effect of the core information and core relationship of the entity.
[0094] Figure 7 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Figure 7 As shown, the above step 240 may include steps 710 to 720.
[0095] Step 710: fuse the question information feature and the core information corresponding to the first question information to obtain a fused feature.
[0096] In some embodiments, after obtaining the core information corresponding to each entity and the core features between the entities (i.e., the core information corresponding to the first question information) through multi-layer GCN, the question information features corresponding to the first question information determined based on the BERT model and the core information corresponding to the first question information can be fused to obtain a fused feature representation. Exemplarily, the fusion of the question information features and the core information corresponding to the first question information can be achieved through concatenation, weighted summation, or attention mechanism. The specific fusion method is not limited in this embodiment.
[0097] Step 720: Classify the legal events corresponding to the fusion features through the fourth neural network model to obtain target event information.
[0098] In some embodiments, after determining the above fusion features, the legal events corresponding to the fusion features can be classified through the fourth neural network model to obtain one or more target event information. The fourth neural network model is a classification model, which can be implemented based on a fully connected (FC) layer, etc., which is not limited in this embodiment.
[0099] For example, for the first question information input by the user, "Zhang San and Li Si are neighbors. Zhang San borrowed 100,000 yuan from Li Si, and both parties agreed to repay the loan in one year. One year later, Zhang San did not repay the loan on time and ignored Li Si's reminder for repayment", after being processed by the legal event detection model, it can be obtained that the target event information corresponding to the first question information is "not repaying debts".
[0100] Through the above scheme, the question information features corresponding to the first question information and the core information corresponding to the first question information are fused, so that the fourth neural network model can use the first question information as a reference in the process of classification prediction, thereby avoiding the problem of not being able to obtain accurate legal event detection results when the output of the multi-layer GCN deviates from the first question information.
[0101] Figure 8 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Figure 8 As shown, the above step 240 may include steps 810 to 840.
[0102] Step 810: Determine first event information corresponding to the first question information based on the question information feature and the core information corresponding to the first question information through a fourth neural network model.
[0103] In some embodiments, since the content of the first question information input by the user is usually colloquial, it may not be able to provide comprehensive information for legal event detection. In the case where the first question information currently input by the user lacks relevant necessary information, the event detection result obtained by the legal event detection model when performing legal event detection on the first question information is not accurate enough. Among them, necessary information refers to information used to accurately identify legal events. Therefore, in the case where the content of the first question information provided by the user lacks necessary information, the central control system can call the legal event establishment condition determination model (hereinafter referred to as the establishment condition determination model) and the legal event detection model in response to the first question information input by the user, so as to preliminarily determine the first event information corresponding to the first question information based on the question information features and the core information corresponding to the first question information through the legal event detection model (at this time, it is still impossible to determine whether the first event information is consistent with the legal event actually consulted by the user); and determine the event determination information corresponding to the first event information through the establishment condition determination model, so as to determine the necessary information missing in the first question information through the event determination information.
[0104] It can be understood that the method of determining the first event information corresponding to the first question information can refer to the description of the above steps 210 to 240, which will not be repeated here.
[0105] refer to Fig. 9 A scene diagram of legal event detection is shown in FIG. Fig. 9 As shown, taking the first question information 901 input by the user in the user interface 90 of the central control system as "I have signed a three-year shop lease contract with Party A to lease the other party's shop, but since I am not making any money now, can I request to terminate the lease contract in advance?" as an example, in the first question information 901, since the reason for the operating loss is unclear, the basis for the party's request for contract termination may be a contract deadlock or a change of circumstances. Therefore, after the first event information corresponding to the first question information 901 is determined by the legal event detection model (such as determining that the first event information is "contract termination under contract deadlock"), the event determination information corresponding to "contract termination under contract deadlock" can be determined through the establishment condition determination model, so as to determine the necessary information missing in the first question information through the event determination information.
[0106] Step 820: determine event determination information based on the first event information through the fifth neural network model, and determine and output second question information based on the event determination information and the first question information.
[0107] In some embodiments, then, the fifth neural network model (i.e., the establishment condition judgment model) can be used to determine the event judgment information based on the first event information, so that the central control system can generate corresponding second question information (or called information slot) based on the event judgment information and the first question information to ask questions to the user, so that the user can reply based on the second question information.
[0108] Using the above example, Fig. 9 As shown, if the event judgment information corresponding to "contract termination under contract deadlock" determined by the establishment condition judgment model is: 1) Although the defaulting party breached the contract first, it was not a malicious breach; 2) If the defaulting party continues to perform the contract, it will be unfair to the defaulting party; 3) The contract-abiding party refuses to terminate the contract, which violates the principle of good faith; and according to the above first question information, it can be determined that the user is the defaulting party, but it is impossible to determine the reason for the user's operating loss, so it is impossible to determine whether the user is a malicious breach of contract, and it is also impossible to determine whether continuing to perform the contract is unfair to the user. Therefore, the central control system can generate the corresponding second question information 902 according to the above 1) and 2) event judgment information and output it to the user, such as the second question information 902 can be "What is the reason for your operating loss?", "Have you fully negotiated with the other party?", etc.
[0109] Step 830: Acquire the reply information input by the user to the second question information, and determine the target question information based on the first question information and the reply information.
[0110] In some embodiments, after the user inputs reply information to the second question information output by the central control system, the legal event detection model can supplement and improve the first question information based on the reply information to obtain the target question information.
[0111] Using the above example, Fig. 9 As shown, if the reply information 903 input by the user to the second question information 902 is: "Because my capital chain is broken, I can't continue to operate. After negotiating with the other party, he insisted that I pay three years of rent", the legal event detection model can supplement the first question information 901 based on the reply information 903 to obtain the target question information, such as "I signed a three-year shop lease contract with A to rent the other party's shop, but because my capital chain is broken, I can't continue to operate. After negotiating with the other party, he insisted that I pay three years of rent. Can I ask to terminate the lease contract in advance?". If the reply information input by the user to the second question information is: "Because the municipal construction caused the road in front of the shop to be blocked", the legal event detection model can supplement the first question information based on the above reply information to obtain the target question information, such as "I signed a three-year shop lease contract with A to rent the other party's shop, but because the municipal construction caused the road in front of the shop to be blocked, can I ask to terminate the lease contract in advance?".
[0112] Step 840: Determine target event information based on the target question information features corresponding to the target question information and the core information corresponding to the target question information through a fourth neural network model.
[0113] In some embodiments, after obtaining the above-mentioned target question information, the legal event detection model can further determine the target question information characteristics corresponding to the target question information and the core information corresponding to the target question information, thereby determining the second event information based on the target question information characteristics and the core information corresponding to the target question information.
[0114] Exemplarily, the second event information determined by the legal event detection model may be the same as the first event information, or may be different from the first event information. If the second event information is the same as the first event information, the second event information or the first event information may be determined as the target event information; if the second event information is different from the first event information, the newly detected second event information is determined as the target event information.
[0115] Continuing with the above example, when the target question information is "I signed a three-year shop lease contract with Party A to rent the other party's shop, but because my capital chain broke, I cannot continue to operate. After negotiating with the other party, he insisted that I pay three years of rent. Can I request to terminate the lease contract early?", the legal event detection model can determine that the second event information corresponding to the target question information is "Contract termination under contract deadlock". Therefore, the second event information is the same as the first event information, so it can be determined that the target event information is "Contract termination under contract deadlock".
[0116] When the target question information is "A and I signed a three-year shop lease contract to rent each other's shop, but because of municipal construction, the road in front of the shop is blocked. Can I request to terminate the lease contract early?", the legal event detection model can determine that the second event information corresponding to the target question information is "change of circumstances". Therefore, the second event information is different from the first event information, so the second event information can be determined as the target event information, that is, the target event information is "change of circumstances".
[0117] In some embodiments, after determining the final target event information, the central control system can call other legal tools to perform legal case retrieval or legal article retrieval based on the target event information to provide consulting opinions to users. Fig. 9 As shown, if the target event information is determined to be "change of circumstances", the central control system can call other legal tools to retrieve and integrate legal cases or legal provisions related to contract termination under change of circumstances, obtain consulting opinions 904 and output them to the user.
[0118] Through the above scheme, when necessary information is missing in the consultation information input by the user, the event judgment information can be determined by the legal event establishment condition judgment model, and an information slot can be generated based on the event judgment information; then, the user can be interacted with in the form of questions based on the information slot, so that the user can supplement and improve the consultation information to obtain the target question information, so that the legal event detection model can obtain more accurate legal event detection results based on the target question information.
[0119] Fig.10 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Fig.10 As shown, the "determining event judgment information based on the first event information through the fifth neural network model" in the above step 820 may include steps 1010 to 1040.
[0120] Step 1010: Determine multiple preset texts associated with the first event information in a preset database based on the first event information through a fifth neural network model.
[0121] In some embodiments, after the establishment condition determination model obtains the first event information output by the legal event detection model, it can retrieve the judgment document (i.e., preset text) related to the first event information in the preset data. For example, if the first question information input by the user is "I rented A's shop and signed a three-year lease contract, but now I am losing money due to an unexpected business, can I ask to terminate the lease contract early?", and after the legal event detection model processes the first question information, the first event information obtained is "Contract termination under contract deadlock", then the establishment condition determination model can retrieve the judgment document related to "Contract termination under contract deadlock" in the preset database.
[0122] Step 1020: Process the first preset text through the fifth neural network model to obtain multiple retrieval pairs corresponding to the first preset text.
[0123] In some embodiments, the establishment condition determination model may then analyze any preset text (ie, the first preset text) among the plurality of preset texts through a large language model (LLM) to obtain a plurality of search pairs corresponding to the first preset text.
[0124] Each of the multiple search pairs includes a search identifier and a search content. The search identifier is used to represent a legal act or a legal event, such as "theft", "contract termination", "tort", etc. The search content is used to represent an entity associated with the legal act or legal event, such as "Zhang San", "5,000 yuan", "malicious breach of contract", etc. In the preset text, each legal act may correspond to one or more entities, and multiple different search pairs can be determined based on each legal act and each entity.
[0125] Step 1030: Clustering the multiple search pairs corresponding to the first preset text using a fifth neural network model to obtain multiple candidate seed search pairs.
[0126] In some embodiments, after determining the multiple search pairs corresponding to the first preset text, the condition determination model can cluster the multiple search pairs through the large language model LLM to determine multiple candidate seed search pairs. Exemplarily, in order to avoid excessive burden on the model caused by clustering multiple search pairs at one time, multiple rounds of clustering can be used to cluster the multiple search pairs, and multiple rounds of clustering can also enable the next round of clustering process to learn the clustering results of the previous round, thereby improving the clustering effect.
[0127] Exemplarily, in each round of clustering, a preset number of search pairs (including seed search pairs obtained from the previous round of clustering and unclustered search pairs) can be selected and clustered to obtain multiple search pairs corresponding to each legal category in one or more legal categories, and then seed search pairs are determined from the multiple search pairs corresponding to each legal category. The seed search pairs are representative search pairs among the multiple search pairs corresponding to each legal category. After completing the clustering of all search pairs, the final multiple candidate seed search pairs can be obtained. Each candidate seed search pair corresponds to a legal category.
[0128] Among them, the legal category can be determined according to the legal field to which the legal case belongs or the specific type of the legal case, etc. For example, the legal category may include criminal law (such as intentional injury, theft), civil law (such as contract disputes, property inheritance), administrative law (such as administrative penalties), intellectual property law (such as patents, trademarks, copyrights), labor law (such as labor contracts, work-related injury compensation), etc.; or include contracts (such as lease contract disputes, sales contract disputes, service contract disputes), torts (such as personal injury compensation, traffic accident liability), labor disputes (such as labor contract termination, unpaid overtime wages), etc. It should be noted that the specific content of the above legal categories is only an example, and this is not limited in this embodiment.
[0129] Step 1040: Determine a target seed retrieval pair that meets preset conditions from among multiple candidate seed retrieval pairs through the fifth neural network model, and determine the retrieval content of the target seed retrieval pair as event determination information.
[0130] In some embodiments, after determining the above-mentioned multiple candidate seed retrieval pairs, a target seed retrieval pair that meets the preset conditions can be determined from the above-mentioned multiple candidate seed retrieval pairs. Among them, the target seed retrieval pair can be a candidate retrieval pair with a high semantic association with the first event information, and the number of the target seed retrieval pairs can be one or more. Then, the event determination information corresponding to the first question information is determined based on the retrieval identifier and retrieval content of the above-mentioned target seed retrieval pair.
[0131] For example, if the first question information input by the user is "Can I terminate the shop lease contract?", the first event information obtained after legal event detection on the first question information is the termination of the contract under a contract deadlock, and the search identifier of the determined target seed search pair is "contract termination", and the search content is "it is obviously unfair for the defaulting party to continue to perform the contract", then the search content of the target seed search pair can be determined as the event judgment information corresponding to the first question information.
[0132] Through the above scheme, after the legal events involved in the consulting information input by the user are identified through the legal event detection model and the first event information is obtained, the corresponding event judgment information can be further determined based on the first event information through the establishment condition judgment model, so that it can be determined whether the above first event information is accurate based on the event judgment information and the consulting information.
[0133] Fig.11 A flowchart of another method for determining a legal event provided in some embodiments of the present application, such as Fig.11 As shown, the above step 1030 may include steps 1110 to 1140.
[0134] Step 1110, in the current round of clustering process, multiple first seed retrieval pairs obtained in the previous round of clustering process and multiple unclustered first retrieval pairs are obtained through the fifth neural network model.
[0135] In some embodiments, during multiple rounds of clustering of multiple retrieval pairs corresponding to the first preset text, the current round of clustering process first obtains multiple seed retrieval pairs (i.e., first seed retrieval pairs) obtained by the previous round of clustering process and multiple retrieval pairs that have not been clustered (i.e., first retrieval pairs).
[0136] For example, the number of search pairs is 1000 and the preset number is 100. In the first round of clustering, 100 search pairs are selected from the 1000 search pairs for unsupervised clustering to obtain multiple search pairs corresponding to each of the multiple legal categories, and the first seed search pairs corresponding to each legal category are determined from the multiple search pairs corresponding to each legal category. If the number of first seed search pairs is 30, then in the second round of clustering, 70 unclustered first search pairs are selected from the remaining 900 search pairs (that is, the sum of the number of first seed search pairs and first search pairs is equal to the preset number of 100), and the above 50 first seed search pairs and 70 first search pairs are clustered again.
[0137] Step 1120: Clustering the plurality of first seed search pairs and the plurality of first search pairs is performed through a fifth neural network model to obtain a plurality of second search pairs corresponding to each of the plurality of legal categories.
[0138] In some embodiments, after the above-mentioned multiple first seed search pairs and multiple first search pairs are obtained through the previous round of clustering process, the multiple first seed search pairs and multiple first search pairs are subjected to unsupervised clustering through the current round of clustering process to obtain multiple second search pairs corresponding to each of the multiple legal categories. Using the above example, after clustering the above-mentioned 50 first seed search pairs and 70 first search pairs, multiple second search pairs corresponding to each legal category can be obtained, such as multiple second search pairs corresponding to 20 legal categories.
[0139] In some examples, an upper limit value for the number of legal categories obtained in each round of clustering process may be set, such as setting the number of legal categories obtained when clustering 100 search pairs in each round to be at most 60.
[0140] In some examples, different weights may be set for the search identifier and the search content during the clustering process. For example, the weight corresponding to the search identifier may be set to be smaller than the weight corresponding to the search content (e.g., the weight corresponding to the search identifier is set to 0.4, and the weight corresponding to the search content is set to 0.6), so that the basis for the establishment condition determination model when clustering multiple search pairs will be more biased towards the search content of each search pair.
[0141] Step 1130, determining a second seed retrieval pair corresponding to each legal category among the multiple second retrieval pairs corresponding to each legal category through the fifth neural network model, and determining a plurality of unclustered second retrieval pairs among the multiple retrieval pairs based on a preset number, the plurality of first retrieval pairs and the plurality of second seed retrieval pairs.
[0142] In some embodiments, after obtaining a plurality of second search pairs corresponding to each legal category through the clustering process of the current round, a representative second seed search pair is determined from the plurality of second search pairs corresponding to each legal category.
[0143] Exemplarily, the method for determining the second seed search pairs corresponding to each legal category can be determined based on the distance between each second search pair (such as Euclidean distance), or can be obtained by semantically summarizing multiple second search pairs corresponding to each legal category through a large language model, which is not limited in this embodiment.
[0144] In some embodiments, after the current round of clustering is completed, multiple unclustered second search pairs are obtained from the multiple search pairs according to a preset number, and the sum of the number of the multiple second search pairs and the number of the multiple second seed search pairs is equal to the preset number. Using the above example, if multiple second search pairs corresponding to 20 legal categories are obtained, the number of multiple second seed search pairs determined is 20 (i.e., each legal category corresponds to a second seed search pair), and then 80 unclustered second search pairs are selected from the remaining 800 search pairs (i.e., the sum of the number of second seed search pairs and the number of second search pairs is equal to the preset number of 100), and the next round of clustering is performed on the above 20 second seed search pairs and 80 second search pairs.
[0145] Step 1140, clustering the multiple second seed retrieval pairs and the multiple second retrieval pairs in the next round of clustering process through the fifth neural network model until there are no unclustered retrieval pairs in the multiple retrieval pairs, and obtaining multiple candidate seed retrieval pairs determined by the last round of clustering process.
[0146] In some embodiments, the plurality of second seed search pairs and the plurality of second search pairs are clustered in the next round of clustering, and so on, until all the plurality of search pairs are clustered (i.e., there are no unclustered search pairs in the plurality of search pairs), and a plurality of candidate seed search pairs determined by the last round of clustering are obtained. Each of the plurality of candidate seed search pairs corresponds to a different legal category.
[0147] Through the above scheme, the condition determination model can cluster multiple retrieval pairs corresponding to the first preset text through multiple rounds of clustering, thereby improving the clustering effect, that is, obtaining more accurate classification results, and then determining more accurate event determination information based on the seed retrieval pairs.
[0148] In some embodiments, the above step 1130 of "determining a second seed retrieval pair corresponding to each legal category among multiple second retrieval pairs corresponding to each legal category through the fifth neural network model" includes: determining a semantic vector corresponding to each second retrieval pair in each legal category through the fifth neural network model; determining a total distance between each first semantic vector and the second semantic vector in each legal category based on the semantic vector corresponding to each second retrieval pair through the fifth neural network model; determining a target semantic vector with the shortest total distance to the second semantic vector among multiple first semantic vectors through the fifth neural network model, and determining the second retrieval pair corresponding to the target semantic vector as the second seed retrieval pair corresponding to each legal category.
[0149] In some embodiments, when determining the second seed search pairs corresponding to each legal category based on the distance (such as the Euclidean distance) between each second search pair, the semantic vector corresponding to each second search pair in each legal category may be determined first. For example, the semantic vector corresponding to the search content of each second search pair may be determined.
[0150] For example, in the legal category of "contract termination", the search content of the second search pair and the semantic vectors corresponding to each search content are: S1 = "Although the defaulting party breached the contract first, it was not in bad faith", V1 = [0.8, 0.5]; S2 = "It is obviously unfair for the defaulting party to continue to perform the contract", V2 = [0.7, 0.6]; S3 = "The observant party refuses to terminate the contract, which violates the principle of good faith", V3 = [0.9, 0.4]. It should be noted that the specific values of the semantic vectors corresponding to the above search contents are only examples.
[0151] In some embodiments, after determining the semantic vectors corresponding to each second search pair in each legal category, the distance (such as Euclidean distance) between the semantic vectors of each second search pair in each legal category and the semantic vectors of other second search pairs in the legal category is determined, that is, the distance between each first semantic vector and the second semantic vector in each legal category is determined, and the distance between each first semantic vector and the second semantic vector is added to obtain the total distance between each first semantic vector and the second semantic vector. The first semantic vector is a semantic vector corresponding to any second search pair among the multiple second search pairs corresponding to each legal category, and the second semantic vector is a semantic vector corresponding to a second search pair other than the second search pair corresponding to the first semantic vector.
[0152] Using the above example, in the second search pair S1, S2 and S3, the Euclidean distance between the semantic vector V1 of the second search pair S1 and the semantic vector V2 of S2 is ; The second search pair is the Euclidean distance between the semantic vector V1 of S1 and the semantic vector V3 of S3 Then the total distance between the semantic vector V1 of the second search pair S1 and the semantic vectors of the second search pair S2 and S3 is .
[0153] Similarly, the total distance between the semantic vector V2 of the second search pair S2 and the semantic vector V1 of the second search pair S1 and the semantic vector V3 of the second search pair S3 can be determined. ; and the total distance between the semantic vector V3 of the second search pair S3 and the semantic vector V1 of the second search pair S1 and the semantic vector V2 of the second search pair S2 .
[0154] In some embodiments, after obtaining the total distances corresponding to the above-mentioned first semantic vectors, the first semantic vector with the shortest total distance can be determined as the target semantic vector, and the second search pair corresponding to the target semantic vector is the second seed search pair corresponding to the legal category to which it belongs.
[0155] Using the above example, the total distance corresponding to the semantic vector V1 of the second search pair S1 is , the total distance corresponding to the semantic vector V2 of the second search pair S2 And the total distance corresponding to the semantic vector V3 of the second search pair S3 In, total distance The value of is the smallest, so the semantic vector V1 of the second search pair S1 can be determined as the target semantic vector, and the second search pair S1 is the second seed search pair in the legal category of "contract termination".
[0156] Through the above scheme, when determining the seed retrieval pair, by determining the sum of the distances between the semantic vectors of each retrieval pair in each legal category and the semantic vectors of all other retrieval pairs, and selecting the retrieval pair with the smallest sum of distances as the seed retrieval pair, the representativeness and centrality of the seed retrieval pair can be ensured, thereby ensuring the accuracy of the event judgment information determined based on the seed retrieval pair.
[0157] In some embodiments, the above step 1040 of "determining a target seed retrieval pair that meets preset conditions from multiple candidate seed retrieval pairs through the fifth neural network model" includes: determining a target confidence score for each candidate seed retrieval pair from multiple candidate seed retrieval pairs; wherein the target confidence score is related to the correlation between each candidate seed retrieval pair and the first event information, and the number of retrieval pairs in the legal category corresponding to each candidate seed retrieval pair; and determining the candidate seed retrieval pair from multiple candidate seed retrieval pairs whose target confidence score is greater than or equal to the preset score as the target seed retrieval pair.
[0158] In some embodiments, after finally obtaining the candidate seed retrieval pairs corresponding to each legal category through multiple rounds of clustering, the target confidence score of each candidate seed retrieval pair can be determined according to a preset scoring rule.
[0159] Among them, the target confidence score may be related to the degree of association between each candidate seed retrieval pair and the first event information, and the number of retrieval pairs in the legal category corresponding to each candidate seed retrieval pair. For example, the higher the degree of association between each candidate seed retrieval pair and the first event information, and the more retrieval pairs in the legal category corresponding to each candidate seed retrieval pair, the higher the target confidence score of each candidate seed retrieval pair; conversely, the lower the degree of association between each candidate seed retrieval pair and the first event information, and the fewer retrieval pairs in the legal category corresponding to each candidate seed retrieval pair, the lower the target confidence score of each candidate seed retrieval pair.
[0160] In some embodiments, then, candidate seed retrieval pairs whose target confidence scores are greater than or equal to the preset scores can be determined from multiple candidate seed retrieval pairs, and these candidate seed retrieval pairs are determined as target seed retrieval pairs. For example, if the target confidence score corresponding to candidate seed retrieval pair S1 is 80, the target confidence score corresponding to candidate seed retrieval pair S2 is 60, the target confidence score corresponding to candidate seed retrieval pair S3 is 50, the target confidence score corresponding to candidate seed retrieval pair S4 is 30, the target confidence score corresponding to candidate seed retrieval pair S5 is 70, and the preset score is 60, then the candidate seed retrieval pair S1, candidate seed retrieval pair S2, and candidate seed retrieval pair S5 whose target confidence scores are greater than or equal to 60 are target seed retrieval pairs.
[0161] Through the above scheme, the confidence score of each candidate seed retrieval pair is determined based on the correlation between each candidate seed retrieval pair and the first event information and the number of retrieval pairs in the legal category corresponding to each candidate seed retrieval pair, so that the target seed retrieval pair determined based on the confidence score of each candidate seed retrieval pair can be more relevant to the first event information and can more accurately represent each legal category, thereby further improving the accuracy of subsequent determination of whether the first event information is true based on the target seed retrieval pair.
[0162] In some embodiments, when determining the target confidence score of each candidate seed retrieval pair, the first confidence score of each candidate seed retrieval pair may be determined according to the correlation between each candidate seed retrieval pair and the first event information. The higher the correlation between each candidate seed retrieval pair and the first event information, the higher the first confidence score of each candidate seed retrieval pair.
[0163] Furthermore, the second confidence score of each candidate seed search pair can be determined according to the number of search pairs in the legal category corresponding to each candidate seed search pair. The more search pairs each candidate seed search pair corresponds to, the higher the second confidence score of each candidate seed search pair.
[0164] In some embodiments, after determining the first confidence score and the second confidence score corresponding to each candidate seed retrieval pair, the target confidence score corresponding to each candidate seed retrieval pair can be determined according to the sum of the first confidence score and the second confidence score. For example, if the first confidence score score1 corresponding to the candidate seed retrieval pair S1 is 80 and the second confidence score score2 is 60, then the target confidence score corresponding to the candidate seed retrieval pair S1 is score=score1+score2=80+60=140.
[0165] Exemplarily, different weights may be set for the first confidence score and the second confidence score, respectively, and the target confidence score may be determined based on the first confidence score, the second confidence score, and the corresponding weights. Using the above example, if the weight of the first confidence score is set to 0.6 and the weight of the second confidence score is set to 0.4, then the target confidence score corresponding to the candidate seed retrieval pair S1 is score=0.6×score1+0.4×score2=0.6×80+0.4×60=72.
[0166] In some embodiments, after obtaining multiple candidate seed retrieval pairs and determining the target confidence score of each candidate seed retrieval pair, it can be further determined whether the number of target seed retrieval pairs reaches a certain proportion in all candidate seed retrieval pairs. Exemplarily, the ratio of the number of target seed retrieval pairs to the number of all candidate seed retrieval pairs can be determined, and it can be determined whether the ratio is greater than or equal to a preset ratio. If the proportion of the target seed retrieval pair in all candidate seed retrieval pairs is greater than the preset ratio, the retrieval content of the target seed retrieval pair is determined as the event determination information corresponding to the first question information.
[0167] For example, if the total number of candidate seed search pairs is 5, the number of target seed search pairs is 3, and the preset ratio is 0.6, then the proportion of target seed search pairs in candidate seed search pairs is 3 / 5=0.6, that is, the proportion of target seed search pairs is equal to the preset ratio, so the search content of the target seed search pair can be determined as the event determination information corresponding to the first question information. If the search content of the target seed search pair S1 is "although the defaulting party breached the contract first, it was not a malicious breach of contract", the search content of the target seed search pair S2 is "the defaulting party continues to perform the contract, which is obviously unfair to it", and the search content of the target seed search pair S3 is "the abiding party refuses to terminate the contract, which violates the principle of good faith", then the event determination information corresponding to the first question information is the above search content.
[0168] In some embodiments, if the ratio of the number of target seed retrieval pairs to the number of multiple candidate seed retrieval pairs is less than a preset ratio, and the number of times multiple rounds of clustering are re-executed (i.e., the number of times clustering is cyclically executed) is less than or equal to the preset number of executions, then multiple rounds of clustering can be re-performed on the multiple retrieval pairs corresponding to the first preset text until the ratio of the number of target seed retrieval pairs to the number of multiple candidate seed retrieval pairs obtained is greater than or equal to the preset ratio, or the number of times multiple rounds of clustering are re-executed is greater than the preset number of executions.
[0169] For example, if the total number of candidate seed retrieval pairs corresponding to the first preset text is 10, the number of target seed retrieval pairs is 2, and the preset ratio is 0.6, and the preset number of executions is 5 times, then the proportion of target seed retrieval pairs in the candidate seed retrieval pairs is 2 / 10=0.2, that is, the proportion of target seed retrieval pairs is less than the preset ratio. Then, when the number of re-executions of multiple rounds of clustering is less than or equal to 5 times, the multiple retrieval pairs corresponding to the first preset text can be re-clustered for multiple rounds until the proportion of target seed retrieval pairs corresponding to the first preset text in the candidate seed retrieval pairs is greater than the preset ratio of 0.6, or the number of re-executions of multiple rounds of clustering is greater than 5 times.
[0170] In some embodiments, if after multiple re-clustering (such as the number of cyclic clustering executions is greater than a preset number of executions), the ratio of the number of target seed retrieval pairs to the number of multiple candidate seed retrieval pairs is still less than a preset ratio, then any preset text other than the first preset text (i.e., the second preset text) can be reselected from the multiple preset texts.
[0171] Similarly, the condition determination model processes the second preset text to obtain multiple search pairs corresponding to the second preset text; and performs multiple rounds of clustering on the multiple search pairs corresponding to the second preset text to determine multiple candidate seed search pairs and target seed search pairs corresponding to the second preset text. If the ratio of the number of target seed search pairs corresponding to the second preset text to the number of multiple candidate seed search pairs corresponding to the second preset text is greater than or equal to the preset ratio, the search content of the target seed search pair is determined as event determination information; if the ratio of the number of target seed search pairs corresponding to the second preset text to the number of multiple candidate seed search pairs is less than the preset ratio, and the number of clustering cycles is less than or equal to the preset number of executions, the multiple search pairs continue to be clustered. And so on, until the ratio of the number of target seed search pairs corresponding to the second preset text to the number of multiple candidate seed search pairs is greater than or equal to the preset ratio, or the number of re-executions of multiple rounds of clustering is greater than the preset number of executions.
[0172] If it is impossible to obtain a target seed retrieval pair from the second preset text that can serve as the event judgment information corresponding to the first question information, continue to obtain any preset text (i.e., the third preset text) other than the first preset text and the second preset text from the multiple preset texts, and process the third preset text...and so on, until the target seed retrieval pair corresponding to any preset text among the multiple preset texts can serve as the event judgment information corresponding to the first question information, or all the preset texts cannot provide event judgment information corresponding to the first question information.
[0173] Fig.12 A flowchart of a method for training a legal event retrieval model provided in some embodiments of the present application, such as Fig.12 As shown, the method may include steps 1210 to 1250.
[0174] Step 1210, obtaining a syntax graph sample and a target vector representation of each sample node in a plurality of nodes.
[0175] In some embodiments, when training the multi-layer GCN model in the legal event detection model, a syntactic graph sample is first obtained. The syntactic graph sample includes multiple nodes (i.e., sample nodes) and multiple edges connecting each node; each node in the syntactic graph sample represents a different entity in the legal event, such as a person, a place, a time, etc.; each edge in the syntactic graph sample represents the relationship between entities corresponding to adjacent nodes, such as the association between a person and a place. Then, the target vector representation of each sample node can be determined in a supervised or unsupervised manner, and the target vector representation is used as a reference for the subsequent multi-layer GCN output to be trained to optimize the multi-layer GCN.
[0176] Step 1220 , vectorize the multiple nodes in the syntax graph sample to obtain an initial vector representation of each sample node in the multiple sample nodes.
[0177] In some embodiments, then, the context information of each sample node may be determined through the BERT model, that is, the initial vector representation of each sample node may be determined.
[0178] It can be understood that the implementation of step 1220 can refer to the description of step 220 and will not be repeated here.
[0179] Step 1230, obtain syntactic graph samples through the third neural network model to be trained, and update the vector representation of each sample node based on the initial vector representation of each sample node and the initial vector representation of the adjacent sample nodes corresponding to each sample node through each neural network layer to be trained in the multiple neural network layers to be trained, so as to obtain the updated vector representation of each sample node determined by each neural network layer to be trained.
[0180] In some embodiments, the above-mentioned syntax graph samples and the initial vector representation of each sample node are input into the multi-layer GCN to be trained, and the initial vector representation of each sample node is updated layer by layer through each layer of GCN in the multi-layer GCN to be trained based on the initial vector representation of each sample node and the initial vector representation of the adjacent sample node corresponding to each sample node. Exemplarily, each layer of GCN can update the initial vector representation corresponding to each sample node based on the adjacency matrix corresponding to the syntax graph sample, the self-connection matrix, the weight matrix corresponding to each layer of GCN, and the nonlinear activation function, so as to obtain the updated vector representation of each sample node determined by each layer of GCN to be trained.
[0181] It can be understood that the implementation of step 1230 can refer to the description of steps 610 to 620, which will not be repeated here.
[0182] Step 1240, based on the target vector representation of each sample node and the update vector representation of each node determined by the last neural network layer in the multiple neural network layers, determine the loss function corresponding to the third neural network model to be trained.
[0183] In some embodiments, after each layer of GCN determines the update vector representation of each sample node, the loss function corresponding to the third neural network model is determined based on the update vector representation of each sample node obtained by the last layer of GCN and the target vector representation of each sample node.
[0184] Exemplarily, the loss function corresponding to the third neural network model can be determined by using a mean square error or the like, which is not limited in this embodiment. In some examples, the mean square error loss function corresponding to the third neural network model can be determined according to formula (2): ; (2) in, is the mean square error loss function, It is the updated vector representation of each sample node obtained by the last layer of GCN. is the target vector representation of each sample node.
[0185] Step 1250: Optimize the parameters in the third neural network model based on the loss function to obtain a trained third neural network model.
[0186] In some embodiments, the gradient of the loss function corresponding to the third neural network model to the parameters (including the weight matrix of each layer of GCN) can be calculated by the back propagation algorithm, and the parameters can be updated using an optimization algorithm (such as a gradient descent algorithm) to gradually reduce the loss function. Furthermore, the third neural network model can be trained in an iterative manner until the loss function of the model converges to a smaller value or reaches a preset number of training rounds.
[0187] For example, the weight matrix corresponding to each layer of GCN can be updated according to the gradient descent algorithm of formula (3): ; (3) in, is the weight matrix corresponding to each layer of GCN; is the learning rate, which is used to control the step size of each parameter update; is the loss function right The gradient of The rate of change of the loss function; Formula (3) means adjusting in the negative direction of the gradient (i.e. the direction in which the loss function decreases) .
[0188] By applying the above technical solution, the contextual relationship corresponding to each entity in the question information input by the user (that is, the initial features corresponding to each entity) can be extracted through the BERT model, and the initial features corresponding to each entity can be updated layer by layer through the multi-layer GCN model, so as to finally obtain the core information corresponding to each entity and the core relationship between each entity, and then the legal event information corresponding to the first question information can be accurately determined based on the core information corresponding to each entity and the core relationship between each entity through the classification model.
[0189] Fig.13 A schematic diagram of a device for determining a legal event provided in some embodiments of the present application. Fig.13 As shown, the legal event determination device 1300 can be configured at Figure 1 The legal event detection model shown in FIG. 1 is a legal event determination device 1300 including a first acquisition module 1310 , a first determination module 1320 , a first update module 1330 , a second determination module 1340 and a third determination module 1350 .
[0190] The first acquisition module 1310 is configured to acquire first question information input by a user, and determine multiple entities in the first question information and entity relationships between each of the multiple entities through a first neural network model in a legal event detection model.
[0191] The first determination module 1320 is configured to determine the question information features corresponding to the first question information and the initial features corresponding to each entity based on the first question information and multiple entities through the second neural network model in the legal event detection model; wherein the initial features corresponding to each entity represent the context information corresponding to each entity.
[0192] The first update module 1330 is configured to update the initial features corresponding to each entity based on the syntactic graph corresponding to the first question information and the initial features corresponding to each entity through multiple neural network layers in the third neural network model in the legal event detection model, and obtain the updated features corresponding to each entity determined by each neural network layer in the multiple neural network layers; wherein the syntactic graph includes multiple nodes and multiple edges, each node in the multiple nodes corresponds to each entity, and each edge in the multiple edges corresponds to the entity relationship between the entities.
[0193] The second determination module 1340 is configured to determine the updated features corresponding to each entity determined by the last neural network layer in the multiple neural network layers as the core information corresponding to the first question information.
[0194] The third determination module 1350 is configured to determine the target event information corresponding to the first question information based on the question information features and the core information corresponding to the first question information through the fourth neural network model in the legal event detection model.
[0195] In some embodiments, the first determination module 1320 is specifically configured to: obtain historical event information, and vectorize the historical event information through the first neural network model to obtain a supervision vector; extract features of the legal elements in the first question information through the first neural network model to obtain multiple element features corresponding to the first question information; determine the content features corresponding to the first question information based on the multiple element features and the supervision vector corresponding to the first question information through the first neural network model, and determine the content features as multiple entities; extract entity relationships from the content features through the first neural network model to obtain entity relationships between entities.
[0196] In some embodiments, the first update module 1330 is specifically configured as follows: obtaining first features corresponding to each entity determined by the first neural network layer through a first neural network layer among multiple neural network layers based on initial features corresponding to each entity, an adjacency matrix corresponding to the syntactic graph, a self-connection matrix, and a weight matrix corresponding to the first neural network layer; wherein the first neural network layer is the first neural network layer among the multiple neural network layers; obtaining second features corresponding to each entity determined by the second neural network layer through a second neural network layer among the multiple neural network layers based on the first features corresponding to each entity, an adjacency matrix corresponding to the syntactic graph, a self-connection matrix, and a weight matrix corresponding to the second neural network layer; wherein the updated features corresponding to each entity include the first features corresponding to each entity and the second features corresponding to each entity.
[0197] In some embodiments, the third determination module 1350 is specifically configured to: fuse the question information feature and the core information corresponding to the first question information to obtain a fused feature; classify the legal events corresponding to the fused feature through the fourth neural network model to obtain target event information.
[0198] In some embodiments, the third determination module 1350 is specifically configured to: determine the first event information corresponding to the first question information based on the question information characteristics and the core information corresponding to the first question information through the fourth neural network model; determine the event determination information based on the first event information through the fifth neural network model, and determine and output the second question information based on the event determination information and the first question information; obtain the reply information input by the user to the second question information, and determine the target question information based on the first question information and the reply information; determine the target event information based on the target question information characteristics corresponding to the target question information and the core information corresponding to the target question information through the fourth neural network model.
[0199] In some embodiments, the third determination module 1350 is specifically configured as follows: determining multiple preset texts associated with the first event information in a preset database based on the first event information through the fifth neural network model; processing the first preset text through the fifth neural network model to obtain multiple retrieval pairs corresponding to the first preset text; wherein the first preset text is any preset text among the multiple preset texts, and each retrieval pair in the multiple retrieval pairs includes a retrieval identifier and a retrieval content; clustering the multiple retrieval pairs corresponding to the first preset text through the fifth neural network model to obtain multiple candidate seed retrieval pairs; determining a target seed retrieval pair that meets preset conditions among the multiple candidate seed retrieval pairs through the fifth neural network model, and determining the retrieval content of the target seed retrieval pair as event judgment information.
[0200] In some embodiments, the third determination module 1350 is specifically configured to: in the clustering process of the current round, obtain multiple first seed retrieval pairs obtained in the clustering process of the previous round and multiple unclustered first retrieval pairs through the fifth neural network model; wherein the multiple retrieval pairs include multiple first seed retrieval pairs and multiple first retrieval pairs, and the sum of the number of the multiple first seed retrieval pairs and the number of the multiple first retrieval pairs is equal to a preset number; cluster the multiple first seed retrieval pairs and the multiple first retrieval pairs through the fifth neural network model to obtain multiple second retrieval pairs corresponding to each of the multiple legal categories; and cluster the multiple first seed retrieval pairs and the multiple first retrieval pairs through the fifth neural network model to obtain multiple second retrieval pairs corresponding to each of the multiple legal categories. The model determines the second seed retrieval pairs corresponding to each legal category among the multiple second retrieval pairs corresponding to each legal category, and determines the multiple unclustered second retrieval pairs among the multiple retrieval pairs according to the preset number, the multiple first retrieval pairs and the multiple second seed retrieval pairs; the multiple second seed retrieval pairs and the multiple second retrieval pairs are clustered in the next round of clustering process through the fifth neural network model until there are no unclustered retrieval pairs in the multiple retrieval pairs, and multiple candidate seed retrieval pairs determined by the last round of clustering process are obtained; wherein each candidate seed retrieval pair in the multiple candidate seed retrieval pairs corresponds to a different legal category.
[0201] In some embodiments, the third determination module 1350 is specifically configured as follows: determining the semantic vector corresponding to each second retrieval pair in each legal category through the fifth neural network model; determining the total distance between each first semantic vector and the second semantic vector in each legal category based on the semantic vector corresponding to each second retrieval pair through the fifth neural network model; wherein the first semantic vector is the semantic vector corresponding to any second retrieval pair among the multiple second retrieval pairs corresponding to each legal category, and the second semantic vector is the semantic vector corresponding to the second retrieval pair other than the second retrieval pair corresponding to the first semantic vector; determining the target semantic vector with the shortest total distance to the second semantic vector among the multiple first semantic vectors through the fifth neural network model, and determining the second retrieval pair corresponding to the target semantic vector as the second seed retrieval pair corresponding to each legal category.
[0202] In some embodiments, the third determination module 1350 is specifically configured to: determine a target confidence score for each candidate seed retrieval pair among multiple candidate seed retrieval pairs; wherein the target confidence score is related to the correlation between each candidate seed retrieval pair and the first event information, and the number of retrieval pairs in the legal category corresponding to each candidate seed retrieval pair; and determine the candidate seed retrieval pairs among multiple candidate seed retrieval pairs whose target confidence score is greater than or equal to a preset score as the target seed retrieval pair.
[0203] Fig.14 A schematic diagram of a training device for a legal event detection model provided in some embodiments of the present application. Fig.14As shown, the training device 1400 of the legal event detection model can be configured in Figure 1 The legal event detection model shown in FIG. 1400 includes a second acquisition module 1410 , a vectorization processing module 1420 , a second update module 1430 , a fourth determination module 1440 and an optimization module 1450 .
[0204] The second acquisition module 1410 is configured to acquire a syntax graph sample and a target vector representation of each sample node in a plurality of nodes.
[0205] The syntax graph sample includes multiple sample nodes.
[0206] The vectorization processing module 1420 is configured to perform vectorization processing on multiple nodes in the syntax graph sample to obtain an initial vector representation of each sample node in the multiple sample nodes.
[0207] The second updating module 1430 is configured to obtain syntactic graph samples through the third neural network model to be trained, and update the vector representation of each sample node based on the initial vector representation of each sample node and the initial vector representation of the adjacent sample nodes corresponding to each sample node through each of the multiple neural network layers to be trained, so as to obtain the updated vector representation of each sample node determined by each neural network layer to be trained.
[0208] The third neural network model to be trained includes multiple neural network layers to be trained.
[0209] The fourth determination module 1440 is configured to determine the loss function corresponding to the third neural network model to be trained based on the target vector representation of each sample node and the update vector representation of each node determined by the last neural network layer in the multiple neural network layers.
[0210] The optimization module 1450 is configured to optimize the parameters in the third neural network model based on the loss function to obtain a trained third neural network model.
[0211] Fig.15 A schematic diagram of an electronic device provided for some embodiments of the present application. In some embodiments, the electronic device includes one or more processors and a memory. The memory is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining a legal event or the method for training a legal event detection model in the above-mentioned embodiments.
[0212] like Fig.15As shown, the electronic device 1500 includes: a processor (processor) 1501 and a memory 1502. Exemplarily, the electronic device 1500 may also include: a communication interface (Communications Interface) 1503 and a communication bus 1504.
[0213] The processor 1501, the memory 1502 and the communication interface 1503 communicate with each other via the communication bus 1504. The communication interface 1503 is used to communicate with other devices such as client or other server network elements.
[0214] In some embodiments, processor 1501 is used to execute program 1505, which may specifically execute the relevant steps in the above-mentioned method for determining legal events or the method for training a legal event detection model. Specifically, program 1505 may include program code, which includes computer executable instructions.
[0215] Exemplarily, the processor 1501 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of the present application. The electronic device 1500 may include one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0216] In some embodiments, the memory 1502 is used to store the program 1505. The memory 1502 may include a high-speed RAM memory, and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0217] Program 1505 can be specifically called by processor 1501 to enable electronic device 1500 to execute a method for determining a legal event or a method for training a legal event detection model.
[0218] Some embodiments of the present application provide a computer-readable storage medium storing at least one executable instruction. When the executable instruction is executed on the electronic device 1500, the electronic device 1500 executes the method for determining legal events or the method for training a legal event detection model in the above-mentioned embodiments.
[0219] The executable instructions may be specifically used to enable the electronic device 1500 to execute a method for determining a legal event or a method for training a legal event detection model.
[0220] For example, the computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0221] The beneficial effects that can be achieved by the computer-readable storage medium provided in some embodiments of the present application can be referred to the beneficial effects of the corresponding legal event determination method or legal event detection model training method provided above, and will not be repeated here.
[0222] It should be noted that, in the application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0223] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0224] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0225] For the purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by an instruction execution system, apparatus, or device or in conjunction with such instruction execution system, apparatus, or device.
[0226] More specific examples (a non-exhaustive list) of computer readable media include the following: an electrical connection having one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).
[0227] In addition, the computer readable medium can even be a paper or other suitable medium on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, and then editing, interpreting or processing in other suitable ways as necessary, and then storing it in the computer memory. It should be understood that various parts of the present application can be implemented in hardware, software, firmware or a combination thereof.
[0228] In the above embodiments, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it may be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0229] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.
Claims
1. A method for determining a legal event, characterized in that: Applied to a legal event detection model, the method comprises: Acquire first question information input by a user, and determine a plurality of entities in the first question information and entity relationships between each of the plurality of entities through a first neural network model in the legal event detection model; Determine, through the second neural network model in the legal event detection model, based on the first question information and the multiple entities, question information features corresponding to the first question information and initial features corresponding to each of the entities; wherein the initial features corresponding to each of the entities represent context information corresponding to each of the entities; The initial features corresponding to each of the entities are updated based on the syntax graph corresponding to the first question information and the initial features corresponding to each of the entities by multiple neural network layers in the third neural network model in the legal event detection model, so as to obtain updated features corresponding to each of the entities determined by each of the neural network layers in the multiple neural network layers; wherein the syntax graph includes multiple nodes and multiple edges, each of the multiple nodes corresponds to each of the entities, and each of the multiple edges corresponds to an entity relationship between the entities; Determine the updated features corresponding to each of the entities determined by the last neural network layer in the multiple neural network layers as the core information corresponding to the first question information; The target event information corresponding to the first question information is determined based on the question information features and the core information corresponding to the first question information through the fourth neural network model in the legal event detection model.
2. The method according to claim 1, characterized in that: The determining, by using the first neural network model in the legal event detection model, multiple entities in the first question information and entity relationships between each of the multiple entities includes: Acquire historical event information, and perform vectorization processing on the historical event information through the first neural network model to obtain a supervision vector; Extracting features of legal elements in the first question information by using the first neural network model to obtain multiple element features corresponding to the first question information; Determine, by the first neural network model, content features corresponding to the first question information based on the multiple element features corresponding to the first question information and the supervision vector, and determine the content features as the multiple entities; The entity relationships between the entities are extracted by using the first neural network model from the content features to obtain entity relationships between the entities.
3. The method according to claim 1, characterized in that: The method of updating the initial features corresponding to each of the entities based on the syntactic graph corresponding to the first question information and the initial features corresponding to each of the entities through multiple neural network layers in the third neural network model in the legal event detection model, and obtaining the updated features corresponding to each of the entities determined by each of the neural network layers in the multiple neural network layers, includes: Obtaining, by a first neural network layer among the multiple neural network layers, a first feature corresponding to each of the entities determined by the first neural network layer based on initial features corresponding to each of the entities, an adjacency matrix corresponding to the syntactic graph, a self-connection matrix, and a weight matrix corresponding to the first neural network layer; wherein the first neural network layer is the first neural network layer among the multiple neural network layers; The second feature corresponding to each of the entities determined by the second neural network layer is obtained by the second neural network layer among the multiple neural network layers based on the first feature corresponding to each of the entities, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the second neural network layer; wherein the updated feature corresponding to each of the entities includes the first feature corresponding to each of the entities and the second feature corresponding to each of the entities.
4. The method according to any one of claims 1 to 3, characterized in that The determining, by using the fourth neural network model in the legal event detection model, target event information corresponding to the first question information based on the question information feature and the core information corresponding to the first question information, includes: fusing the question information feature with the core information corresponding to the first question information to obtain a fused feature; The legal events corresponding to the fusion features are classified through the fourth neural network model to obtain the target event information.
5. The method according to any one of claims 1 to 3, characterized in that: The determining, by using the fourth neural network model in the legal event detection model, target event information corresponding to the first question information based on the question information feature and the core information corresponding to the first question information, includes: Determining, by the fourth neural network model, first event information corresponding to the first question information based on the question information feature and the core information corresponding to the first question information; Determine event determination information based on the first event information through a fifth neural network model, and determine and output second question information based on the event determination information and the first question information; Acquire reply information input by the user to the second question information, and determine target question information based on the first question information and the reply information; The target event information is determined by the fourth neural network model based on the target question information features corresponding to the target question information and the core information corresponding to the target question information.
6. The method according to claim 5, characterized in that The determining the event determination information based on the first event information by the fifth neural network model includes: Determining, by the fifth neural network model, a plurality of preset texts associated with the first event information in a preset database based on the first event information; The first preset text is processed by the fifth neural network model to obtain a plurality of search pairs corresponding to the first preset text; wherein the first preset text is any preset text among the plurality of preset texts, and each of the plurality of search pairs includes a search identifier and a search content; Performing clustering processing on the multiple search pairs corresponding to the first preset text by the fifth neural network model to obtain multiple candidate seed search pairs; The fifth neural network model is used to determine a target seed retrieval pair that meets preset conditions from among the multiple candidate seed retrieval pairs, and the retrieval content of the target seed retrieval pair is determined as the event determination information.
7. The method according to claim 6, characterized in that The clustering process of the plurality of search pairs corresponding to the first preset text by the fifth neural network model to obtain a plurality of candidate seed search pairs includes: In the clustering process of the current round, the plurality of first seed retrieval pairs obtained in the clustering process of the previous round and the plurality of unclustered first retrieval pairs are obtained through the fifth neural network model; wherein the plurality of retrieval pairs include the plurality of first seed retrieval pairs and the plurality of first retrieval pairs, and the sum of the plurality of first seed retrieval pairs and the plurality of first retrieval pairs is equal to a preset number; Performing clustering processing on the plurality of first seed search pairs and the plurality of first search pairs through the fifth neural network model to obtain a plurality of second search pairs corresponding to each of the plurality of legal categories; Determine, by means of the fifth neural network model, a second seed search pair corresponding to each of the legal categories among the plurality of second search pairs corresponding to each of the legal categories, and determine a plurality of unclustered second search pairs among the plurality of search pairs according to the preset number, the plurality of first search pairs and the plurality of the second seed search pairs; The fifth neural network model is used to cluster the multiple second seed retrieval pairs and the multiple second retrieval pairs in the next round of clustering process until there are no unclustered retrieval pairs in the multiple retrieval pairs, and the multiple candidate seed retrieval pairs determined by the last round of clustering process are obtained; wherein each of the multiple candidate seed retrieval pairs corresponds to a different legal category.
8. The method according to claim 7, characterized in that Determining, by the fifth neural network model, a second seed search pair corresponding to each of the legal categories among the plurality of second search pairs corresponding to each of the legal categories comprises: Determining, by means of the fifth neural network model, a semantic vector corresponding to each of the second search pairs in each of the legal categories; Determine, by the fifth neural network model, the total distance between each first semantic vector and the second semantic vector in each legal category according to the semantic vector corresponding to each second search pair; wherein the first semantic vector is a semantic vector corresponding to any second search pair among the plurality of second search pairs corresponding to each legal category, and the second semantic vector is a semantic vector corresponding to a second search pair other than the second search pair corresponding to the first semantic vector; The fifth neural network model is used to determine a target semantic vector with the shortest total distance to the second semantic vector among the multiple first semantic vectors, and the second retrieval pair corresponding to the target semantic vector is determined as the second seed retrieval pair corresponding to each of the legal categories.
9. The method according to claim 6, characterized in that Determining a target seed retrieval pair satisfying a preset condition from among the plurality of candidate seed retrieval pairs by using the fifth neural network model includes: Determine a target confidence score for each of the plurality of candidate seed search pairs; wherein the target confidence score is related to the degree of association between each of the candidate seed search pairs and the first event information, and the number of search pairs in the legal category corresponding to each of the candidate seed search pairs; A candidate seed retrieval pair whose target confidence score is greater than or equal to a preset score among the multiple candidate seed retrieval pairs is determined as the target seed retrieval pair.
10. A training method for a legal event detection model, characterized in that: The legal event detection model includes a third neural network model, and the method includes: Obtaining a syntax graph sample and a target vector representation of each of the sample nodes in a plurality of nodes; wherein the syntax graph sample includes the plurality of sample nodes; Performing vectorization processing on a plurality of nodes in the syntax graph sample to obtain an initial vector representation of each of the plurality of sample nodes; The syntactic graph samples are obtained through a third neural network model to be trained, and the vector representation of each sample node is updated based on the initial vector representation of each sample node and the initial vector representation of the adjacent sample node corresponding to each sample node through each of the neural network layers to be trained to obtain the updated vector representation of each sample node determined by each neural network layer to be trained; wherein the third neural network model to be trained includes the multiple neural network layers to be trained; Determine a loss function corresponding to the third neural network model to be trained based on a target vector representation of each of the sample nodes and an update vector representation of each of the nodes determined by a last neural network layer in the plurality of neural network layers; Optimizing the parameters in the third neural network model based on the loss function to obtain a trained third neural network model.
11. A device for determining a legal event, characterized in that: Configured in a legal event detection model, the device comprises: A first acquisition module is configured to acquire first question information input by a user, and determine a plurality of entities in the first question information and entity relationships between each of the plurality of entities through a first neural network model in the legal event detection model; A first determination module is configured to determine, based on the first question information and the multiple entities, question information features corresponding to the first question information and initial features corresponding to each of the entities through a second neural network model in the legal event detection model; wherein the initial features corresponding to each of the entities represent context information corresponding to each of the entities; A first updating module is configured to update the initial features corresponding to each of the entities based on the syntax graph corresponding to the first question information and the initial features corresponding to each of the entities through multiple neural network layers in the third neural network model in the legal event detection model, so as to obtain updated features corresponding to each of the entities determined by each of the neural network layers in the multiple neural network layers; wherein the syntax graph includes multiple nodes and multiple edges, each of the multiple nodes corresponds to each of the entities, and each of the multiple edges corresponds to an entity relationship between the entities; A second determination module is configured to determine the updated features corresponding to each of the entities determined by the last neural network layer in the multiple neural network layers as the core information corresponding to the first question information; The third determination module is configured to determine the target event information corresponding to the first question information based on the question information features and the core information corresponding to the first question information through the fourth neural network model in the legal event detection model.
12. A training device for a legal event detection model, characterized in that: The legal event detection model includes a third neural network model, and the device includes: A second acquisition module is configured to acquire a syntax graph sample and a target vector representation of each of the sample nodes in a plurality of nodes; wherein the syntax graph sample includes the plurality of sample nodes; A vectorization processing module is configured to perform vectorization processing on a plurality of nodes in the syntax graph sample to obtain an initial vector representation of each of the plurality of sample nodes; A second updating module is configured to obtain the syntactic graph sample through a third neural network model to be trained, and update the vector representation of each sample node based on the initial vector representation of each sample node and the initial vector representation of the adjacent sample node corresponding to each sample node through each of the neural network layers to be trained in a plurality of neural network layers to be trained, so as to obtain an updated vector representation of each sample node determined by each neural network layer to be trained; wherein the third neural network model to be trained includes the plurality of neural network layers to be trained; a fourth determination module configured to determine a loss function corresponding to the third neural network model to be trained based on a target vector representation of each of the sample nodes and an update vector representation of each of the nodes determined by a last neural network layer in the plurality of neural network layers; The optimization module is configured to optimize the parameters in the third neural network model based on the loss function to obtain a trained third neural network model.
13. An electronic device, characterized in that: include: one or more processors; and A memory configured to: store one or more programs; Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining a legal event according to any one of claims 1-9, or implement the method for training a legal event detection model according to claim 10.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for determining a legal event according to any one of claims 1 to 9 is implemented, or the method for training a legal event detection model according to claim 10 is implemented.
Citation Information
Patent Citations
Event detection method and device based on graph perturbation strategy
CN113988052A
Legal document generation method and system based on reading understanding and intention recognition model
CN114297342A
Class case semantic retrieval method and system, electronic equipment and storage medium
CN116361414A
Text processing method and device based on multi-round questions and answers, equipment and storage medium
CN116578688A
Event extraction model and military event type prediction method
CN118277574A