Entity and entity relationship determination method based on context information and information extraction model training method
Through the entity and entity relationship determination method and neural network model based on context information, the accuracy of entity and entity relationship extraction in legal consultation scenarios is solved, and efficient extraction of legal entity information and accurate support for legal event detection is achieved.
Patent Information
- Application Number
- CN202510543848.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-08-15
AI Technical Summary
The existing named entity recognition and relationship extraction models are difficult to accurately extract legal entity information in legal consultation scenarios, especially when the consultation information entered by the user is long and in the form of discontinuous characters, it is impossible to effectively identify legal entities and entity relationships.
The entity and entity relationship determination method based on context information is adopted, and the iterative relationship between the information input by the user is extracted and the entity relationship extracted through remote supervision and legal element extraction, combined with the neural network model, and the graph neural network is used to infer and extract complex relationships between entities, and an iterative relationship between the information extraction model and the legal event detection model is established.
It improves the accuracy of the extraction of entities and entity relationships in the legal consultation scenario, enhances the accuracy and effectiveness of the extraction of legal information, and can better support the legal consultation system to provide accurate legal opinions.
Smart Images

Figure CN120494077A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202510005472.4, and the original application date is January 3, 2025. The entire content of the original application is incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a method for determining entities and entity relationships based on contextual information and a method for training an information extraction model. Background Art
[0003] In legal consultation scenarios, users can consult the legal consultation system for information related to legal cases. When generating responses based on the user's input, the legal consultation system needs to detect the legal events involved in the consultation information. Legal events refer to the legal relationships that may involve legal entities. Based on the identified legal events, the legal consultation system can further process the consultation information (such as retrieving relevant cases and legal basis) to provide users with accurate advice. Summary of the Invention
[0004] The present application provides a context-based entity and entity relationship identification method and an information extraction model training method. This method can accurately obtain the core information of each entity and the core relationships between entities in the user's input question information, thereby improving the accuracy of determining legal events in the question information. Specifically, the present application discloses the following technical solutions:
[0005] A first aspect of an embodiment of the present application provides a method for determining entities and entity relationships based on contextual information, the method comprising: obtaining question information input by a user and first event information corresponding to the question information; performing vectorization processing on the first event information to obtain a supervision vector corresponding to the first event information; performing feature extraction on the legal elements in the question information to obtain multiple element features corresponding to the question information; determining multiple first entities corresponding to the question information based on the supervision vector corresponding to the first event information and the multiple element features; determining the entity relationship between each of the multiple first entities based on the multiple first entities; determining the second event information corresponding to the question information based on the entity relationship between the multiple first entities and each of the first entities; in a case where the second event information is the same as the first event information, determining the multiple first entities as the multiple target entities corresponding to the question information, and determining the entity relationship between each of the first entities as the entity relationship between each of the multiple target entities corresponding to the question information.
[0006] In some embodiments, the feature extraction of the legal elements in the question information to obtain multiple element features corresponding to the question information includes: feature extraction of multiple types of legal elements in the question information through multiple element extraction models to obtain the multiple element features; wherein each of the multiple element models is used to extract different types of element features.
[0007] In some embodiments, the above-mentioned determination of the multiple first entities corresponding to the above-mentioned question information based on the supervision vector corresponding to the above-mentioned first event information and the above-mentioned multiple element features includes: concatenating or dot-multiplying the supervision vector corresponding to the above-mentioned first event information with each of the above-mentioned element features to obtain the above-mentioned multiple first element features; using an attention mechanism to adjust the weight of each of the above-mentioned multiple first element features to obtain multiple second element features after weight adjustment; performing feature fusion processing on the above-mentioned multiple second element features to obtain content features, and determining the above-mentioned multiple first entities based on the above-mentioned content features.
[0008] In some embodiments, the above-mentioned determination of the above-mentioned multiple first entities based on the above-mentioned content features includes: performing sequence annotation on the above-mentioned content features to obtain multiple label sequences corresponding to the above-mentioned content features; wherein each of the above-mentioned label sequences includes multiple label information; based on the multiple label information corresponding to each of the above-mentioned label sequences, determining the transition probability corresponding to each of the above-mentioned label sequences; wherein the above-mentioned transition probability is used to characterize the dependency relationship between the multiple label information corresponding to each of the above-mentioned label sequences; based on the transition probability corresponding to each of the above-mentioned label sequences, determining the conditional probability corresponding to each of the above-mentioned label sequences; based on the conditional probability corresponding to each of the above-mentioned label sequences, determining the target label sequence in the above-mentioned multiple label sequences, and determining the above-mentioned multiple first entities according to the above-mentioned target label sequence.
[0009] In some embodiments, the above-mentioned determination of the second event information corresponding to the above-mentioned question information based on the above-mentioned multiple first entities and the entity relationships between each of the above-mentioned first entities includes: determining the question information characteristics corresponding to the above-mentioned question information and the initial characteristics corresponding to each of the above-mentioned first entities based on the above-mentioned question information and the above-mentioned multiple first entities; wherein the initial characteristics corresponding to each of the above-mentioned first entities are used to characterize the context information corresponding to each of the above-mentioned first entities; determining the core information corresponding to the above-mentioned question information based on the above-mentioned multiple first entities, the entity relationships between each of the above-mentioned first entities and the initial characteristics corresponding to each of the above-mentioned first entities; determining the above-mentioned second event information based on the above-mentioned question information characteristics and the core information corresponding to the above-mentioned question information.
[0010] In some embodiments, the core information corresponding to the question information includes the core information corresponding to each of the first entities in the question information and the core relationship between each of the first entities; the above-mentioned determination of the core information corresponding to the question information based on the multiple first entities, the entity relationships between the first entities and the initial features corresponding to the first entities includes: determining a syntactic graph with each of the first entities as a node and the entity relationships between the first entities as an edge; updating the initial features corresponding to each of the first entities based on the syntactic graph and the initial features corresponding to the first entities through multiple neural network layers to obtain updated features of each of the nodes determined by each of the multiple neural network layers; determining the updated features of each of the nodes determined by the last neural network layer in the multiple neural network layers as the core information corresponding to each of the first entities and the core relationship between the first entities.
[0011] In some embodiments, the above-mentioned multiple neural network layers are used to update the initial features corresponding to each of the above-mentioned first entities based on the above-mentioned syntax graph and the initial features corresponding to each of the above-mentioned first entities, so as to obtain updated features of each of the above-mentioned nodes determined by each of the above-mentioned neural network layers in the above-mentioned multiple neural network layers, including: obtaining the first features of each of the above-mentioned nodes determined by the above-mentioned first neural network layer based on the initial features corresponding to each of the above-mentioned nodes, the adjacency matrix corresponding to the above-mentioned syntax graph, the self-connection matrix and the weight matrix corresponding to the above-mentioned first neural network layer in the above-mentioned multiple neural network layers; 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 of each of the above-mentioned nodes determined by the above-mentioned second neural network layer based on the first features of each of the above-mentioned nodes, the adjacency matrix corresponding to the above-mentioned syntax graph, the self-connection matrix and the weight matrix corresponding to the above-mentioned second neural network layer in the above-mentioned multiple neural network layers; wherein the updated features of each of the above-mentioned nodes include the first features of each of the above-mentioned nodes and the second features of each of the above-mentioned nodes.
[0012] In some embodiments, the second event information is determined based on the question information features and the core information corresponding to the question information, including: fusing the question information features and the core information corresponding to the question information to obtain fused features; classifying the legal events corresponding to the fused features to obtain the second event information.
[0013] In some embodiments, the above method also includes: when the above second event information is different from the above first event information, determining the multiple second entities corresponding to the above question information and the entity relationship between each of the above second entities in the above multiple second entities based on the above second event information; determining the third event information corresponding to the above question information based on the above multiple second entities and the entity relationship between each of the above second entities; when the above third event information is the same as the above second event information, determining the above multiple second entities as the multiple target entities corresponding to the above question information, and determining the entity relationship between each of the above second entities as the entity relationship between each of the above target entities in the multiple target entities corresponding to the above question information.
[0014] A second aspect of an embodiment of the present application provides a training method for an information extraction model, which is applied to an information extraction model to be trained, and the method includes: obtaining a training text, a target entity corresponding to the training text, and legal event information; vectorizing the legal event information to obtain a supervision vector, and performing feature extraction on the legal elements in the training text to obtain multiple element features corresponding to the training text; determining multiple predicted entities in the training text based on the supervision vector and the multiple element features; determining a first loss function corresponding to the information extraction model based on the multiple predicted entities and the multiple target entities; and optimizing the parameters in the first loss function to determine the trained information extraction model.
[0015] In some embodiments, the above method also includes: obtaining the true label sequence corresponding to the above training text, and determining the conditional probability corresponding to the above true label sequence based on the above true label sequence; determining the second loss function corresponding to the above information extraction model based on the above conditional probability; the above optimization of the parameters in the above first loss function to determine the trained information extraction model includes: optimizing the parameters in the above first loss function and the above second loss function to determine the above trained information extraction model.
[0016] According to a third aspect of an embodiment of the present application, there is provided an entity and entity relationship determination device based on contextual information, the device comprising: a first acquisition module configured to acquire question information input by a user and first event information corresponding to the question information; a first processing module configured to perform vectorization processing on the first event information to obtain a supervision vector corresponding to the first event information; a feature extraction module configured to perform feature extraction on legal elements in the question information to obtain multiple element features corresponding to the question information; a first determination module configured to determine multiple first entities corresponding to the question information based on the supervision vector corresponding to the first event information and the multiple element features, and determine the entity relationship between each of the multiple first entities based on the multiple first entities; a second determination module configured to determine second event information corresponding to the question information based on the multiple first entities and the entity relationship between each of the first entities; and a third determination module configured to, when the second event information is the same as the first event information, determine the multiple first entities as multiple target entities corresponding to the question information, and determine the entity relationship between each of the first entities as the entity relationship between each of the multiple target entities corresponding to the question information.
[0017] The fourth aspect of an embodiment of the present application provides a training device for an information extraction model, which is configured for the information extraction model to be trained, and the device includes: a second acquisition module, configured to acquire a training text, a target entity corresponding to the above training text, and legal event information; a second processing module, configured to vectorize the above legal event information to obtain a supervision vector, and perform feature extraction on the legal elements in the above training text to obtain multiple element features corresponding to the above training text; a fourth determination module, configured to determine multiple predicted entities in the above training text based on the above supervision vector and the above multiple element features; a fifth determination module, configured to determine a first loss function corresponding to the above information extraction model based on the above multiple predicted entities and the above multiple target entities; an optimization module, configured to optimize the parameters in the above first loss function to determine the trained information extraction model.
[0018] 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 entity and entity relationship determination method based on contextual information described in the first aspect above, or implement the information extraction model training method described in the second aspect above.
[0019] 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 entity and entity relationship determination method based on context information described in the first aspect, or implements the information extraction model training method described in the second aspect.
[0020] 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 entity and entity relationship determination method based on context information described in the first aspect, or implements the information extraction model training method described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. 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 any creative work.
[0022] Figure 1 A schematic diagram of an information extraction model provided in some embodiments of the present application;
[0023] Figure 2 A flowchart of a method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application;
[0024] Figure 3 A flowchart of another method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application;
[0025] Figure 4 A flowchart of another method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application;
[0026] Figure 5 A flowchart of another method for determining entities and entity relationships based on context information provided in some embodiments of the present application;
[0027] Figure 6 A flowchart of another method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application;
[0028] Figure 7 A schematic diagram of a syntax diagram provided for some embodiments of the present application;
[0029] Figure 8A flowchart of another method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application;
[0030] Figure 9 A flowchart of a method for training an information extraction model provided in some embodiments of the present application;
[0031] Figure 10 A flowchart of another information extraction model training method provided in some embodiments of the present application;
[0032] Figure 11 A schematic diagram of an entity and entity relationship determination device based on context information provided in some embodiments of the present application;
[0033] Figure 12 A schematic diagram of a training device for an information extraction model provided in some embodiments of the present application;
[0034] Figure 13 This is a schematic diagram of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION
[0035] 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 easy to understand, the technical solutions in the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0036] Existing named entity recognition (NER) and relation extraction (RE) models typically focus only on common entity information such as names of people, places, and organizations when extracting entities and entity relationships, respectively. However, in legal consultation scenarios, legal entity information needs to be extracted, and this information varies across different legal cases. For example, the legal entity information involved in civil tort cases may include the tortious act, damage facts, causal relationships, and subjective fault; while the legal entity information involved in criminal cases may include the object of the crime, objective aspects of the crime, the subject of the crime, and subjective aspects of the crime. Therefore, extracting legal entity information using NER and RE models is complex, and supervised learning cannot be used to teach the models the entities and entity relationships to extract. Furthermore, the legal information in user-entered consultation information is often lengthy and does not appear in a continuous string. This means that legal entity information often overlaps to varying degrees, further hindering the ability of traditional NER and RE models to effectively extract legal entity information and entity relationships.
[0037] Based on the above technical problems, this application provides a method for determining entities and entity relationships based on contextual information and a training method for information extraction models, which can improve the accuracy of entity and entity relationship extraction in legal consulting scenarios through remote supervision and legal element extraction.
[0038] 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 entity and entity relationship determination method based on contextual information and the information extraction model provided in this application are only used to form consulting opinions for users' reference.
[0039] Figure 1 A schematic diagram of an information extraction model provided in some embodiments of the present application. Figure 1 As shown, the information extraction model 100 may include an entity extraction layer 10 and an entity relationship extraction layer 11. The entity extraction layer 10 includes a supervision model 110 and a content model 120; the entity relationship extraction layer 11 includes a graph neural network (GNN) model 130. The entity extraction layer 10 is used to identify entities in the user's input question information; the entity relationship extraction layer 11 is used to determine the entity relationships between entities based on the entities in the question information.
[0040] For example, after a user inputs legal consulting information (hereinafter referred to as question information) into a legal consulting system (hereinafter referred to as the central control system), the central control system may call corresponding legal tools to process the question information to obtain processing results, thereby summarizing the processing results obtained by each legal tool, obtaining a final consulting opinion, and outputting it to the user. Among them, the legal tool may include a legal event detection model 140 and an information extraction model 100. The legal event detection model 140 may identify the legal event information involved in the question information input by the user, so that the central control system may search for legal cases or legal provisions based on the identified legal event information to provide legal consulting opinions to the user. The information extraction model 100 may extract entities and entity relationships in the question information when the legal event detection model 140 performs legal event detection on the question information input by the user, so that the legal event detection model 140 performs legal event detection based on the entities and entity relationships in the question information.
[0041] Exemplarily, after the central control system calls the information extraction model 100 and the legal event detection model 140, the information extraction model 100 first obtains the question information input by the user and the legal event detection result (i.e., the first event information) obtained in the previous legal event detection process, and performs feature extraction on the first event information through the supervision model 110 in the entity extraction layer 10 to obtain a supervision vector. Next, the content model 120 in the entity extraction layer 10 performs feature extraction on the legal elements in the question information to obtain multiple element features; then, the content model 120 determines the content features based on the multiple element features and the supervision vector; wherein, the content features are the entity information corresponding to the question information. Afterwards, the GNN model 130 in the entity relationship extraction layer 11 performs entity relationship extraction on the content features to obtain the entity relationships between the entities.
[0042] For example, taking the 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 in one year. One year later, Zhang San failed to repay the loan on time and ignored Li Si's reminders for payment", after the information extraction model 100 performs entity extraction on the 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 (repayment behavior).
[0043] Exemplarily, the first entity corresponding to the question information obtained by the information extraction model 100 and the entity relationship between the first entities are further input into the legal event detection model 140. The legal event detection model 140 can determine the legal event information (i.e., the second event information) corresponding to the question information based on the above-mentioned first entity and the entity relationship between the first entities.
[0044] If the second event information is the same as the first event information, the multiple first entities can be determined as the multiple real entities corresponding to the question information (i.e., target entities), and the entity relationships between the first entities can be determined as the real entity relationships corresponding to the question information (i.e., the entity relationships between the target entities in the multiple target entities). Furthermore, the central control system can further search for legal cases or legal provisions based on the second event information to provide legal advice to the user.
[0045] In the case where the second event information is different from the first event information, the information extraction model 100 can extract legal information (including entities and entity relationships) from the question information again based on the second event information, and determine the legal event information corresponding to the question information (i.e., the third legal event information) based on the second entity and the entity relationship between the second entities obtained by the information extraction through the legal event detection model 140. In the case where the third event information is the same as the second event information, the multiple second entities are determined as the multiple target entities corresponding to the question information, and the entity relationship between the second entities is determined as the entity relationship between the target entities corresponding to the question information; in the case where the third event information is different from the second event information, the information extraction model 100 continues to extract legal information based on the third event information... and so on, until the legal event information determined by the previous legal event detection is the same as the legal event information determined by the next legal event detection.
[0046] Through the above scheme, different types of legal element features in the question information can be extracted through the content model in the information extraction model, and multiple types of element features can be remotely supervised through the supervision model in the information extraction model to obtain content features. The content features can more accurately represent the entity information corresponding to the question information, thereby improving the accuracy of entity and entity relationship extraction in legal consultation scenarios.
[0047] The following is a detailed description of the entity and entity relationship determination method based on context information provided by this application.
[0048] Figure 2 A flowchart of a method for determining entities and entity relationships based on contextual information is provided in some embodiments of the present application, such as Figure 2 As shown, the method for determining entities and entity relationships based on context information may include steps 210 to 260.
[0049] Step 210: Acquire the question information input by the user and the first event information corresponding to the question information.
[0050] In some embodiments, the information extraction model may obtain the question information input by the user and the first event information corresponding to the question information determined by the legal event detection model. Specifically, when the legal event detection model processes the question information for the first time, the first event information may be the legal event detection result obtained by previously performing legal event detection on other question information. When the legal event detection model processes the question information for a non-first time, the first event information may be the legal event detection result obtained by performing a previous round of legal event detection on the question information.
[0051] Step 220: perform vectorization processing on the first event information to obtain a supervision vector corresponding to the first event information.
[0052] In some embodiments, a supervision model within the information extraction model can vectorize the first event information to obtain a supervision vector corresponding to the first event information. The supervision model can be composed of a BERT model or a Transformer model; the supervision vector is used to assist the content model in more accurately determining entity information within the question information.
[0053] Exemplarily, when the supervision model determines the supervision vector corresponding to the first event information, it can determine the legal information type corresponding to the first event information, and perform feature extraction (i.e., vectorization processing) on the legal information type to obtain the supervision vector.
[0054] In some examples, the following is an example of a user-inputted question: "A new chemical plant was built upstream of my home this year. The output of my fish pond has dropped significantly compared to previous years. Some people in the village said that this was related to the illegal discharge of pollutants by the chemical plant. However, we went to the factory to ask, and the person in charge insisted that they were discharging legally and that the change in fish pond output was caused by the climate. We have no evidence now, so what should we do?" In the field of civil torts, the constituent elements of a general tort incident (i.e., the type of legal information) include tortious behavior, damage facts, causal relationship, subjective fault, etc. When the legal event detection model determines that the first event information corresponding to the above question information is "environmental pollution tort", the supervision model can determine that the legal information types corresponding to "environmental pollution tort" include tortious behavior, damage facts, and causal relationship, and determine the supervision vector corresponding to the above legal information types. In addition, since the burden of proof is reversed in the causal relationship of "environmental pollution infringement" incidents, when a user suffers losses due to environmental pollution and becomes the infringed party, there is no need to extract information related to the fault of the infringer during the legal information extraction process, and the attention to the causal relationship should be low, or the causal relationship can be ignored, that is, the supervision model can mark the causal relationship in the legal information type corresponding to the above-mentioned first event information as low attention.
[0055] Step 230 : extracting features of the legal elements in the question information to obtain multiple element features corresponding to the question information.
[0056] In some embodiments, the content model within the information extraction model can extract different types of legal elements from the question information to obtain multiple element features corresponding to the question information. That is, each of the multiple element features corresponds to a different type. Legal elements refer to common content across different legal fields. For example, various types of legal elements can include subject, object, behavior, subject, and subjective intent.
[0057] Continuing with the above example, after feature extraction of the user-entered question information in the content model, multiple different element features can be obtained, such as user-infringed party, chemical plant-infringer, environmental pollution infringement, legal chemical plant, climate-induced changes in output, etc. These element features cover all possible entities in the question information and the relationships between them.
[0058] Step 240 : determining a plurality of first entities corresponding to the question information based on the supervision vector corresponding to the first event information and a plurality of element features, and determining entity relationships between the plurality of first entities based on the plurality of first entities.
[0059] In some embodiments, after obtaining the multiple element features and supervision vectors corresponding to the question information, the content model can further fuse the multiple element features and supervision vectors to obtain content features corresponding to the question information. The content features represent the multiple first entities corresponding to the question information.
[0060] Continuing with the previous example, after obtaining the multiple feature elements and supervision vectors corresponding to the question information, the content model can remotely supervise each feature element using the supervision vectors. The feature fusion layer within the content model then assigns weights to each feature element. For example, it assigns higher weights to features related to the infringement and damage, lower weights to features related to causation, and ignores the remaining features. Finally, the weighted features are fused together to produce the content feature. This content feature primarily characterizes the chemical plant's pollution discharge and the user's fish pond property damage, while providing relatively weaker representation of the causal relationship between climate-induced product changes, indicating that this causal relationship does not warrant further attention in subsequent reasoning. In this way, the content feature output by the content model represents the key elements of the environmental pollution infringement relationship between the user and the chemical plant, while excluding irrelevant entities and entity relationships, such as the chemical plant's self-defense, thereby further improving the accuracy of subsequent legal event detection.
[0061] In some embodiments, after determining multiple first entities corresponding to the question information through the supervision model and content model in the information extraction model, the entity relationship between the first entities is determined based on the multiple first entities corresponding to the question information through the graph neural network GNN in the information extraction model.
[0062] Exemplarily, the graph neural network GNN can construct a corresponding graph representation based on multiple first entities in the question information and the entity relationships between the first entities. Among them, each node in the graph representation is used to represent each first entity, and each edge in the graph representation is used to represent the entity relationship between the first entities. The graph neural network GNN can use the information transmission mechanism to update the features of each node (entity) in the graph representation one by one, that is, based on the neighboring nodes corresponding to each node (that is, the nodes connected to it by edges) and the relationship between the node and the neighboring node. After multiple information transmissions, the global features of each node are finally obtained; the graph neural network GNN can predict the relationship between each first entity based on the global features of each first entity to obtain the entity relationship between each first entity.
[0063] Step 250: Determine second event information corresponding to the question information based on the multiple first entities and the entity relationships between the first entities.
[0064] In some embodiments, after obtaining multiple first entities corresponding to the question information and the entity relationships between each first entity through the information extraction model, the multiple first entities and the entity relationships between each first entity can be further input into the legal event detection model, so that the legal event detection model can be used to perform legal event detection on the question information again based on the multiple first entities and the entity relationships between each first entity to determine the second event information corresponding to the question information.
[0065] Exemplarily, when the legal event detection model performs legal event detection on question information, it can extract the contextual relationship corresponding to each entity (such as the first entity) in the question information (that is, the initial features corresponding to each entity); then, it updates the initial features corresponding to each entity by adopting hierarchical propagation and aggregation of neighboring nodes to obtain the core information corresponding to each entity and the core relationship between each entity; thereafter, based on the core information corresponding to each entity and the core relationship between each entity, it determines the legal event information (such as the second event information) corresponding to the question information.
[0066] In step 260, when the second event information is the same as the first event information, multiple first entities are determined as multiple target entities corresponding to the question information, and the entity relationship between the first entities is determined as the entity relationship between the target entities in the multiple target entities corresponding to the question information.
[0067] In some embodiments, if the second event information is the same as the first event information, the multiple first entities can be determined as the multiple target entities corresponding to the question information, and the entity relationships between the first entities can be determined as the entity relationships between the multiple target entities corresponding to the question information. Furthermore, the central control system can further search for legal cases or legal provisions based on the second event information to provide legal advice to the user.
[0068] In the case where the second event information is different from the first event information, the information extraction model can be used to extract legal information (including entities and entity relationships) from the question information again based on the second event information, and the legal event detection model can be used to determine the third legal event information corresponding to the question information based on the second entity and the entity relationship between the second entities obtained from the information extraction. In the case where the third event information is the same as the second event information, the multiple second entities are determined as the multiple target entities corresponding to the question information, and the entity relationship between the second entities is determined as the entity relationship between the multiple target entities corresponding to the question information; in the case where the third event information is different from the second event information, the information extraction model is used to continue to extract legal information based on the third event information... and so on, until the legal event information determined by the previous legal event detection is the same as the legal event information determined by the next legal event detection.
[0069] Through the above scheme, different types of legal element features in the question information can be extracted through the content model in the information extraction model, and multiple types of element features can be remotely supervised by the supervision model in the information extraction model to obtain content features. The content features can more accurately represent the entity information corresponding to the question information, thereby improving the accuracy of entity and entity relationship extraction in legal consultation scenarios. In addition, the GNN model in the information extraction model can realize the reasoning and extraction of relationships between complex entities, thereby improving the accuracy and effectiveness of legal information extraction. In addition, by establishing an iterative relationship between the information extraction model and the legal information detection model, the accuracy and effectiveness of legal information extraction can be further ensured by comparing the results of two legal event detections.
[0070] In some embodiments, the above step 230 includes: extracting features of various types of legal elements in the question information using multiple element extraction models to obtain multiple element features.
[0071] In some embodiments, the content model in the information extraction model may include multiple element extraction models, each of which is used to extract different types of legal elements in the question information to obtain multiple different types of element features corresponding to the question information.
[0072] For example, when classifying legal elements in question information, each factor model can automatically complete the classification based on a large amount of training data, so that each factor model focuses on specific factor features. Furthermore, each factor model can be manually labeled to identify the required factor features to enhance the model's classification performance.
[0073] Through the above scheme, by training multiple feature extraction models dedicated to extracting corresponding types of feature features, different types of feature features in question information can be extracted through different feature extraction models, thereby improving the accuracy of feature feature extraction.
[0074] Figure 3 A flowchart of another method for determining entities and entity relationships based on contextual information provided in some embodiments of the present application, such as Figure 3 As shown, in the above step 240 , “determining multiple first entities corresponding to the question information based on the supervision vector corresponding to the first event information and multiple element features” may include steps 310 to 330 .
[0075] Step 310 : performing concatenation or dot multiplication processing on the supervision vector corresponding to the first event information and each element feature to obtain a plurality of first element features.
[0076] In some embodiments, after obtaining the aforementioned supervision vector and multiple element features, the content model can concatenate or perform a dot product process on each element feature with the supervision vector to obtain multiple first element features, thereby achieving remote supervision of each element feature through the supervision vector. Concatenating each element feature with the supervision vector can preserve the original element features while adding the supervision vector; performing a dot product process on each element feature with the supervision vector can strengthen or weaken each element feature through the supervision vector, that is, increase or decrease the weight of each element feature.
[0077] For example, if the question information input by the user is "the pollution discharge from the upstream chemical plant has caused a sharp drop in the output of my fish pond, but the chemical plant claims that the discharge is legal", if the first event information is "environmental pollution infringement", then the supervision vector vectorizes the legal event type corresponding to "environmental pollution infringement" (including infringement behavior, damage facts and causal relationship), and the obtained supervision vector S = [s1, s2, ..., s n ]. If the element features obtained after each element extraction model processes the question information are: Chemical Plant F1 = [f 11 ,f 12 ,…,f 1n ]、Fishpond F2=[f 21 ,f 22 ,…,f 2n]、Sewage F3=[f 31 ,f 32 ,…,f 3n ] etc., then the above supervision vector S and each element feature F i After splicing, the first element features F can be obtained. i ′=[F i ; S]; for the above supervision vector S and each element feature F i Performing dot multiplication, we can get the first element features F after dot multiplication i ′=[F i ·S].
[0078] In step 320 , an attention mechanism is used to adjust the weight of each first factor feature in the plurality of first factor features to obtain a plurality of second factor features after weight adjustment.
[0079] In some embodiments, the content model may further include a feature fusion layer. The feature fusion layer may use an attention mechanism to assign weights to each first element feature according to its importance, thereby obtaining a plurality of second element features after weight adjustment.
[0080] For example, the feature fusion layer can use the attention mechanism to assign higher weights to the first-factor features with higher importance among the first-factor features (such as infringement and damage facts), and assign lower weights to the first-factor features with lower importance (such as causal relationships), thereby improving the accuracy of legal information extraction and further improving the accuracy of legal event detection.
[0081] Step 330 : Perform feature fusion processing on the multiple second factor features to obtain content features, and determine multiple first entities based on the content features.
[0082] In some embodiments, after obtaining the plurality of second factor features, the plurality of second factor features are further fused by a feature fusion layer to obtain content features. The content features can characterize the plurality of first entities in the question information, such as "upstream chemical plant," "sharp drop in fish pond production," "pollution discharge," "legal discharge," etc.
[0083] Through the above scheme, after obtaining multiple factor features corresponding to the question information through multiple factor extraction models, the weights of each factor feature can be further adjusted through the supervision vector and attention mechanism to strengthen or weaken the representation of each factor feature, thereby improving the accuracy of legal information extraction.
[0084] Figure 4 A flowchart of another method for determining entities and entity relationships based on context information is provided in some embodiments of the present application, such as Figure 4As shown, the “determining multiple first entities according to content characteristics” in the above step 330 may include steps 410 to 440 .
[0085] Step 410 : perform sequence labeling on the content features to obtain multiple label sequences corresponding to the content features.
[0086] In some embodiments, based on the above-mentioned feature fusion layer, a conditional random field (CRF) layer can also be set in the content model. After the content features are obtained through the feature fusion layer, the content features can also be sequence-labeled through the CRF layer to obtain multiple different sequence labeling results, that is, multiple different label sequences. Each label sequence includes multiple label information.
[0087] For example, taking the content feature "pollution discharge from an upstream chemical plant caused a sharp drop in fish pond production, but the chemical plant claims that the discharge is legal" as an example, if the preset label set includes B-subject (entities of the subject category are marked as B), B-behavior, B-damage fact, I-behavior (internal supplementary information of the behavior) and O-non-entity, then the multiple label sequences obtained by the CRF layer through sequence annotation of the above content features according to the above preset label set may include:
[0088] Y1 = {B-subject (upstream chemical plant), B-action (discharge of pollutants), O-non-entity (cause), B-damage fact (sharp drop in fish pond production), B-subject (upstream chemical plant), O-non-entity (claim), I-action (legal discharge)};
[0089] Y2 = {B-subject (upstream chemical plant), B-subject (discharge of pollutants), B-behavior (causing), B-damage fact (sharp drop in fish pond production), B-subject (upstream chemical plant), B-subject (claim), I-behavior (legal discharge)};
[0090] Y3 = {B-behavior (upstream chemical plant), B-subject (pollution discharge), O-non-entity (cause), I-behavior (sharp drop in fish pond output), B-subject (upstream chemical plant), O-non-entity (claim), B-damage fact (legal discharge)}, etc.
[0091] Step 420 : Determine the transition probability corresponding to each label sequence based on the plurality of label information corresponding to each label sequence.
[0092] In some embodiments, after obtaining multiple label sequences, the CRF layer can determine the transition probability (or transition score) between the multiple label information corresponding to each label sequence. Among them, the transition probability is used to characterize the dependency relationship between the multiple label information corresponding to each label sequence. The transition probability reflects the semantic logical dependency between the label information in the sequence labeling task by quantifying this dependency relationship. For example, if the transition probability corresponding to two label information is high, it means that the probability of the two label information appearing continuously is large, that is, it has a strong semantic association; if the transition probability corresponding to the two label information is low, it means that the continuity of the two label information is low, and usually there is no logical consistency.
[0093] For example, the transition probability between multiple label information can be determined based on the trained transition probability matrix, where the transition probability matrix is used to represent the transition rules between each label information. The transition probability matrix A is a K×K matrix, where K is the number of preset label information in the preset label set; the element A[i,j] of the transition probability matrix represents the transition from label information y t-1 =i transfers to label information y t = j's transition score. For example, if the label sequence is Y1 = {B-subject (upstream chemical plant), B-behavior (pollutant discharge), B-damage fact (sharp drop in fish pond production), B-subject (upstream chemical plant), I-behavior (legal discharge)}, then A[B-subject, B-behavior] represents the probability of transitioning from B-subject (upstream chemical plant) to B-behavior (pollutant discharge).
[0094] For example, the transition probability matrix is:
[0095]
[0096] Then the transition probability corresponding to the label sequence Y1 = {B-subject (upstream chemical plant), B-behavior (pollution discharge), O-non-entity (cause), B-damage fact (sharp drop in fish pond production), B-subject (upstream chemical plant), O-non-entity (claim), I-behavior (legal discharge)} is: A[B-subject, B-behavior] + A[B-behavior, O-non-entity] + A[O-non-entity, B-damage fact] + A[B-damage fact, B-subject] + A[B-subject, O-non-entity] + A[O-non-entity, I-behavior] = 0.8 + 0.1 + 0.2 + 0.0 + 0.1 + 0.0 = 1.2;
[0097] The corresponding transition probability of the label sequence Y2 = {B-subject (upstream chemical plant), B-subject (pollution discharge), B-behavior (result), B-damage fact (sharp drop in fish pond production), B-subject (upstream chemical plant), B-subject (claim), I-behavior (legal discharge)} is: A[B-subject, B-subject] + A[B-subject, B-behavior] + A[B-behavior, B-damage fact] + A[B-damage fact, B-subject] + [B-subject, B-subject] + A[B-subject, I-behavior] = 0.0 + 0.8 + 0.0 + 0.0 + 0.0 + 0.0 = 0.8;
[0098] The transition probability corresponding to the label sequence Y3 = {B-behavior (upstream chemical plant), B-subject (pollution discharge), O-non-entity (cause), I-behavior (sharp drop in fish pond output), B-subject (upstream chemical plant), O-non-entity (claim), B-damage fact (legal discharge)} is: A[B-behavior, B-subject]+A[B-subject, O-non-entity]+A[O-non-entity, I-behavior]+A[I-behavior, B-subject]+A[B-subject, O-non-entity]+A[O-non-entity, B-damage fact]=0.5+0.1+0.0+0.0+0.1+0.2=0.9.
[0099] Step 430 : Determine the conditional probability corresponding to each label sequence based on the transition probability corresponding to each label sequence.
[0100] In some embodiments, after determining the transition probabilities corresponding to each label sequence, the CRF layer can determine the conditional probabilities corresponding to each label sequence based on the transition probabilities corresponding to each label sequence. For example, a score function corresponding to each label sequence can be first determined based on the transition probabilities corresponding to each label sequence; then, a log-likelihood estimate is performed on the score function corresponding to each label sequence to determine the conditional probabilities corresponding to each label sequence. The score function is used to quantify the rationality of the label sequence relative to the input sequence (i.e., the content features), that is, the degree of match between the label sequence and the content features.
[0101] In some examples, the conditional probability corresponding to each tag sequence can be determined according to formula (1):
[0102]
[0103] Among them, y t and y t-1 is the tag information in the tag sequence, and X is the content feature. That is, the label sequence Y = {y1,y2,…,y T} corresponding score function Score(X,Y). φ(y t ,y t-1,X) is the characteristic function, which can be determined based on the transition probability corresponding to the label sequence Y. Exponential function The exponential function is used to calculate the log-likelihood of the score function. It ensures that all probability values are non-negative and simplifies the calculation of the CRF layer by taking advantage of the logarithmic property. Ensure that the sum of the conditional probabilities of all label sequences is 1.
[0104] Step 440 : determining a target tag sequence from the plurality of tag sequences based on the conditional probabilities corresponding to the respective tag sequences, and determining a plurality of first entities according to the target tag sequence.
[0105] In some embodiments, after determining the conditional probabilities corresponding to each tag sequence, the CRF layer can use the Viterbi algorithm to determine the target tag sequence with the largest conditional probability among multiple tag sequences. * In the process, the CRF layer calculates the label sequence with the highest conditional probability based on the transition dependency (i.e., transition probability) between each label information in the label sequence and the global information of the content features using an efficient dynamic programming method (such as the forward-backward algorithm). This target label sequence can represent the multiple first entities corresponding to the question information.
[0106] Through the above process, for legal information extraction, the entities in the input consultation text often have complex contextual relationships and dependencies. Since the CRF layer can effectively utilize the dependencies between label information, it can greatly improve the accuracy and consistency of entity information extraction.
[0107] Figure 5 A flowchart of another method for determining entities and entity relationships based on context information is provided in some embodiments of the present application, such as Figure 5 As shown, the above step 250 may include steps 510 to 530.
[0108] Step 510 : Based on the question information and the plurality of first entities, determine the question information feature corresponding to the question information and the initial feature corresponding to each first entity.
[0109] In some embodiments, the BERT model in the legal event detection model can be used to extract contextual information corresponding to each first entity in the question information, and the contextual information corresponding to each first entity can be determined as the initial features corresponding to each first entity. The initial features corresponding to each first entity determined by the BERT model typically cover a wide range, that is, they typically cover all possible contextual relationships related to each first entity in the question information.
[0110] Continuing with the above example, the initial features corresponding to each first entity in the question information asked by 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, ...], and one year: [0.4, 0.5, 0.6, ...]. It should be noted that the numerical values in the initial features corresponding to the above first entities are only examples.
[0111] In some embodiments, the question information may also be vectorized using a BERT model to obtain question information features corresponding to the question information.
[0112] Step 520 : determining core information corresponding to the question information based on the plurality of first entities, the entity relationships between the first entities, and the initial features corresponding to the first entities.
[0113] In some embodiments, since the initial features corresponding to each first entity obtained by the BERT model usually cover a wide range, the initial features corresponding to each first entity can be processed through a multi-layer graph convolutional network model (Graph Convolutional Networks, GCN) in the legal event detection model, so that the initial features corresponding to each first entity gradually converge to the core information corresponding to each first entity and the core relationship between each first entity.
[0114] For example, the initial features corresponding to each first entity can be updated layer by layer through each layer of GCN based on the syntactic graph and the initial features corresponding to each first entity, using hierarchical propagation and aggregation of neighboring nodes. The syntactic graph can be determined based on the first entity and the entity relationship between each first entity. Finally, the updated features corresponding to each first entity obtained by the last layer of GCN are determined as the core information corresponding to the question information (i.e., the core information corresponding to each first entity and the core relationship between each first entity).
[0115] Step 530: Determine the second event information based on the question information feature and the core information corresponding to the question information.
[0116] In some embodiments, the second event information corresponding to the question information can be determined by a classification model in a legal event detection model based on the question information features determined by the BERT model and the core information corresponding to the question information determined by the GCN.
[0117] For example, the core information corresponding to the question information and the question information features corresponding to the question information determined by the BERT model can be fused first to obtain the fused features and input them into the classification model; then the fused features are classified by the classification model, and the classification result obtained is the legal event information corresponding to the question information (i.e., the second event information).
[0118] Through the above scheme, the contextual relationship corresponding to each first entity in the question information input by the user (that is, the initial features corresponding to each first entity) can be extracted, and the initial features corresponding to each first entity can be updated by adopting the method of hierarchical propagation and aggregation of neighboring nodes, so as to finally obtain the core information corresponding to each first entity and the core relationship between each first entity, and then based on the core information corresponding to each first entity and the core relationship between each first entity, the legal event information corresponding to the question information can be accurately determined.
[0119] Figure 6 A flowchart of another method for determining entities and entity relationships based on context information is provided in some embodiments of the present application, such as Figure 6 As shown, the above step 520 may include steps 610 to 630.
[0120] Step 610 : Determine a syntactic graph using the first entities as nodes and the entity relationships between the first entities as edges.
[0121] In some embodiments, after obtaining the above-mentioned multiple first entities and the entity relationships between each first entity, a model can be constructed through the syntactic graph in the legal event detection model, and a syntactic graph can be constructed based on the multiple first entities and the entity relationships between each first entity.
[0122] For example, when constructing a syntax graph, each first entity is used as a node of the syntax graph, and the entity relationships between the first entities are used as edges between the nodes. Figure 7 A schematic diagram of a syntax diagram is shown in Figure 7 As shown in the figure, taking the question "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" as an example, the corresponding nodes in the syntactic graph 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, Zhang San---Demand for Compensation---> Li Si.
[0123] For example, the syntactic graph can represent all relationships between first entities (nodes), which may include some non-core relationships, such as "Zhang San and Li Si are neighbors." Therefore, the obtained entity relationships between the first entities can be subsequently processed by the third neural network model, so that the entity relationships between the first entities gradually converge to the core relationships between the first entities, thereby eliminating non-core relationships between the first entities.
[0124] Step 620: Update the initial features corresponding to each first entity based on the syntactic graph and the initial features corresponding to each first entity through multiple neural network layers to obtain updated features of each node determined by each neural network layer in the multiple neural network layers.
[0125] In some embodiments, after obtaining the above-mentioned syntactic graph and the initial features corresponding to each first entity determined by the BERT model, the initial features corresponding to each first entity can be updated based on the syntactic graph and the initial features corresponding to each first entity through the multi-layer graph convolutional network (GCN) in the legal event detection model.
[0126] Exemplarily, the features corresponding to each first entity can be updated by using a multi-layer GCN using hierarchical propagation and aggregation of neighbor node features. Taking the target node among multiple nodes as an example, the current features corresponding to the target node can be updated 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 through the previous layer of GCN in the multi-layer GCN, 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.
[0127] In step 630 , the updated features of each node determined by the last neural network layer in the multiple neural network layers are determined as the core information corresponding to each first entity and the core relationship between each first entity.
[0128] In some embodiments, the updated features corresponding to each node obtained by the last layer GCN in the above-mentioned multi-layer GCN are the core information corresponding to each node and the core relationship between each first entity, that is, the core information corresponding to each first entity and the core relationship between each first entity (that is, the corresponding core information).
[0129] Through the above scheme, the initial features corresponding to each first entity output by the BERT model are updated based on the syntactic graph through multi-layer GCN, which can exclude non-core first entity information and non-core relationships between the first entities, so that better classification results can be obtained when legal events are subsequently classified based on the first entity information and entity relationships.
[0130] Figure 8 A flowchart of another method for determining entities and entity relationships based on context information is provided in some embodiments of the present application, such as Figure 8 As shown, the above step 620 may include steps 810 to 820.
[0131] Step 810: Obtain the first feature of each node determined by the first neural network layer among the multiple neural network layers based on the initial features corresponding to each node, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the first neural network layer.
[0132] 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 to obtain the updated initial features corresponding to the target node (i.e., the first features).
[0133] 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.
[0134] In some examples, the method of updating the features of each node through multi-layer GCN can refer to formula (1):
[0135]
[0136] Among them, H (l) The current features (H) corresponding to each node determined by the l-th layer GCN (0) That is, the initial feature corresponding to each node); H (l+1) is the updated feature corresponding to each node in the l+1th layer.
[0137] A is the N×N adjacency matrix corresponding to the syntax 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 A[i][j]=1; if there is no edge between node i and node j, then A[i][j]=0; I N 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.
[0138] yes The degree matrix is a diagonal matrix where each diagonal element represents the degree of node i, that is, the number of edges connected to node i.
[0139] is the degree matrix The inverse square root of is used to normalize the adjacency matrix A to avoid the impact of large differences in node degrees on model training.
[0140] W (l) is the weight matrix corresponding to the l-th layer GCN, which is a trainable parameter matrix used to linearly transform node features.
[0141] σ is a nonlinear activation function, such as the Rectified Linear Unit (ReLU), which enables the third neural network model to capture complex patterns.
[0142] Indicates that the current feature H corresponding to the node determined by the l-th layer GCN is normalized by the adjacency matrix (l) To spread and aggregate; H (l) W (l) Indicates that the node features after propagation and aggregation are linearly transformed to obtain the node features after linear transformation; multiplying the updated node features by σ means applying a nonlinear activation function to the node features after linear transformation to increase the expression ability of the model, thereby obtaining the updated node features H (l+1) .
[0143] Step 820: Obtain the second feature of each node determined by the second neural network layer based on the first feature of each node, 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.
[0144] 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).
[0145] 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 entity initial features, thereby improving the convergence effect of entity core information and core relationships.
[0146] In some embodiments, the above step 530 includes: fusing the question information feature and the core information corresponding to the question information to obtain a fused feature; and classifying the legal event corresponding to the fused feature to obtain second event information.
[0147] In some embodiments, after obtaining the core information corresponding to each first entity and the core features between the first entities (i.e., the core information corresponding to the question information) through a multi-layer GCN, the question information features corresponding to the question information determined based on the BERT model and the core information corresponding to the 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 question information can be achieved through concatenation, weighted summation, or an attention mechanism. The specific fusion method is not limited in this embodiment.
[0148] In some embodiments, after determining the above fusion features, the legal events corresponding to the fusion features can be classified using a classification model to obtain one or more target event information. The classification model can be implemented based on a fully connected (FC) layer, etc., which is not limited in this embodiment.
[0149] For example, for the question information input by the user, "Zhang San and Li Si are neighbors. Zhang San borrowed 100,000 yuan from Li Si, and the two parties agreed to repay the loan in one year. One year later, Zhang San failed to repay the loan on time and ignored Li Si's reminders for payment", after being processed by the legal event detection model, the target event information corresponding to the question information can be obtained as "failure to repay debts".
[0150] Through the above scheme, the question information features corresponding to the question information and the core information corresponding to the question information are integrated, so that the fourth neural network model can use the question information as a reference in the process of classification prediction, 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 question information.
[0151] In some embodiments, the above method also includes: when the second event information is different from the first event information, determining multiple second entities corresponding to the question information and the entity relationship between each second entity in the multiple second entities based on the second event information; determining the third event information corresponding to the question information based on the multiple second entities and the entity relationship between each second entity; when the third event information is the same as the second event information, determining the multiple second entities as the multiple target entities corresponding to the question information, and determining the entity relationship between the second entities as the entity relationship between each target entity in the multiple target entities corresponding to the question information.
[0152] In some embodiments, when the second event information is different from the above-mentioned first event information, the information extraction model can extract legal information (including entities and entity relationships) from the question information again based on the second event information, so as to determine the legal event information corresponding to the question information (i.e., the third legal event information) based on the second entity and the entity relationship between the second entities obtained by this information extraction through the legal event detection model again; and when the third event information is the same as the second event information, multiple second entities are determined as multiple target entities corresponding to the question information, and the entity relationship between each second entity is determined as the entity relationship between each target entity in the multiple target entities corresponding to the question information; when the third event information is different from the second event information, continue to extract legal information based on the third event information through the information extraction model... and so on, until the event information determined by the previous legal event detection is the same as the event information determined by the next legal event detection.
[0153] Through the above scheme, the information extraction results obtained by the information extraction model can be fed back to the legal event detection model to re-determine the legal event information, so as to compare the legal event information determined in the previous legal event detection process with the legal event information determined in the current legal event detection process, thereby improving the accuracy of legal event detection.
[0154] Figure 9 A flowchart of a method for training an information extraction model provided in some embodiments of the present application, wherein: Figure 9 The method shown can be applied to Figure 1 The information extraction model shown in Figure 9 As shown, the training method of the information extraction model may include steps 910 to 950.
[0155] Step 910: Obtain the training text, the target entity corresponding to the training text, and the legal event information.
[0156] In some embodiments, when training an information extraction model, case facts from public documents such as legal consultations, legal documents, and textbooks can be obtained as training text, and the real entity information (i.e., target entity) corresponding to the training text can be determined to serve as training labels for the case facts. Furthermore, legal event information obtained by performing legal event detection on other question information can also be obtained.
[0157] Step 920 , vectorize the legal event information to obtain a supervision vector, and perform feature extraction on the legal elements in the training text to obtain multiple element features corresponding to the training text.
[0158] In some embodiments, after the training text, the target entity corresponding to the training text, and the legal event information are input into the information extraction model, the information extraction model vectorizes the legal event information through the supervision model to obtain a supervision vector, and performs feature extraction on the legal elements in the training text through multiple element extraction models in the content model to obtain multiple element features corresponding to the training text.
[0159] It can be understood that the implementation of step 920 can refer to the description of step 230 and will not be repeated here.
[0160] Step 930 : Determine multiple predicted entities in the training text based on the supervision vector and multiple element features.
[0161] In some embodiments, the information extraction model then predicts entities in the training text based on the above-mentioned supervision vector and multiple element features through the content model to obtain multiple predicted entities corresponding to the training text.
[0162] It can be understood that the implementation of step 930 can refer to the description of steps 310 to 330 and will not be repeated here.
[0163] Step 940: Determine a first loss function corresponding to the information extraction model based on the multiple prediction entities and the multiple target entities.
[0164] In some embodiments, the binary cross entropy loss between the predicted legal information and the actual legal information can then be calculated based on the above-mentioned multiple predicted entities and target entities, thereby determining the loss function (i.e., the first loss function) corresponding to the content model.
[0165] Exemplarily, the first loss function corresponding to the content model can be determined according to formula (2):
[0166]
[0167] Among them, L1 is the first loss function; N is the number of sentences in the question information; y i is the target entity corresponding to the i-th sentence; is the predicted entity corresponding to the i-th sentence.
[0168] Step 950: Optimize the parameters in the first loss function to determine the trained information extraction model.
[0169] In some embodiments, after obtaining the first loss function corresponding to the above-mentioned content model, relevant parameters in the first loss function can be optimized to obtain a trained content model.
[0170] Figure 10A flowchart of another information extraction model training method provided in some embodiments of the present application, such as Figure 10 As shown, the above method also includes steps 1010 to 1030.
[0171] Step 1010: Obtain a true label sequence corresponding to the training text, and determine a conditional probability corresponding to the true label sequence based on the true label sequence.
[0172] In some embodiments, in addition to training the content model in the information extraction model, the CRF layer in the information extraction model can also be trained. When training the CRF layer, first obtain the true label sequence corresponding to the above-mentioned training text, and based on the target label sequence corresponding to the training text, determine the conditional probability P(Y|X) corresponding to the target label sequence. Among them, the conditional probability corresponding to the target label sequence can be determined based on the transition probability corresponding to the target label sequence. It can be understood that the implementation method of step 1010 can refer to the description of steps 410 to 430, and will not be repeated here.
[0173] Step 1020: Determine a second loss function corresponding to the information extraction model based on the conditional probability.
[0174] In some embodiments, the second loss function corresponding to the CRF layer can be determined according to formula (3):
[0175]
[0176] Among them, L2 is the second loss function; Y is the true label sequence, X is the training text; P(Y|X) is the conditional probability corresponding to the true label sequence.
[0177] In some embodiments, the above step 950 includes: optimizing parameters in the first loss function and the second loss function to determine the trained information extraction model.
[0178] For example, after determining the first loss function corresponding to the content model and the second loss function corresponding to the CRF layer, an overall loss function can be determined based on the first loss function and the second loss function. The overall loss function can be determined by the first loss function, the second loss function, and the corresponding weights. The weights corresponding to the first loss function and the weights corresponding to the second loss function can be adjusted based on the performance of the information extraction model on the validation set, thereby optimizing the information extraction model and obtaining a trained information extraction model.
[0179] By applying the above technical solution, different types of legal element features in the question information can be extracted through the content model in the information extraction model, and multiple types of element features can be remotely supervised through the supervision model in the information extraction model to obtain content features. The content features can more accurately represent the entity information corresponding to the question information, thereby improving the accuracy of entity and entity relationship extraction in legal consultation scenarios.
[0180] Figure 11 Schematic diagram of an entity and entity relationship determination device based on context information provided in some embodiments of the present application. Figure 11 As shown, the apparatus 1100 for determining entities and entity relationships based on context information includes a first acquisition module 1110 , a first processing module 1120 , a feature extraction module 1130 , a first determination module 1140 , a second determination module 1150 and a third determination module 1160 .
[0181] The first acquisition module 1110 is configured to acquire question information input by the user and first event information corresponding to the question information.
[0182] The first processing module 1120 is configured to perform vectorization processing on the first event information to obtain a supervision vector corresponding to the first event information.
[0183] The feature extraction module 1130 is configured to extract features of legal elements in the question information to obtain multiple element features corresponding to the question information.
[0184] The first determination module 1140 is configured to determine multiple first entities corresponding to the question information based on the supervision vector corresponding to the first event information and multiple factor features, and determine the entity relationship between each first entity in the multiple first entities based on the multiple first entities.
[0185] The second determining module 1150 is configured to determine the second event information corresponding to the question information based on the multiple first entities and the entity relationships between the first entities.
[0186] The third determination module 1160 is configured to determine the multiple first entities as the multiple target entities corresponding to the question information when the second event information is the same as the first event information, and determine the entity relationship between the first entities as the entity relationship between the target entities in the multiple target entities corresponding to the question information.
[0187] In some embodiments, the feature extraction module 1130 is specifically configured to: extract features of various types of legal elements in the question information through multiple element extraction models in the information extraction model to obtain multiple element features; wherein each element model in the multiple element models is used to extract different types of element features.
[0188] In some embodiments, the first determination module 1140 is specifically configured to: perform concatenation or dot multiplication processing on the supervision vector and each element feature to obtain multiple first element features; use the attention mechanism to adjust the weight of each first element feature in the multiple first element features to obtain multiple second element features after weight adjustment; perform feature fusion processing on the multiple second element features to obtain content features, and determine multiple first entities based on the content features.
[0189] In some embodiments, the first determination module 1140 is specifically configured to: perform sequence labeling on content features to obtain multiple label sequences corresponding to the content features; wherein each label sequence in the multiple label sequences includes multiple label information; based on the multiple label information corresponding to each label sequence, determine the transition probability corresponding to each label sequence; wherein the transition probability is used to characterize the dependency relationship between the multiple label information corresponding to each label sequence; based on the transition probability corresponding to each label sequence, determine the conditional probability corresponding to each label sequence; based on the conditional probability corresponding to each label sequence, determine the target label sequence in the multiple label sequences, and determine multiple first entities according to the target label sequence.
[0190] In some embodiments, the second determination module 1150 is specifically configured to: determine the question information features corresponding to the question information and the initial features corresponding to each first entity based on the question information and multiple first entities; wherein the initial features corresponding to each first entity are used to characterize the context information corresponding to each first entity; determine the core information corresponding to the question information based on the multiple first entities, the entity relationships between the first entities and the initial features corresponding to the first entities; determine the second event information based on the question information features and the core information corresponding to the question information.
[0191] In some embodiments, the core information corresponding to the question information includes the core information corresponding to each first entity in the question information and the core relationship between each first entity; the second determination module 1150 is specifically configured to: determine a syntactic graph with each first entity as a node and the entity relationship between each first entity as an edge; update the initial features corresponding to each first entity based on the syntactic graph and the initial features corresponding to each first entity through multiple neural network layers, and obtain the updated features of each node determined by each neural network layer in the multiple neural network layers; determine the updated features of each node determined by the last neural network layer in the multiple neural network layers as the core information corresponding to each first entity and the core relationship between each first entity.
[0192] In some embodiments, the second determination module 1150 is specifically configured to: obtain the first feature of each node determined by the first neural network layer based on the initial features corresponding to each node, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the first neural network layer among multiple neural network layers; wherein the first neural network layer is the first neural network layer among multiple neural network layers; obtain the second feature of each node determined by the second neural network layer based on the first features of each node, the adjacency matrix corresponding to the syntactic graph, the self-connection matrix and the weight matrix corresponding to the second neural network layer among multiple neural network layers; wherein the updated features of each node include the first feature of each node and the second feature of each node.
[0193] In some embodiments, the second determination module 1150 is specifically configured to: fuse the question information feature and the core information corresponding to the question information to obtain a fused feature; and classify the legal events corresponding to the fused feature to obtain second event information.
[0194] In some embodiments, the third determination module 1160 is further configured to: when the second event information is different from the first event information, determine the multiple second entities corresponding to the question information and the entity relationships between the multiple second entities based on the second event information; the second determination module 1150 is further configured to: determine the third event information corresponding to the question information based on the multiple second entities and the entity relationships between the second entities; the third determination module 1160 is further configured to: when the third event information is the same as the second event information, determine the multiple second entities as the multiple target entities corresponding to the question information, and determine the entity relationships between the second entities as the entity relationships between the multiple target entities corresponding to the question information.
[0195] Figure 12 Schematic diagram of a training device for an information extraction model provided in some embodiments of the present application. Figure 12 As shown, the training device 1200 of the information extraction model can be configured in Figure 1 The information extraction model training device 1200 includes a second acquisition module 1210 , a second processing module 1220 , a fourth determination module 1230 , a fifth determination module 1240 and an optimization module 1250 .
[0196] The second acquisition module 1210 is configured to acquire a training text, a first entity corresponding to the training text, and legal event information.
[0197] The second processing module 1220 is configured to perform vectorization processing on the legal event information to obtain a supervision vector, and perform feature extraction on the legal elements in the training text to obtain multiple element features corresponding to the training text.
[0198] The fourth determination module 1230 is configured to determine multiple predicted entities in the training text based on the supervision vector and multiple element features.
[0199] The fifth determination module 1240 is configured to determine a first loss function corresponding to the information extraction model based on the multiple prediction entities and the multiple first entities.
[0200] The optimization module 1250 is configured to optimize the parameters in the first loss function to determine the trained information extraction model.
[0201] like Figure 12 As shown, the information extraction model training device 1200 also includes a sixth determination module 1260.
[0202] In some embodiments, the second acquisition module 1210 is further configured to: obtain the true label sequence corresponding to the training text, and determine the conditional probability corresponding to the true label sequence based on the true label sequence; the sixth determination module 1260 is configured to: determine the second loss function corresponding to the information extraction model based on the conditional probability; the optimization module 1250 is specifically configured to: optimize the parameters in the first loss function and the second loss function to determine the trained information extraction model.
[0203] Figure 13 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 context-based entity and entity relationship determination method or information extraction model training method described in the above embodiments.
[0204] like Figure 13 As shown, the electronic device 1300 includes a processor 1301 and a memory 1302. Exemplarily, the electronic device 1300 may further include a communication interface 1303 and a communication bus 1304.
[0205] The processor 1301, the memory 1302 and the communication interface 1303 communicate with each other via a communication bus 1304. The communication interface 1303 is used to communicate with other devices such as a client or a network element of another server.
[0206] In some embodiments, processor 1301 is configured to execute program 1305, specifically, to execute the relevant steps in the aforementioned embodiments of the method for determining entities and entity relationships based on contextual information or the method for training an information extraction model. Specifically, program 1305 may include program code, which may include computer-executable instructions.
[0207] For example, the processor 1301 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement some embodiments of the present application. The electronic device 1300 may include one or more processors of the same type, such as one or more CPUs, or different types of processors, such as one or more CPUs and one or more ASICs.
[0208] In some embodiments, the memory 1302 is used to store the program 1305. The memory 1302 may include a high-speed RAM memory, and may also include a non-volatile memory (NVM), such as at least one disk memory.
[0209] Program 1305 can be specifically called by processor 1301 to enable electronic device 1300 to execute a method for determining entities and entity relationships based on context information or a training method for an information extraction model.
[0210] 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 1300, the electronic device 1300 executes the entity and entity relationship determination method based on context information or the information extraction model training method in the above-mentioned embodiment.
[0211] The executable instructions can be specifically used to enable the electronic device 1300 to execute a method for determining entities and entity relationships based on contextual information or a training method operation for an information extraction model.
[0212] 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, and the like.
[0213] 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 context-based entity and entity relationship determination method or information extraction model training method provided above, and will not be repeated here.
[0214] It should be noted that, in the application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0215] Each embodiment in this specification is described in a related manner. Similar portions between the embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so their description is relatively simple. For related portions, refer to the description of the method embodiments.
[0216] The logic and / or steps represented in the flowchart or otherwise described herein may be considered, for example, as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device).
[0217] 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 or in connection with an instruction execution system, apparatus, or device.
[0218] 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 cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic device, and a portable compact disc read-only memory (CDROM).
[0219] In addition, the computer readable medium can even be 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 it 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.
[0220] In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0221] The above-described embodiments of the present application do not constitute a limitation on the scope of protection of the present application.
Claims
1. A method for determining entities and entity relationships based on contextual information, characterized in that: include: Acquire question information input by the user and first event information corresponding to the question information; Extracting features of the legal elements in the first event information and the question information respectively to obtain a supervision vector corresponding to the first event information and multiple element features corresponding to the question information; determining a plurality of first entities corresponding to the question information based on the supervision vector corresponding to the first event information and the plurality of element features, and determining an entity relationship between the plurality of first entities based on the plurality of first entities; determining question information features based on the question information, and determining context information of each of the first entities based on the plurality of first entities; performing convergence processing on context information corresponding to each first entity based on the multiple first entities and the entity relationships between the first entities, to obtain core information corresponding to each first entity in the question information and the core relationships between the first entities; determining second event information corresponding to the question information based on the question information feature, core information corresponding to each of the first entities in the question information, and core relationships between the first entities; When the second event information is the same as the first event information, the multiple first entities are determined as the multiple target entities corresponding to the question information, and the entity relationship between the first entities is determined as the entity relationship between the target entities in the multiple target entities corresponding to the question information.
2. The method according to claim 1, characterized in that The performing convergent processing on the context information corresponding to each first entity based on the multiple first entities and the entity relationships between the first entities to obtain core information corresponding to each first entity in the question information and the core relationships between the first entities includes: Determine a syntactic graph using the first entities as nodes and entity relationships between the first entities as edges; updating, by multiple neural network layers, the context information corresponding to each of the first entities based on the syntax graph and the context information corresponding to each of the first entities, to obtain updated context information of each of the nodes determined by each of the neural network layers in the multiple neural network layers; The updated context information of each of the nodes determined by the last neural network layer in the multiple neural network layers is determined as the core information corresponding to each of the first entities and the core relationship between each of the first entities.
3. The method according to claim 2, characterized in that The updating, through multiple neural network layers based on the syntax graph and the context information corresponding to each of the first entities, of the context information corresponding to each of the first entities to obtain updated context information of each of the nodes 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, first context information of each of the nodes determined by the first neural network layer based on context information features corresponding to each of the nodes, an adjacency matrix and a self-connection matrix corresponding to the syntactic graph, 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 context information of each node 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 context information of each node, 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 context information of each node includes the first context information of each node and the second context information of each node.
4. The method according to claim 1, wherein The determining the second event information based on the question information feature, the core information corresponding to each of the first entities in the question information, and the core relationship between the first entities includes: fusing the question information feature, the core information corresponding to each of the first entities in the question information, and the core relationship between the first entities to obtain a fused feature; The legal events corresponding to the fusion features are classified to obtain the second event information.
5. The method according to claim 1, wherein Performing feature extraction on the first event information to obtain a supervision vector corresponding to the first event information includes: Determining the legal information type corresponding to the first event information; Vectorization is performed on the legal information type to obtain a supervision vector corresponding to the first event.
6. The method according to claim 1, characterized in that The feature extraction of the legal elements in the question information to obtain multiple element features corresponding to the question information includes: Feature extraction is performed on various types of legal elements in the question information using multiple element extraction models to obtain the multiple element features; wherein each of the multiple element extraction models is used to extract different types of element features.
7. The method according to claim 1, characterized in that The determining, based on the supervision vector corresponding to the first event information and the multiple element features, the multiple first entities corresponding to the question information includes: Performing concatenation or dot multiplication on the supervision vector corresponding to the first event information and each of the element features to obtain a plurality of first element features; Using an attention mechanism to adjust the weight of each of the plurality of first factor features to obtain a plurality of second factor features after weight adjustment; Feature fusion processing is performed on the multiple second element features to obtain content features, and the multiple first entities are determined based on the content features.
8. The method according to claim 7, characterized in that The determining the plurality of first entities according to the content characteristics includes: Performing sequence labeling on the content features to obtain a plurality of label sequences corresponding to the content features; wherein each of the plurality of label sequences includes a plurality of label information; Determine, based on the plurality of label information corresponding to each label sequence, a transition probability corresponding to each label sequence; wherein the transition probability is used to characterize a dependency relationship between the plurality of label information corresponding to each label sequence; Determining the conditional probability corresponding to each label sequence based on the transition probability corresponding to each label sequence; Based on the conditional probabilities corresponding to the respective tag sequences, a target tag sequence is determined from the multiple tag sequences, and the multiple first entities are determined according to the target tag sequence.
9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: In a case where the second event information is different from the first event information, determining, based on the second event information, a plurality of second entities corresponding to the question information and entity relationships between the plurality of second entities; determining, based on the entity relationships between the multiple second entities and each of the second entities, third event information corresponding to the question information; When the third event information is the same as the second event information, the multiple second entities are determined as the multiple target entities corresponding to the question information, and the entity relationship between the second entities is determined as the entity relationship between the target entities in the multiple target entities corresponding to the question information.
10. A training method for an information extraction model, characterized in that: Applied to the information extraction model to be trained, the method includes: Obtaining a training text, a target entity corresponding to the training text, and legal event information; Vectorizing the legal event information to obtain a supervision vector, and extracting features of the legal elements in the training text to obtain a plurality of element features corresponding to the training text; Determining a plurality of predicted entities in the training text based on the supervision vector and the plurality of element features; Determining a first loss function corresponding to the information extraction model based on the multiple predicted entities and the target entity corresponding to the training text; Optimize the parameters in the first loss function to determine the trained information extraction model.
11. The method according to claim 10, characterized in that The method further comprises: Obtaining a true label sequence corresponding to the training text, and determining a conditional probability corresponding to the true label sequence based on the true label sequence; Determine a second loss function corresponding to the information extraction model based on the conditional probability; Optimizing the parameters in the first loss function to determine the trained information extraction model includes: Optimizing parameters in the first loss function and the second loss function to determine the trained information extraction model.
12. A device for determining entities and entity relationships based on context information, characterized in that: include: A first acquisition module is configured to acquire question information input by a user and first event information corresponding to the question information; a feature extraction module configured to extract features of the legal elements in the first event information and the question information respectively, to obtain a supervision vector corresponding to the first event information and a plurality of element features corresponding to the question information; a first determining module configured to determine a plurality of first entities corresponding to the question information based on the supervision vector corresponding to the first event information and the plurality of element features, and determine an entity relationship between the plurality of first entities based on the plurality of first entities; a second determining module configured to determine a question information feature based on the question information, and to determine context information of each of the first entities based on the plurality of first entities; a third determining module configured to perform convergence processing on the context information corresponding to each first entity based on the multiple first entities and the entity relationships between the first entities, to obtain core information corresponding to each first entity in the question information and the core relationships between the first entities; a fourth determining module configured to determine second event information corresponding to the question information based on the question information feature, core information corresponding to each of the first entities in the question information, and core relationships between the first entities; The fifth determination module is configured to determine the multiple first entities as the multiple target entities corresponding to the question information when the second event information is the same as the first event information, and determine the entity relationship between the first entities as the entity relationship between the target entities in the multiple target entities corresponding to the question information.
13. A training device for an information extraction model, characterized in that: Configured in an information extraction model to be trained, the device comprises: A second acquisition module is configured to acquire a training text, a target entity corresponding to the training text, and legal event information; a second processing module configured to perform vectorization processing on the legal event information to obtain a supervision vector, and perform feature extraction on the legal elements in the training text to obtain a plurality of element features corresponding to the training text; a fourth determination module, configured to determine a plurality of predicted entities in the training text based on the supervision vector and the plurality of element features; a fifth determining module, configured to determine a first loss function corresponding to the information extraction model based on the multiple predicted entities and the target entity corresponding to the training text; The optimization module is configured to optimize the parameters in the first loss function to determine the trained information extraction model.
14. 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 entity and entity relationship determination method based on context information according to any one of claims 1-9, or implement the training method of the information extraction model according to claim 10 or 11.
15. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, it implements the entity and entity relationship determination method based on context information according to any one of claims 1-9, or implements the information extraction model training method according to claim 10 or 11.
Citation Information
Patent Citations
Entity alias relationship acquisition method and device, entity alias relationship training method and device and storage medium
CN114881014A
Information extraction method and device, computer storage medium and electronic equipment
CN117235271A
Entity extraction model training method and device, electronic equipment and storage medium
CN118643827A