Event extraction method, device and equipment
Through the combination of graph model and multi-level attention mechanism, a heterogeneous relationship map is designed, which solves the problem of low performance of the event extraction system in the existing technology, and accurately extracts and identifys event elements, improving the overall performance of the system.
Patent Information
- Application Number
- CN202210938697.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-05
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-08-05
AI Technical Summary
In the prior art, it is difficult to accurately extract multiple entities used to describe the same event from text, and it is impossible to effectively model the interaction relationship of event elements, resulting in poor performance of event extraction systems.
A chapter-level event extraction method based on graph model is adopted to design a relationship map containing sentences, entity mentions and entities, and a multi-level attention mechanism is introduced to simulate information flow patterns, and a path-expanding task modeling event table filling is achieved to achieve end-to-end event type recognition and argument recognition.
It improves the performance of the event extraction system, solves the problems of poor accuracy and time-consuming, can accurately capture the connections between cross-sentence entities, avoid argument dispersion, and improves the overall performance of the event extraction system.
Smart Images

Figure CN115329746B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an event extraction method, device and equipment. Background Art
[0002] Event extraction (EE) is a key task in public opinion management and finance. In finance, events serve as crucial decision-making references for investment analysis and asset management, and are also a crucial component of knowledge graphs. Event extraction is essential for graph reasoning and event analysis. In the era of big data, data information is diverse and complex, making it difficult to mine, process, utilize, and analyze. To extract more valuable information from text, the key is to extract entities, relationships, and events within the text, analyze and predict the interactions between them, and present the extracted information in a more systematic and standardized manner. As a form of information, events primarily describe objective facts involving interactions between people and objects at specific times and places. Event extraction primarily involves extracting the person, time, location, and event from text describing an event, presenting it in a more structured manner. As a mainstream natural language processing task, event extraction encompasses a range of extraction tasks, such as identifying event triggers, identifying event types, and extracting event arguments and argument roles. However, there is no reasonable extraction method in the related art for extracting entities used to describe the same event from the text, and it is impossible to accurately extract entities used to describe the same event from the text. Summary of the Invention
[0003] The present application provides an event extraction method, which includes: obtaining multiple sentences in a target text, multiple entities in the multiple sentences, and multiple entity mentions; determining initial sentence vectors corresponding to the multiple sentences, initial entity vectors corresponding to the multiple entities, and initial entity mention vectors corresponding to the multiple entity mentions; generating a heterogeneous relationship graph based on the multiple sentences, the multiple entities, and the multiple entity mentions, wherein the heterogeneous relationship graph includes association relationships between sentences, entity mentions, and entities; based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, respectively determining a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector; and determining at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, wherein the event record includes multiple entities used to describe the same event.
[0004] The present application provides an event extraction device, which includes: an acquisition module for acquiring multiple sentences in a target text, and acquiring multiple entities and multiple entity mentions in the multiple sentences; a determination module for determining initial sentence vectors corresponding to the multiple sentences, initial entity vectors corresponding to the multiple entities, and initial entity mention vectors corresponding to the multiple entity mentions; a generation module for generating a heterogeneous relationship graph based on the multiple sentences, multiple entities, and multiple entity mentions, wherein the heterogeneous relationship graph includes association relationships between sentences, entity mentions, and entities; the determination module is further used to determine, based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector; the determination module is further used to determine at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, wherein the event record includes multiple entities used to describe the same event.
[0005] The present application provides an event extraction device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the event extraction method disclosed in the above example.
[0006] It can be seen from the above technical solutions that in the embodiment of the present application, a chapter-level event extraction method based on a graph model is proposed, which can accurately extract multiple entities used to describe the same event from the text. For the chapter-level event extraction task, a relationship graph containing sentences, entity mentions and entities is designed, and a multi-level (node attention and graph attention) attention mechanism is designed to simulate the information flow pattern between "sentence-entity mention-entity", to reflect the influence of different nodes, different edges, and different graphs on the final representation vector, and to represent the three local graphs respectively, so as to better capture the correlation between different event elements in the same event. The graph contains richer relationships, which is conducive to capturing the connection between cross-sentence entities and can avoid the argument dispersion problem in chapter-level event extraction. The interactive relationship between event elements under the same event can be effectively modeled, which can greatly improve the performance of the event extraction system. In the embodiment of the present application, by modeling the event table filling task as a path extension task, the shortcomings of poor accuracy and long time consumption are solved, and end-to-end modeling of event type recognition, event argument recognition, and event table filling can be achieved, effectively solving the problems of multi-event extraction and argument dispersion in chapter-level event extraction, which can greatly improve the performance of the event extraction system. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1This is a flow chart of an event extraction method in one embodiment of the present application;
[0008] Figure 2 This is a flow chart of an event extraction method in one embodiment of the present application;
[0009] Figure 3 is a processing diagram of an entity recognition model in one embodiment of the present application;
[0010] Figure 4 This is a schematic diagram of constructing a heterogeneous relationship map in one embodiment of the present application;
[0011] Figure 5 is a schematic diagram of a heterogeneous relationship map in one embodiment of the present application;
[0012] Figure 6 is a schematic diagram of vector update in one embodiment of the present application;
[0013] Figure 7 is a schematic diagram of a path extension task in one embodiment of the present application;
[0014] Figure 8 is a schematic structural diagram of an event extraction device in one embodiment of the present application;
[0015] Figure 9 This is a hardware structure diagram of an event extraction device in one embodiment of the present application. DETAILED DESCRIPTION
[0016] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items. It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at the time of" or "when" or "in response to determination".
[0017] In the embodiment of the present application, an event extraction method is proposed, which can be applied to any type of device. Figure 1 FIG. 5 is a flow chart of the method, which may include:
[0018] Step 101: Acquire multiple sentences in a target text, multiple entities in the multiple sentences, and multiple entity mentions, that is, acquire multiple entities from multiple sentences and acquire multiple entity mentions from multiple sentences.
[0019] Step 102: Determine initial sentence vectors corresponding to multiple sentences, initial entity vectors corresponding to multiple entities, and initial entity mention vectors corresponding to multiple entity mentions.
[0020] Step 103: Generate a heterogeneous relationship graph based on the multiple sentences, the multiple entities, and the multiple entity mentions. The heterogeneous relationship graph may include association relationships between sentences, entity mentions, and entities.
[0021] You can construct multiple sentence nodes corresponding to multiple sentences, multiple entity nodes corresponding to multiple entities, and multiple entity mention nodes corresponding to multiple entity mentions. You can also construct edge relationships between sentence nodes, between sentence nodes and entity mention nodes, between entity mention nodes and entity mention nodes, and between entity mention nodes and entity nodes.
[0022] In one possible embodiment, when constructing an edge relationship between sentence nodes, for any sentence, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to the multiple sentences following the sentence. When constructing an edge relationship between a sentence node and an entity mention node, if the sentence includes an entity mention, the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention. When constructing an edge relationship between an entity mention node and an entity mention node, if two entity mentions are in the same sentence, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if the two entity mentions have the same event role, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if the two entity mentions represent the same entity, the entity mention nodes corresponding to the two entity mentions have an edge relationship. When constructing an edge relationship between an entity mention node and an entity node, if the entity mention corresponds to an entity, the entity mention node corresponding to the entity mention has an edge relationship with the entity node corresponding to the entity.
[0023] Step 104: Based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, determine the target sentence vector corresponding to the initial sentence vector and the target entity vector corresponding to the initial entity vector.
[0024] Exemplarily, a sentence relationship graph, a sentence-entity mention relationship graph, and an entity mention-entity relationship graph can be obtained based on the heterogeneous relationship graph; wherein the sentence relationship graph includes the association relationship between sentences, the sentence-entity mention relationship graph includes the association relationship between sentences and entity mentions, and the entity mention-entity relationship graph includes the association relationship between entity mentions and entities. Based on the sentence relationship graph, the sentence-entity mention relationship graph, the initial sentence vector, and the initial entity mention vector, a target sentence vector corresponding to the initial sentence vector can be determined. Based on the entity mention-entity relationship graph, the initial entity vector, and the initial entity mention vector, a target entity vector corresponding to the initial entity vector can be determined.
[0025] In one possible implementation, determining a target sentence vector corresponding to an initial sentence vector based on a sentence relationship graph, a sentence-entity mention relationship graph, an initial sentence vector, and an initial entity mention vector may include: determining an associated sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, determining a first node attention vector based on the initial sentence vector and the associated sentence vector; determining an inter-sentence graph fusion feature based on the first node attention vector and the associated sentence vector; and determining a first graph attention vector based on the inter-sentence graph fusion feature and the initial sentence vector. Determining an initial entity mention vector corresponding to the initial sentence vector based on the sentence-entity mention relationship graph, determining a second node attention vector based on the initial sentence vector and the initial entity mention vector; determining an inter-sentence mention graph fusion feature based on the second node attention vector and the initial entity mention vector; determining a second graph attention vector based on the inter-sentence mention graph fusion feature and the initial sentence vector; and determining a target sentence vector based on the inter-sentence graph fusion feature, the first graph attention vector, the inter-sentence mention graph fusion feature, the second graph attention vector, and the initial sentence vector.
[0026] In one possible implementation, based on the entity mentions and entity relationship graph, the initial entity vector and the initial entity mention vector, determining the target entity vector corresponding to the initial entity vector may include but is not limited to: determining the initial entity mention vector corresponding to the initial entity vector based on the entity mentions and the entity relationship graph; determining the node attention vector based on the initial entity vector and the initial entity mention vector; determining the entity mention and inter-entity graph fusion features based on the node attention vector and the initial entity mention vector; determining the target entity vector based on the entity mention and inter-entity graph fusion features and the initial entity vector.
[0027] Step 105: Determine at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, where each event record includes multiple entities for describing the same event.
[0028] For example, the target event type corresponding to the target text can be determined based on the target sentence vector, and multiple event roles corresponding to the target event type can be determined. For each event role, a target entity corresponding to the event role is selected from multiple entities based on the target sentence vector and the target entity vector. Based on the target entity corresponding to each event role, the event record corresponding to the target text is determined.
[0029] Determining the target event type corresponding to the target text based on the target sentence vector may include but is not limited to: for each event type in the event type list, inputting the target sentence vector into a trained event type recognition model to obtain a predicted probability corresponding to the event type; if the predicted probability is greater than a preset threshold, it can be determined that the event type is the target event type; if the predicted probability is not greater than the preset threshold, it can be determined that the event type is not the target event type.
[0030] For each event role, based on the target sentence vector and the target entity vector, selecting the target entity corresponding to the event role from multiple entities can include: determining a path representation matrix corresponding to the event role, the path representation matrix can include feature vectors corresponding to the target entities corresponding to each event role preceding the event role; when the target text corresponds to multiple target event types, determining a memory matrix, the memory matrix can include path representation matrices for multiple target event types corresponding to the target text, and one path representation matrix corresponds to the feature vectors corresponding to the target entities corresponding to all event roles in an event record. On this basis, the target entity corresponding to the event role can be selected from multiple entities based on the target sentence vector, the target entity vector, the path representation matrix, and the memory matrix; or the target entity corresponding to the event role can be selected from multiple entities based on the target sentence vector, the target entity vector, and the path representation matrix.
[0031] In one possible implementation, based on the target sentence vector, target entity vector, path representation matrix and memory matrix, a target entity corresponding to the event role is selected from multiple entities, which may include but is not limited to: for each entity, the target sentence vector, target entity vector, path representation matrix and memory matrix are input into the classifier model to obtain the predicted probability corresponding to the entity; if the predicted probability is greater than a preset threshold, the entity is determined to be the target entity corresponding to the event role; otherwise, if the predicted probability is not greater than the preset threshold, the entity is determined not to be the target entity corresponding to the event role.
[0032] Exemplarily, after obtaining at least one event record corresponding to the target text, processing may be performed based on the event record corresponding to the target text. For example, the event record corresponding to the target text may be processed in at least one of the following ways.
[0033] In one possible implementation, after determining at least one event record corresponding to the target text, the event record corresponding to the target text may be displayed on the target page. For example, by displaying the event record corresponding to the target text on the target page, a user may query the event record corresponding to the target text and thereby obtain information about the event record in the target text.
[0034] In one possible implementation, after determining at least one event record corresponding to the target text, the event record corresponding to the target text may be stored in the target knowledge graph. For example, based on a constructed target knowledge graph (the construction process of this target knowledge graph is not limited), the event record corresponding to the target text may be used as supplementary data of the target knowledge graph, and the event record corresponding to the target text may be stored in the target knowledge graph. This process is not limited.
[0035] In one possible implementation, after determining at least one event record corresponding to the target text, if the event record corresponding to the target text matches the target information of interest, the information corresponding to the target text is pushed to the target device corresponding to the target information of interest. For example, the target information of interest (such as entity A, entity B, etc.) and the target device information corresponding to the target information of interest (such as IP address, mobile phone number, etc.) can be pre-configured. On this basis, if the event record corresponding to the target text matches the target information of interest (such as the event record includes entity A, entity B, etc.), the information corresponding to the target text (such as the target text itself, the link to the target text, the event record corresponding to the target text, etc.) can be pushed to the target device corresponding to the target device information, such as pushing the information to the target device based on the IP address or mobile phone number.
[0036] It can be seen from the above technical solutions that in the embodiment of the present application, a chapter-level event extraction method based on a graph model is proposed, which can accurately extract multiple entities used to describe the same event from the text. For the chapter-level event extraction task, a relationship graph containing sentences, entity mentions and entities is designed, and a multi-level (node attention and graph attention) attention mechanism is designed to simulate the information flow pattern between "sentence-entity mention-entity", to reflect the influence of different nodes, different edges, and different graphs on the final representation vector, and to represent the three local graphs respectively, so as to better capture the correlation between different event elements in the same event. The graph contains richer relationships, which is conducive to capturing the connection between cross-sentence entities and can avoid the argument dispersion problem in chapter-level event extraction. The interactive relationship between event elements under the same event can be effectively modeled, which can greatly improve the performance of the event extraction system. In addition, in the embodiment of the present application, by modeling the event table filling task as a path extension task, the shortcomings of poor accuracy and long time consumption are solved, and end-to-end modeling of event type recognition, event argument recognition, and event table filling can be achieved, effectively solving the problems of multi-event extraction and argument dispersion in chapter-level event extraction, which can greatly improve the performance of the event extraction system.
[0037] The following describes the technical solutions of the embodiments of the present application in conjunction with specific application scenarios.
[0038] Event extraction involves extracting interesting event elements (such as names of people, institutions, and dates) from unstructured text about a target event (e.g., equity pledge) and organizing these elements into a single event record. Event extraction is a crucial task in both public opinion management and finance. In finance, events serve as a crucial decision-making reference for investment analysis and asset management. They are also a crucial component of knowledge graphs, making event extraction essential for graph reasoning and event analysis.
[0039] In an embodiment of the present application, an event extraction method is proposed. The event extraction method is a chapter-level event extraction method based on a graph model. The graph model can effectively model the interactive relationship between event elements under the same event, which can greatly improve the performance of the event extraction system. For the chapter-level event extraction task, this embodiment designs a relationship graph containing sentences, entity mentions and entities, which can more effectively model the "sentence-entity mention-entity" information flow pattern. When representing nodes, this embodiment designs a multi-level (node attention and graph attention) attention mechanism to reflect the influence of different nodes / different edges / different graphs on the final representation vector. By adding event table filling to the overall algorithm framework, the algorithm performance is improved.
[0040] See also Figure 2FIG. 1 is a flow chart of an event extraction method, which may include:
[0041] Step 201: Chapter-level text preprocessing: For example, if the input is a chapter-level text, the chapter-level text is segmented into N sentences using a regular expression or other method, and the length of each sentence is less than a preset length threshold.
[0042] Step 202: Entity recognition: For example, the input is N sentences of paragraph-level text, and the event elements of interest (such as person names, organization names, amounts, time, etc.) are identified from each sentence.
[0043] Step 203: Construct a heterogeneous relationship graph. For example, a heterogeneous relationship graph may be constructed. The heterogeneous relationship graph may include sentence nodes, entity nodes, and entity mention nodes. The node relationships in the heterogeneous relationship graph may include order relationships, subordinate relationships, and same argument role relationships.
[0044] Step 204: Heterogeneous graph interaction network representation. For example, based on the heterogeneous relationship graph, a relationship graph-driven self-attention mechanism is designed to capture the interaction information between different event elements in the same event.
[0045] Step 205: event type identification, that is, using sentence information to determine the event type in the chapter-level text.
[0046] Step 206: Filling the event table, that is, filling the event table by path extension.
[0047] The processing of steps 201 to 206 will be described below with reference to a specific embodiment.
[0048] 1. Chapter-level text preprocessing. For example, a target text may be obtained, which may be a chapter-level text. Multiple sentences in the target text may be obtained. For example, the target text may be segmented into N sentences using a regular expression, etc., where the length of each sentence may be less than a preset length threshold (which may be configured based on experience).
[0049] 2. Entity recognition. Exemplarily, after the target text is divided into multiple sentences (such as N sentences), multiple entities can be obtained from the multiple sentences, and multiple entity mentions can be obtained from the multiple sentences, and the initial sentence vector, the initial entity mention vector and the initial entity vector can be obtained. Among them, the entity mention is a continuous string of characters representing an entity in a sentence. For example, the "chairman" in the sentence "Mr. Zhang is the chairman of the company" is an entity mention, and the "chairman" appearing in multiple sentences represents different entity mentions. Entity mentions with the same characters represent the same entity. For example, although "chairman" appears in multiple sentences, these entity mentions all correspond to the same entity "chairman".
[0050] After obtaining multiple entities (such as M entities) from multiple sentences, the initial entity vector corresponding to each entity can be determined. For example, an entity can include multiple words or phrases. The initial entity vector corresponding to the entity is determined based on the word vectors of these words or phrases. There is no restriction on this process. In this way, M initial entity vectors corresponding to M entities can be obtained. The M initial entity vectors are recorded as {e1, e2, ..., e M}, e1 represents the initial entity vector corresponding to the first entity, e2 represents the initial entity vector corresponding to the second entity, and so on. M Represents the initial entity vector corresponding to the Mth entity.
[0051] Exemplarily, after obtaining multiple entity mentions (such as P entity mentions) from multiple sentences, the initial entity mention vector corresponding to each entity mention can be determined. For example, an entity mention can include multiple words or phrases, and the initial entity mention vector corresponding to the entity mention can be determined based on the word vectors of these words or phrases. There is no restriction on this process. In this way, P initial entity mention vectors corresponding to P entity mentions can be obtained, and the P initial entity mention vectors are recorded as {m1, m2, ..., m P}, m1 represents the initial entity mention vector corresponding to the first entity mention, m2 represents the initial entity mention vector corresponding to the second entity mention, and so on, m P represents the initial entity mention vector corresponding to the P-th entity mention.
[0052] After obtaining multiple entities and multiple entity mentions from multiple sentences, the initial sentence vector corresponding to each sentence can be determined. For example, a sentence includes a large number of words or phrases, and the initial sentence vector corresponding to the sentence can be determined based on the word vectors of these words or phrases. There is no restriction on this determination process. In this way, N initial sentence vectors corresponding to N sentences can be obtained. These N initial sentence vectors are recorded as {s1, s2, ..., s N}, s1 represents the initial sentence vector corresponding to the first sentence, s2 represents the initial sentence vector corresponding to the second sentence, and so on. N Represents the initial sentence vector corresponding to the Nth sentence.
[0053] In one possible implementation, in order to obtain multiple entities and multiple entity mentions from multiple sentences, an entity recognition model can be pre-trained. The entity recognition model can be a network model using Transformer and CRF (Conditional Random Field). There is no restriction on the training process of this entity recognition model. The entity recognition model is used to obtain entities and entity mentions from sentences and generate initial sentence vectors, initial entity mention vectors, and initial entity vectors. For example, the training samples can be sample sentences and calibration information, and the calibration information is used to represent the entities and entity mentions in the sample sentences. In this way, the entity recognition model can be trained based on the training samples.
[0054] Based on the trained entity recognition model, after the target text is divided into N sentences, the N sentences can be input into the entity recognition model, which processes the N sentences without any restrictions, and obtains multiple entities and multiple entity mentions in the N sentences, such as M entities and P entity mentions. The M entities and P entity mentions are the event elements of interest in the N sentences. Figure 3 As shown, there are N sentences on the left. The N sentences can be input into the entity recognition model, and the entity recognition model processes the N sentences to obtain multiple entity mentions. There are multiple entity mentions on the right.
[0055] 3. Constructing a Heterogeneous Relationship Graph. For example, after obtaining multiple sentences, multiple entities, and multiple entity mentions, a heterogeneous relationship graph can be generated based on the multiple sentences, multiple entities, and multiple entity mentions. The heterogeneous relationship graph can include the association relationships between sentences, entity mentions, and entities. The node relationships in the heterogeneous relationship graph can include, but are not limited to, sequential relationships, subordinate relationships, and relationships with the same argument role.
[0056] For example, the relationship graph is defined as a function with object type mapping In a directed graph G = (V, E) with V→A and a relationship type mapping function ψ:E→R, each node v∈V in the relationship graph belongs to a specific object type in A, and each edge E∈E in the relationship graph belongs to a specific relationship type in R. If the number of object types |A| in the relationship graph is greater than 1 or the number of relationship types |R| is greater than 1, then the relationship graph is called a heterogeneous relationship graph. Otherwise, the relationship graph is called a homogeneous relationship graph. In other words, a homogeneous relationship graph contains only one type of node and one type of relationship. In a heterogeneous relationship graph, the sum of the number of node types and the number of relationship types is greater than 1. The relationship graph in this embodiment refers to a heterogeneous relationship graph.
[0057] For example, see Figure 4 As shown, the following steps can be used to construct a heterogeneous relationship graph:
[0058] Step 401: Construct a plurality of sentence nodes corresponding to a plurality of sentences, a plurality of entity nodes corresponding to a plurality of entities, and a plurality of entity mention nodes corresponding to a plurality of entity mentions.
[0059] For example, nodes in a heterogeneous relationship graph can be constructed, such as sentence nodes, entity nodes, and entity mention nodes. For example, each sentence corresponds to a sentence node, N sentences correspond to N sentence nodes, each entity corresponds to an entity node, M entities correspond to M entity nodes, each entity mention corresponds to an entity mention node, and P entity mentions correspond to P entity mention nodes.
[0060] Step 402: Construct edge relationships between sentence nodes.
[0061] Exemplarily, when constructing an edge relationship between sentence nodes, for any sentence, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to multiple sentences following the sentence.
[0062] For example, the edge relationship between sentence nodes is a sequential relationship. For each sentence in N sentences, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to the k sentences following the sentence, where k is a positive integer. Assuming k is 2, then the sentence node corresponding to the first sentence has an edge relationship with the sentence nodes corresponding to the second and third sentences, the sentence node corresponding to the second sentence has an edge relationship with the sentence nodes corresponding to the third and fourth sentences, and so on.
[0063] Step 403: Construct an edge relationship between a sentence node and an entity mention node. Exemplarily, when constructing an edge relationship between a sentence node and an entity mention node, if a sentence includes an entity mention, then the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention.
[0064] Exemplarily, the edge relationship between a sentence node and an entity mention node is a subordinate relationship. For each sentence in the N sentences, if the sentence includes an entity mention, the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention. For example, if the sentence includes 1 entity mention, the sentence node has an edge relationship with 1 entity mention node. If the sentence includes 2 entity mentions, the sentence node has an edge relationship with 2 entity mention nodes, and so on. If the sentence does not include an entity mention, then the sentence node has no edge relationship with any entity mention node.
[0065] Step 404: Construct edge relationships between entity mention nodes.
[0066] Exemplarily, when constructing an edge relationship between entity mention nodes, if two entity mentions are in the same sentence, then the entity mention nodes corresponding to the two entity mentions have an edge relationship. For example, if a sentence includes at least two entity mentions, then for any two entity mentions among the at least two entity mentions, the entity mention nodes corresponding to the two entity mentions have an edge relationship, and the edge relationship between the entity mention nodes corresponding to the two entity mentions is a sequential relationship.
[0067] Exemplarily, when constructing an edge relationship between entity mention nodes, if two entity mentions have the same event role, then the entity mention nodes corresponding to the two entity mentions have an edge relationship. For example, at least two entity mentions with the same event role (such as chairman and supervisor both represent job titles and belong to the same event role) are selected from all entity mentions. For any two entity mentions among the at least two entity mentions, the entity mention nodes corresponding to the two entity mentions have an edge relationship, and the edge relationship between the entity mention nodes corresponding to the two entity mentions is a same-argument relationship.
[0068] When constructing an edge relationship between entity mention nodes, if two entity mentions represent the same entity, then the entity mention nodes corresponding to the two entity mentions have an edge relationship. For example, from all entity mentions, select at least two entity mentions with the same entity role (such as Zhang San goes to school and Zhang San leaves school, the two Zhang Sans in the two sentences are two entity mentions, representing the same entity). For any two entity mentions among the at least two entity mentions, the entity mention nodes corresponding to the two entity mentions have an edge relationship, and the edge relationship between the entity mention nodes corresponding to the two entity mentions is a same-entity relationship.
[0069] Step 405: Construct an edge relationship between the entity mention node and the entity node.
[0070] When constructing an edge relationship between an entity mention node and an entity node, if an entity mentions the corresponding entity, then the entity mention node corresponding to that entity mention has an edge relationship with the entity node corresponding to that entity. For example, an entity can correspond to multiple entity mentions. In this case, for each entity mention corresponding to that entity, the entity mention node corresponding to that entity mention has an edge relationship with the entity node corresponding to that entity, and the edge relationship between the entity mention node and the entity node is a subordinate relationship.
[0071] Step 406: Obtain a sentence relationship graph, a sentence-entity mention relationship graph, and an entity mention-entity relationship graph based on the heterogeneous relationship graph. The sentence relationship graph may include the association relationships between sentences, the sentence-entity mention relationship graph may include the association relationships between sentences and entity mentions, the sentence-entity mention relationship graph may include the association relationships between entity mentions and entity mentions, and the entity mention-entity relationship graph may include the association relationships between entity mentions and entities.
[0072] For example, based on steps 401 to 405, a heterogeneous relationship map can be constructed, see Figure 5 As shown in the figure, a schematic diagram of a heterogeneous relationship graph is shown. The nodes in the first circle are sentence nodes, the nodes in the second circle are entity mention nodes, and the nodes in the third circle are entity nodes. The heterogeneous relationship graph can include the association relationships between sentence nodes, the association relationships between sentence nodes and entity mention nodes, the association relationships between entity mention nodes and entity mention nodes, and the association relationships between entity mention nodes and entity nodes. After obtaining the heterogeneous relationship graph, the heterogeneous relationship graph can be disassembled into three independent local graphs to better learn the relationships between sentences, entity mentions, and entities.
[0073] The three independent local graphs are sentence relationship graph, sentence and entity mention relationship graph, and entity mention and entity relationship graph. Among them, the sentence relationship graph can include the relationship between sentence nodes, which is expressed as See also Figure 5 As shown, the relationship graph in the first circle is used to represent the sentence relationship graph. The sentence and entity mention relationship graph can include the relationship between the sentence node and the entity mention node, which is expressed as See also Figure 5 As shown, the relationship graphs in the first and second circles are used to represent the sentence and entity mention relationship graphs. The entity mention and entity relationship graphs can include the relationship between the entity mention node and the entity node, which is represented as See also Figure 5 As shown in the figure, the relationship graphs in the second and third circles are used to represent entity mentions and entity relationship graphs. In the sentence relationship graph, S represents the sentence vector corresponding to the sentence node. Indicates the edge relationship between sentence nodes. In the sentence and entity mention relationship graph, S represents the sentence vector corresponding to the sentence node, and M represents the entity mention vector corresponding to the entity mention node. Represents the edge relationship between the sentence node and the entity mention node, Indicates the edge relationship between entity mention nodes and entity mention nodes. In the entity mention and entity relationship graph, M represents the entity mention vector corresponding to the entity mention node, and E represents the entity vector corresponding to the entity node. Represents the edge relationship between entity mention nodes and entity nodes.
[0074] 4. Representation of heterogeneous graph interaction networks.
[0075] For example, in order to solve the heterogeneity problem of heterogeneous relationship graphs, the heterogeneous relationship graphs can adopt a multi-level attention structure (such as node attention and graph attention), and update the sentence vector, entity vector and entity mention vector through multiple iterations. The initial value of the sentence vector is recorded as This is the initial sentence vector mentioned above, and the initial value of the entity vector is recorded as This is the initial entity vector mentioned above. The initial value of the entity mention vector is recorded as This is the initial entity mention vector mentioned above. It represents the initial sentence vector corresponding to the k-th sentence. The value range of k is 1-N. For the convenience of description, the initial sentence vector corresponding to the k-th sentence is taken as an example. Represents the initial entity vector corresponding to the z-th entity. The value range of z is 1-M. For the convenience of description, the initial entity vector corresponding to the z-th entity is taken as an example. Represents the initial entity mention vector corresponding to the d-th entity mention. The value range of d is 1-P. For the convenience of description, the initial entity mention vector corresponding to the d-th entity mention is taken as an example.
[0076] For the initial sentence vector The sentence vector after the first iteration is recorded as Will The second iteration is continued as the initial sentence vector, and the sentence vector after the second iteration is recorded as Will The third iteration is continued as the initial sentence vector, and so on, until the last iteration, and the sentence vector after the last iteration is used as the target sentence vector. In summary, the initial sentence vector can be iterated multiple times to obtain the target sentence vector corresponding to the initial sentence vector.
[0077] Initial entity vector The entity vector after the first iteration is recorded as Will As the initial entity vector Continue with the second iteration, and the entity vector after the second iteration is recorded as Will The third iteration is continued as the initial entity vector, and so on, until the last iteration, and the entity vector after the last iteration is used as the target entity vector. In summary, the initial entity vector can be iterated multiple times to obtain the target entity vector corresponding to the initial entity vector.
[0078] Among them, the initial entity mention vector The entity mention vector after the first iteration is recorded as Will The second iteration is continued as the initial entity mention vector, and the entity mention vector after the second iteration is recorded as Will The third iteration is continued as the initial entity mention vector, and so on until the last iteration, and the entity mention vector after the last iteration is used as the target entity mention vector. In summary, the initial entity mention vector can be iterated multiple times to obtain the target entity mention vector.
[0079] Taking the lth round of iteration as an example, the sentence vector after the lth iteration is recorded as The entity vector after the lth iteration is recorded as The entity mention vector after the lth iteration is recorded as Based on sentence vector Entity Vector and entity mention vectors You can determine the sentence vector after the l+1th iteration The entity vector after the l+1th iteration is recorded as The entity mention vector after the l+1th iteration is recorded as
[0080] In summary, when l is 0, based on the sentence vector after the 0th iteration Entity Vector and entity mention vectors Determine the sentence vector after the first iteration Entity Vector and entity mention vectors When l is 1, based on the sentence vector after the first iteration Entity Vector and entity mention vectors Determine the sentence vector after the second iteration Entity Vector and entity mention vectors Similarly, assuming a total of 10 iterations, when l is 9, the sentence vector after the 9th iteration is Entity Vector and entity mention vectors Determine the sentence vector after the 10th iteration Entity Vector and entity mention vectors And the sentence vector after the 10th iteration Entity Vector and entity mention vectors That is, the target sentence vector, target entity vector and target entity mention vector. At this point, the iterative process is completed to obtain the target sentence vector, target entity vector and target entity mention vector.
[0081] Taking the first round of iteration as an example, based on the sentence vector Entity Vector and entity mention vectors The following steps can be used to determine the sentence vector of round l+1 Entity Vector and entity mention vectors In order to distinguish conveniently, the sentence vector of the first round can be It is called the initial sentence vector, and the entity vector of the first round is It is called the initial entity vector, and the entity mention vector of the first round is It is called the initial entity mention vector, and the sentence vector of round l+1 is It is called the target sentence vector, and the entity vector of round l+1 is It is called the target entity vector, and the entity mention vector of round l+1 is This is called the target entity mention vector. Note that in the next iteration, the target sentence vector is updated to the initial sentence vector, the target entity vector is updated to the initial entity vector, and the target entity mention vector is updated to the initial entity mention vector. This iterative process repeats until the final iteration, which we will not repeat here.
[0082] Step S11: Update sentence vector.
[0083] For example, when updating the sentence vector When Information, sentences and entity mention relationship graph Information, get the sentence vector For example, we can use formula (1) to determine the sentence vector Of course, formula (1) is just an example and is not limiting.
[0084]
[0085] In formula (1), represents the target sentence vector corresponding to the k-th sentence, represents the initial sentence vector corresponding to the k-th sentence, Represents the edge relationship between sentence nodes, It represents the rth relationship between sentences and sentence nodes. The number of relationships between sentences and sentence nodes can be 1 or more. represents the first graph attention vector, represents the graph fusion features between sentences, represents the second graph attention vector, It represents the graph fusion feature between sentences. From formula (1), it can be seen that the graph fusion feature between sentences can be First graph attention vector Graph fusion features between sentence mentions Second graph attention vector and the initial sentence vector Determine the target sentence vector corresponding to the kth sentence
[0086] In formula (1), Represents the graph fusion features between sentences, used to represent the sentence relationship graph The information of sentence nodes, that is, the fusion features of sentence nodes, for example, the graph fusion features between sentences can be determined by formula (2) Of course, formula (2) is just an example and is not limiting.
[0087]
[0088] In formula (2), It represents the sentence node that has the rth edge relationship with the kth sentence node. That is to say, based on the sentence relationship graph, we can find the sentence nodes that have the rth edge relationship with the kth sentence node. These sentence nodes are recorded as a. It represents the sentence vector of sentence node a. The number of sentence nodes a can be 1 or more. The sentence vector of sentence node a It can be recorded as the initial sentence vector of the kth sentence node The corresponding associated sentence vector. It can be used to represent the parameter matrix, which can be configured based on experience or obtained from a trained model. No restrictions. Represents the node-level attention between the k-th sentence node and sentence node a, which is used to represent the initial sentence vector of the k-th sentence node The associated sentence vector of sentence node a The similarity between them can be recorded as the first node attention vector. The first node attention vector can also be determined by formula (3) Of course, formula (3) is just an example and is not limiting.
[0089]
[0090] In formula (3), W s l represents the parameter matrix, represents the initial sentence vector of the k-th sentence node, F represents the associated sentence vector corresponding to the initial sentence vector of the k-th sentence node. ss Represents the similarity function, which can be configured based on experience and is not restricted. In summary, the initial sentence vector and associated sentence vectors Substitute into the similarity function F ss , get the first node attention vector
[0091] Combining formula (2) and formula (3), it can be seen that the initial sentence vector can be determined based on the sentence relationship graph The corresponding associated sentence vector (That is, based on the sentence relationship graph, find the sentence node a that has an edge relationship with the kth sentence node, and then get the sentence vector corresponding to the sentence node a ), based on the initial sentence vector and associated sentence vectors The first node attention vector can be determined It can be based on the first node attention vector and associated sentence vectors Determine inter-sentence graph fusion features
[0092] In formula (1), Represents the graph fusion feature between sentence mentions, which is used to represent the relationship graph between sentences and entity mentions The information of the sentence node and the entity mention node is the fusion feature. For example, the graph fusion feature between sentence mentions can be determined by formula (4): There is no restriction on this.
[0093]
[0094] In formula (4), Represents the entity mention node that has an edge relationship with the k-th sentence node. Based on the sentence-entity mention relationship graph, we can find the entity mention node that has an edge relationship with the k-th sentence node. These entity mention nodes are denoted as b. The entity mention vector of entity mention node b is represented by entity mention node b. The number of entity mention nodes b can be 1 or more. The entity mention vector of entity mention node b is represented by entity mention node b. It can be recorded as the initial sentence vector of the kth sentence node The corresponding initial entity mention vector. Used to represent parameter matrices, which can be configured empirically. represents the node-level attention between the k-th sentence node and the entity mention node b, which is used to represent the initial sentence vector of the k-th sentence node The initial entity mention vector of entity mention node b The similarity between them can be recorded as the second node attention vector.
[0095] For the second node attention vector The second node attention vector can also be determined by formula (5) Of course, formula (5) is just an example and is not limiting.
[0096]
[0097] In formula (5), represents the parameter matrix, represents the initial sentence vector of the k-th sentence node, F represents the initial entity mention vector corresponding to the initial sentence vector of the k-th sentence node. sm Represents the similarity function, which can be configured based on experience and is not restricted. In summary, the initial sentence vector and the initial entity mention vector Substitute into the similarity function F sm , get the second node attention vector
[0098] Combining formula (4) and formula (5), it can be seen that the initial sentence vector can be determined based on the sentence and entity mention relationship graph The corresponding initial entity mention vector (That is, based on the sentence and entity mention relationship graph, find the entity mention node b that has an edge relationship with the k-th sentence node, and then get the initial entity mention vector corresponding to the entity mention node b ), based on the initial sentence vector and the initial entity mention vector The second node attention vector can be determined Then, we can use the second node attention vector and the initial entity mention vector Determine the graph fusion features between sentence mentions
[0099] In formula (1), It is the graph-level attention, which can be recorded as the first graph attention vector, used to represent the graph fusion features between sentences. The weight of , for example, the first graph attention vector can be determined by formula (6) Of course, formula (6) is just an example and is not limiting.
[0100]
[0101] In formula (6), represents the initial sentence vector of the k-th sentence node, represents the inter-sentence graph fusion feature, F sp Represents the mapping function, which can be configured based on experience and is not restricted. In summary, the initial sentence vector can be and inter-sentence graph fusion features Substitute the mapping function F sp , get the first graph attention vector Obviously, from formula (6), we can see that we can use the sentence graph fusion feature and the initial sentence vector Determine the first graph attention vector
[0102] In formula (1), It is the graph-level attention, which can be recorded as the second graph attention vector, used to represent the graph fusion features between sentence mentions. The weight of , for example, the second graph attention vector can be determined by formula (7) Of course, formula (7) is just an example and is not limiting.
[0103]
[0104] In formula (7), represents the initial sentence vector of the k-th sentence node, represents the graph fusion feature between sentence mentions, F sp Represents the mapping function, which can be configured based on experience and is not restricted. In summary, the initial sentence vector can be and sentence mention graph fusion features Substitute the mapping function F sp , get the second graph attention vector Obviously, from formula (7), we can see that we can fuse features based on the graph between sentence mentions. and the initial sentence vector Determine the second graph attention vector
[0105] Combined with formula (1) to formula (7), it can be seen from the above content that in step S11, the associated sentence vector corresponding to the initial sentence vector can be determined based on the sentence relationship graph, and the first node attention vector can be determined based on the initial sentence vector and the associated sentence vector; the inter-sentence graph fusion feature can be determined based on the first node attention vector and the associated sentence vector; and the first graph attention vector can be determined based on the inter-sentence graph fusion feature and the initial sentence vector. The initial entity mention vector corresponding to the initial sentence vector is determined based on the sentence and entity mention relationship graph, and the second node attention vector is determined based on the initial sentence vector and the initial entity mention vector; the inter-sentence mention graph fusion feature is determined based on the second node attention vector and the initial entity mention vector; and the second graph attention vector is determined based on the inter-sentence mention graph fusion feature and the initial sentence vector. The target sentence vector is determined based on the inter-sentence graph fusion feature, the first graph attention vector, the inter-sentence mention graph fusion feature, the second graph attention vector, and the initial sentence vector.
[0106] Step S12: Update the entity mention vector. For example, when updating the entity mention vector When , the sentence and entity mention relationship graph can be aggregated Information and entity mentions and entity relationship graphs Information, get the entity mention vector For example, we can use formula (8) to determine the entity mention vector Of course, formula (8) is just an example and is not intended to be limiting.
[0107]
[0108] In formula (8), represents the target entity mention vector corresponding to the d-th entity mention, represents the initial entity mention vector corresponding to the d-th entity mention, Represents the edge relationship between entity mention nodes and entity mention nodes, Represents the rth relationship between entity mention nodes, such as order relationship, same-argument relationship, same-entity relationship, etc. represents the graph attention vector 1, Represents the graph fusion features between sentences and entity mentions, represents the graph attention vector 2, The graph fusion feature representing the r-th relationship between entity mentions, represents the graph attention vector 3, Represents the graph fusion feature between entity mentions and entities. As can be seen from formula (8), the target entity mention vector can be determined based on the graph fusion feature between sentences and entity mentions, graph attention vector 1, the graph fusion feature between entity mentions and entity mentions, graph attention vector 2, the graph fusion feature between entity mentions and entities, graph attention vector 3, and the initial entity mention vector.
[0109] In formula (8), Represents the graph fusion feature between sentences and entity mentions, which is used to represent the relationship graph between sentences and entity mentions Information such as sentence and entity mention relationship graph The information between the sentence and the entity mention, that is, the fusion feature of the entity mention node and the sentence node, for example, the graph fusion feature between the sentence and the entity mention can be determined by formula (9): There is no restriction on this.
[0110]
[0111] In formula (9), Represents the sentence nodes that have an edge relationship with the d-th entity mention node. That is, based on the sentence and entity mention relationship graph, we can find the sentence nodes that have an edge relationship with the d-th entity mention node. These sentence nodes are denoted as a. It represents the sentence vector of sentence node a, the sentence vector of sentence node a It can be recorded as the initial entity mention vector The corresponding initial sentence vector. W s l Used to represent parameter matrices, which can be configured empirically. represents the node-level attention between the d-th entity mention node and the sentence node a, and is used to represent the initial entity mention vector of the d-th entity mention node With the initial sentence vector The similarity between them can be recorded as the node attention vector1.
[0112] For the node attention vector 1, it can also be determined by formula (10), and there is no restriction on this.
[0113]
[0114] In formula (10), W s l represents the parameter matrix, represents the initial entity mention vector of the d-th entity mention node, represents the initial sentence vector, F ss Represents the similarity function, which can be configured based on experience.
[0115] In formula (8), Represents the fusion features of entity mentions and graphs between entity mentions, which is used to represent the relationship graph between sentences and entity mentions Information such as sentence and entity mention relationship graph The information between entity mentions in the graph is the fusion feature between entity mention nodes and entity mention nodes. For example, the graph fusion feature between entity mentions and entity mentions is determined by formula (11): There is no restriction on this.
[0116]
[0117] In formula (11), represents the entity mention node that has the rth edge relationship with the dth entity mention node. That is, based on the sentence-entity mention relationship graph, we can find the entity mention node that has the rth edge relationship with the dth entity mention node. These entity mention nodes are denoted as b. The entity mention vector of entity mention node b is represented by It can be recorded as the initial entity mention vector The corresponding associated entity mention vector. Used to represent parameter matrices, which can be configured empirically. represents the node-level attention between the d-th entity mention node and the entity mention node b, and is used to represent the initial entity mention vector of the d-th entity mention node. The entity mention vector associated with entity mention node b The similarity between them can be recorded as the node attention vector2.
[0118] For the node attention vector 2, it can also be determined by formula (12), and there is no restriction on this.
[0119]
[0120] In formula (12), represents the parameter matrix, represents the initial entity mention vector of the d-th entity mention node, represents the associated entity mention vector, F ss Represents the similarity function.
[0121] In formula (8), Represents the fusion features of entity mentions and entity relationship graphs, which are used to represent entity mentions and entity relationship graphs The information of entity mention nodes and entity nodes is the fusion feature. For example, the fusion feature of entity mention and entity graph is determined by formula (13): There is no restriction on this.
[0122]
[0123] In formula (13), represents the entity node that has an edge relationship with the d-th entity mention node. That is, based on the entity mention and entity relationship graph, we can find the entity nodes that have an edge relationship with the d-th entity mention node. These entity nodes are denoted as c. It represents the entity vector of entity node c. The entity vector of entity node c It can be recorded as the initial entity mention vector The corresponding initial entity vector. W e l Used to represent parameter matrices, which can be configured empirically. represents the node-level attention between the d-th entity mention node and the entity node c, and is used to represent the initial entity mention vector of the d-th entity mention node. and the initial entity vector of entity node c The similarity between them can be recorded as node attention vector 3. Node attention vector 3 can also be determined by formula (14), which is not limited.
[0124]
[0125] In formula (14), represents the parameter matrix, represents the initial entity mention vector of the d-th entity mention node, represents the initial entity vector of entity node c, F ss Represents the similarity function.
[0126] In formula (8), Represents the graph attention vector 1, which is used to represent the weight of the graph fusion feature between the sentence and the entity mention, such as determining the graph attention vector 1 through formula (15). Represents the graph attention vector 2, which is used to represent the weight of the graph fusion features between entity mentions and entity mentions, such as determining the graph attention vector 2 through formula (16). Represents the graph attention vector 3, which is used to represent the weight of the entity mention and the inter-entity graph fusion feature, such as determining the graph attention vector 3 through formula (17).
[0127]
[0128]
[0129]
[0130] In the above formula, represents the initial entity mention vector of the d-th entity mention node, Represents the graph fusion features between sentences and entity mentions, Represents the entity mention and the graph fusion feature between entity mentions, F represents the fusion feature of entity mention and entity graph, sp Represents a mapping function.
[0131] Combined with formula (8)-formula (17), it can be seen from the above content that in step S12, the initial sentence vector corresponding to the initial entity mention vector can be determined based on the sentence-entity mention relationship graph, and the node attention vector 1 can be determined based on the initial entity mention vector and the initial sentence vector; the graph fusion feature between the sentence and the entity mention can be determined based on the node attention vector 1 and the initial sentence vector; and the graph attention vector 1 can be determined based on the graph fusion feature between the sentence and the entity mention and the initial entity mention vector. The associated entity mention vector corresponding to the initial entity mention vector can be determined based on the sentence-entity mention relationship graph, and the node attention vector 2 can be determined based on the initial entity mention vector and the associated entity mention vector; the graph fusion feature between the entity mention and the entity mention can be determined based on the node attention vector 2 and the associated entity mention vector; and the graph attention vector 2 can be determined based on the graph fusion feature between the entity mention and the entity mention and the initial entity mention vector. An initial entity vector corresponding to the initial entity mention vector can be determined based on the entity mention and entity relationship graph, and a node attention vector 3 can be determined based on the initial entity mention vector and the initial entity vector. A graph fusion feature between entity mentions and entities can be determined based on the node attention vector 3 and the initial entity vector. A graph attention vector 3 can be determined based on the graph fusion feature between entity mentions and entities and the initial entity mention vector. A target entity mention vector corresponding to the initial entity mention vector can be determined based on the graph fusion feature between sentences and entity mentions, graph attention vector 1, the graph fusion feature between entity mentions and entity mentions, graph attention vector 2, the graph fusion feature between entity mentions and entities, graph attention vector 3, and the initial entity mention vector.
[0132] Step S13: Update of entity vector. For example, when updating entity vector When , entity mentions and entity relationship graphs can be aggregated Information of For example, the entity vector can be determined using formula (18) Of course, formula (18) is just an example and is not limiting.
[0133]
[0134] In formula (18), Represents the target entity vector corresponding to the z-th entity, represents the initial entity vector corresponding to the z-th entity, represents the graph attention vector, It can be seen from formula (18) that the fusion features of entity mention and inter-entity graph can be Graph Attention Vector The initial entity vector corresponding to the z-th entity Determine the target entity vector corresponding to the z-th entity
[0135] In formula (18), Represents the fusion features of entity mentions and entity relationship graphs, which are used to represent entity mentions and entity relationship graphs The information of entity mention nodes and entity nodes is the fusion feature. For example, the fusion feature of entity mention and entity graph can be determined by formula (19):
[0136]
[0137] In formula (19), Represents the entity mention node that has an edge relationship with the z-th entity. That is, based on the entity mention and entity relationship graph, we can find the entity mention node that has an edge relationship with the z-th entity node. These entity mention nodes are denoted as a. The entity mention vector of the entity mention node a is represented by It can be recorded as the initial entity vector The corresponding initial entity mention vector. Used to represent parameter matrices, which can be configured empirically. Represents the node-level attention between the z-th entity node and the entity mention node a, which is used to represent the initial entity vector of the z-th entity node With the initial entity mention vector The similarity between them can be recorded as the node attention vector. The node attention vector can also be determined by formula (20), which is not limited.
[0138]
[0139] In formula (20), represents the parameter matrix, represents the initial entity vector of the z-th entity node, represents the initial entity mention vector, F ss Represents the similarity function, which can be configured based on experience.
[0140] In formula (19), Represents the graph attention vector, which is used to represent the weight of the entity mention and the inter-entity graph fusion feature, such as the graph attention vector determined by formula (21).
[0141]
[0142] In the above formula, represents the initial entity vector of the z-th entity node, Represents the fusion features of entity mentions and inter-entity graphs, represents the graph attention vector, F sp Represents a mapping function.
[0143] In combination with formula (18)-formula (21), in step S13, an initial entity mention vector corresponding to the initial entity vector can be determined based on the entity mention and entity relationship graph, and a node attention vector can be determined based on the initial entity vector and the initial entity mention vector; the entity mention and inter-entity graph fusion feature can be determined based on the node attention vector and the initial entity mention vector; and the graph attention vector can be determined based on the entity mention and inter-entity graph fusion feature and the initial entity vector. The target entity vector corresponding to the initial entity vector can be determined based on the entity mention and inter-entity graph fusion feature, the graph attention vector, and the initial entity vector.
[0144] In summary, the initial entity mention vector corresponding to the initial entity vector can be determined based on the entity mention and entity relationship graph; the node attention vector can be determined based on the initial entity vector and the initial entity mention vector; the entity mention and inter-entity graph fusion features can be determined based on the node attention vector and the initial entity mention vector; and the target entity vector can be determined based on the entity mention and inter-entity graph fusion features and the initial entity vector.
[0145] From the above, it can be seen that in this embodiment, N target sentence vectors corresponding to N initial sentence vectors can be obtained, and the N target sentence vectors are {s1, s2, ..., s N}, and obtain M target entity vectors corresponding to the M initial entity vectors. The M target entity vectors are {e1, e2, ..., e M}, and obtain P target entity mention vectors corresponding to the P initial entity mention vectors. The P target entity mention vectors are {m1, m2, ..., m P}.
[0146] See also Figure 6 As shown, a schematic diagram of sentence vector update, entity mention vector update and entity vector update is shown, that is, a multi-level (node attention and graph attention) attention mechanism is designed to simulate the information flow pattern between "sentence-entity mention-entity" to reflect the influence of different nodes, different edges and different graphs on the final representation vector.
[0147] 5. Event type identification. For example, after obtaining the target sentence vector, the target event type corresponding to the target text can be determined based on the target sentence vector, that is, all event types in the target text can be identified. For example, the target event type corresponding to the target text can be determined using the following steps:
[0148] Step S21 : pre-define an event type list, which may include all event types. For example, the event type list may include event types such as stock increase, stock decrease, and equity pledge.
[0149] Step S22: Pre-train an event type recognition model. The training process of this event type recognition model is not restricted. The event type recognition model is used to identify the event types corresponding to N sentence vectors. For example, the training samples can be N sentence vectors and calibration information, where the calibration information is used to indicate the event types corresponding to the N sentence vectors. In this way, the event type recognition model can be trained based on the training samples.
[0150] Exemplarily, the event type recognition model may be a network model using Transformer and Softmax, or may be another type of network model, and there is no limitation on the structure of the event type recognition model.
[0151] Step S23: For each event type in the event type list, the N target sentence vectors are input into the event type recognition model to obtain the predicted probability corresponding to the event type. If the predicted probability is greater than a preset threshold (which can be configured based on experience, such as 0.5, 0.6, etc.), the event type is determined to be the target event type; if the predicted probability is not greater than the preset threshold, the event type is determined not to be the target event type.
[0152] Each event type can be traversed in turn from the event type list. For the currently traversed event type, the N target sentence vectors {s1, s2, ..., s N} and the event type are input into the event type recognition model, which processes the N target sentence vectors to obtain the predicted probability corresponding to the event type. There is no restriction on this processing process. The predicted probability represents the probability value that the N target sentence vectors match the event type. Obviously, the greater the predicted probability, the greater the possibility that the N target sentence vectors match the event type, and vice versa.
[0153] If the predicted probability is greater than a preset threshold, the event type is determined to be the target event type corresponding to the target text. If the predicted probability is not greater than the preset threshold, the event type is determined not to be the target event type corresponding to the target text. At this point, the target event type corresponding to the target text can be determined, and an event type set S is output. Event type set S is used to record the target event types corresponding to the target text. Event type set S may include one target event type or at least two target event types.
[0154] In another possible implementation, the N target sentence vectors {s1, s2, ..., s N} is input to the event type recognition model, which processes the N target sentence vectors, such as obtaining a representation of the entire text, and finally obtains the predicted probability corresponding to each event type (that is, the predicted probability corresponding to each event type in the event type list). There is no restriction on this processing process. Based on the predicted probability corresponding to each event type, if the predicted probability is greater than a preset threshold, the event type is determined to be the target event type corresponding to the target text; if the predicted probability is not greater than the preset threshold, the event type is determined not to be the target event type corresponding to the target text. At this point, the target event type corresponding to the target text can be determined, and an event type set S is output. The event type set S is used to record the target event type corresponding to the target text.
[0155] 6. Event table filling. For each target event type corresponding to the target document, multiple event records corresponding to that target event type are generated. An event record includes multiple entities describing the same event. The target document may contain multiple target event types, and each target event type may correspond to multiple event records.
[0156] In a possible implementation, the following steps may be used to implement event table filling:
[0157] Step S31: traverse and find a target event type from the event type set S.
[0158] Step S32: Determine multiple event roles corresponding to the target event type.
[0159] Exemplarily, for each event type in the event type list, multiple event roles corresponding to the event type are pre-configured, and the order of the multiple event roles is configured. Therefore, after traversing the target event type, the multiple event roles corresponding to the target event type can be determined, and the order of the multiple event roles can be determined. For example, if the target event type corresponds to event role 1, event role 2, event role 3, and event role 4, the order of these four event roles is: event role 1 - event role 2 - event role 3 - event role 4.
[0160] Step S33: Traverse each event role in the order of the multiple event roles, and execute subsequent steps for the currently traversed event role. For example, first traverse event role 1, execute subsequent steps for event role 1, then traverse event role 2, execute subsequent steps for event role 2, and so on, until the last event role is traversed.
[0161] Step S34: For the currently traversed event role, determine the target sentence vector, target entity vector, path representation matrix, and memory matrix corresponding to the event role. Exemplarily, the path representation matrix may include feature vectors corresponding to target entities corresponding to each event role preceding the event role, and the memory matrix may include path representation matrices corresponding to multiple target event types corresponding to the target text. One path representation matrix corresponds to the feature vectors corresponding to target entities corresponding to all event roles in an event record.
[0162] For example, in the heterogeneous graph interaction network representation process, N target sentence vectors {s1, s2, ..., s N}, the N target sentence vectors can be used as the target sentence vectors corresponding to the event role, and the target sentence vectors corresponding to the event role can be recorded as matrix S.
[0163] In the heterogeneous graph interaction network representation process, M target entity vectors {e1, e2, ..., e M}, the M target entity vectors can be used as the target entity vectors corresponding to the event role, and the target entity vectors corresponding to the event role can be recorded as matrix E. Alternatively, the matrix E can be updated based on the role information corresponding to the event role (such as the role vector) to obtain the updated entity representation matrix Role J Indicates the role information corresponding to the event role, the entity representation matrix As the target entity vector corresponding to the event role, the target entity vector is recorded as a matrix
[0164] Exemplarily, for the currently traversed event role, the path characterization matrix corresponding to the event role can also be determined. For example, the path characterization matrix corresponding to event role 1 can be empty, and the path characterization matrix corresponding to event role 2 can include the feature vector corresponding to the target entity corresponding to event role 1. For the method of determining the target entity corresponding to event role 1, please refer to the subsequent embodiments. The path characterization matrix corresponding to event role 3 can include the feature vector corresponding to the target entity corresponding to event role 1 and the feature vector corresponding to the target entity corresponding to event role 2. The path characterization matrix corresponding to event role 4 can include the feature vector corresponding to the target entity corresponding to event role 1, the feature vector corresponding to the target entity corresponding to event role 2, and the feature vector corresponding to the target entity corresponding to event role 3.
[0165] Exemplarily, for the currently traversed event role, the memory matrix corresponding to the event role can also be determined. For example, for the first target event type 1 in the event type set S, the memory matrix can be empty. For the second target event type 2 in the event type set S, the memory matrix can include the feature vectors corresponding to the target entities corresponding to all event roles of the target event type 1. For the third target event type 3 in the event type set S, the memory matrix can include the feature vectors corresponding to the target entities corresponding to all event roles of the target event type 1 and the target event type 2, and so on.
[0166] Step S35: For the currently traversed event role, if a memory matrix exists, then the target entity corresponding to the event role can be selected from multiple entities (i.e., M entities in N sentences) based on the target sentence vector, target entity vector, path representation matrix, and memory matrix corresponding to the event role. Alternatively, if a memory matrix does not exist, then the target entity corresponding to the event role can be selected from multiple entities based on the target sentence vector, target entity vector, and path representation matrix corresponding to the event role.
[0167] Exemplarily, event table filling is used to group entities describing the same event into an event record. In this embodiment, the event table filling task can be modeled as a path extension task, that is, the order of event role combination is predefined, and the path can be extended starting from a virtual node in a specific order.
[0168] See also Figure 7 As shown, the target event type corresponds to event role 1, event role 2, event role 3 and event role 4. A virtual node is initialized as the initial node, and the target sentence vector, target entity vector, path representation matrix and memory matrix corresponding to event role 1 are determined. The target sentence vector is recorded as matrix S, and the target entity vector is recorded as matrix The path representation matrix is denoted as matrix U i, the memory matrix is recorded as matrix G. Among them, for the matrix U i For example, assuming that the current path contains J-1 entities, the representation matrix of the current path is The representation matrix U of the current path i is the concatenation result of these J-1 entity representations. For event role 1, the matrix U i Can be empty. For the matrix G, the matrix G is composed of entity representations on the complete historical path, that is, for each event role of target event type 1, the matrix G can be empty, and for each event role of other target event types, the matrix G is not empty.
[0169] After obtaining the matrix S, the matrix Matrix U i , matrix G, you can also update these matrices, learn matrix S, matrix Matrix U i , the interaction information between matrices G, for example, using the Transformer model to learn matrix S, matrix Matrix U i , the interactive information between the matrix G, and the updated matrix matrix matrix matrix Right now
[0170] Based on the updated matrix matrix matrix matrix You can determine the target entity corresponding to event role 1, see Figure 7 As shown, event role 1 corresponds to target entity A and target entity B.
[0171] Then, determine the target sentence vector, target entity vector, path representation matrix and memory matrix corresponding to event role 2. The target sentence vector is recorded as matrix S, and the target entity vector is recorded as matrix The path representation matrix is denoted as matrix U i , the memory matrix is recorded as matrix G. Since there are two paths, the event role 2 corresponds to two matrices U i , 1 matrix U i Including the feature vector corresponding to the target entity A, another matrix U i Including the feature vector corresponding to the target entity B. On this basis, based on the matrix S, the matrix Two matrices U i and matrix G to determine the target entity corresponding to event role 2, see Figure 7As shown, under the path of target entity A, target entity C and target entity D correspond, and under the path of target entity B, target entity C corresponds.
[0172] Then, determine the target sentence vector, target entity vector, path representation matrix and memory matrix corresponding to event role 3. The target sentence vector is recorded as matrix S, and the target entity vector is recorded as matrix The path representation matrix is denoted as matrix U i , the memory matrix is recorded as matrix G. Since there are three paths, the event role 3 corresponds to three matrices U i , 1 matrix U i Including the eigenvector corresponding to the target entity A and the eigenvector corresponding to the target entity C, and another matrix U i Including the eigenvector corresponding to the target entity A and the eigenvector corresponding to the target entity D, and another matrix U i Including the feature vector corresponding to the target entity B and the feature vector corresponding to the target entity C. On this basis, based on the matrix S, the matrix Three matrices U i and matrix G to determine the target entity corresponding to event role 3, see Figure 7 As shown, the target entity E corresponds to the path of target entity A and target entity C, the target entity F corresponds to the path of target entity A and target entity D, and the target entity G corresponds to the path of target entity B and target entity C.
[0173] Then, determine the target sentence vector, target entity vector, path representation matrix and memory matrix corresponding to event role 4. The target sentence vector is recorded as matrix S, and the target entity vector is recorded as matrix The path representation matrix is denoted as matrix U i , the memory matrix is recorded as matrix G. Since there are three paths, the event role 4 corresponds to three matrices U i , 1 matrix U i Including the eigenvector corresponding to the target entity A, the eigenvector corresponding to the target entity C and the eigenvector corresponding to the target entity E, and another matrix U i Including the eigenvector corresponding to the target entity A, the eigenvector corresponding to the target entity D and the eigenvector corresponding to the target entity F, and another matrix U i Including the feature vector corresponding to the target entity B, the feature vector corresponding to the target entity C and the feature vector corresponding to the target entity G. On this basis, based on the matrix S, the matrix Three matrices U i and matrix G to determine the target entity corresponding to event role 4, see Figure 7 As shown, the first path corresponds to the target entity H, the second path corresponds to the target entity I, and the third path corresponds to the target entity J.
[0174] At this point, we have obtained three paths corresponding to the target event type. These three paths represent three event records that describe the target event type. Event record 1 includes target entities A, C, E, and H, which describe the same event. Event record 2 includes target entities A, D, F, and I, which describe the same event. Event record 3 includes target entities B, C, G, and J, which describe the same event.
[0175] In summary, the event record corresponding to the target text may be determined based on the target entity corresponding to each event role. The event record may include event record 1, event record 2, and event record 3.
[0176] For example, after obtaining the three complete paths described above, the matrix G can be updated, that is, one matrix G includes the eigenvectors corresponding to target entity A, target entity C, target entity E, and target entity H; another matrix G includes the eigenvectors corresponding to target entity A, target entity D, target entity F, and target entity I; and another matrix G includes the eigenvectors corresponding to target entity B, target entity C, target entity G, and target entity J. The updated matrix G can be used when processing other target event types.
[0177] Obviously, since entities of different target event types have extensive interdependencies, the matrix G is used to record the complete event records (paths) in history. When predicting the event records corresponding to new target event types, the matrix G can be used as input to utilize the useful interaction information of the existing records.
[0178] In one possible implementation, a classifier model can be pre-trained. There is no restriction on the training process of the classifier model. The classifier model can be a network model using Transformer or other types of network models. There is no restriction on the structure of the classifier model. The classifier model is used to determine the entity that should be filled in the next path. If there are multiple entities that meet the role of event element on the next path, the current node will expand multiple branches during the extraction process. See Figure 7 For each of the M entities, the target sentence vector S, the target entity vector Path representation matrix U iThe memory matrix G is input into a trained classifier model (such as a linear classifier). The classifier model determines whether the entity is the next event element of the path and gives the predicted probability corresponding to the entity. When the predicted probability is greater, the possibility of the entity being the next event element of the path is greater. Conversely, when the predicted probability is smaller, the possibility of the entity being the next event element of the path is smaller. If the predicted probability is greater than a preset threshold (which can be configured based on experience, such as 0.5, 0.6, etc.), the entity is determined to be the target entity corresponding to the event role, that is, the entity is filled in the path. Otherwise, if the predicted probability is not greater than the preset threshold, the entity is determined not to be the target entity corresponding to the event role.
[0179] It can be seen from the above technical solutions that in the embodiment of the present application, a chapter-level event extraction method based on a graph model is proposed, which can accurately extract multiple entities used to describe the same event from the text. For the chapter-level event extraction task, a relationship graph containing sentences, entity mentions and entities is designed, and a multi-level (node attention and graph attention) attention mechanism is designed to simulate the information flow pattern between "sentence-entity mention-entity", to reflect the influence of different nodes, different edges, and different graphs on the final representation vector, and to represent the three local graphs respectively, so as to better capture the association relationship between different event elements in the same event. The graph contains richer relationships, which is conducive to capturing the connection between cross-sentence entities and can avoid the argument dispersion problem in chapter-level event extraction. The interactive relationship between each event element under the same event can be effectively modeled, which can greatly improve the performance of the event extraction system. The event table filling task can be modeled as a path extension task to improve matching accuracy and improve algorithm performance. In addition, in the embodiment of the present application, by modeling the event table filling task as a path extension task, the shortcomings of poor accuracy and long time consumption are solved, and end-to-end modeling of event type recognition, event argument recognition, and event table filling can be achieved, effectively solving the problems of multi-event extraction and argument dispersion in chapter-level event extraction, which can greatly improve the performance of the event extraction system.
[0180] Based on the same application concept as the above method, an event extraction device is proposed in the embodiment of the present application. Figure 8 FIG. 1 is a schematic diagram of the structure of the event extraction device, which may include:
[0181] An acquisition module 81 is used to acquire multiple sentences in a target text, and to acquire multiple entities and multiple entity mentions in the multiple sentences; a determination module 82 is used to determine initial sentence vectors corresponding to the multiple sentences, initial entity vectors corresponding to the multiple entities, and initial entity mention vectors corresponding to the multiple entity mentions; a generation module 83 is used to generate a heterogeneous relationship graph based on the multiple sentences, multiple entities, and multiple entity mentions, wherein the heterogeneous relationship graph includes association relationships between sentences, entity mentions, and entities; the determination module 82 is also used to determine, based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector, respectively; the determination module 82 is also used to determine, based on the target sentence vector and the target entity vector, at least one event record corresponding to the target text, wherein the event record includes multiple entities used to describe the same event.
[0182] Exemplarily, when generating a heterogeneous relationship graph based on the multiple sentences, multiple entities and multiple entity mentions, the generation module 83 is specifically used to: construct multiple sentence nodes corresponding to the multiple sentences, multiple entity nodes corresponding to the multiple entities, and multiple entity mention nodes corresponding to the multiple entity mentions; it can construct edge relationships between sentence nodes and sentence nodes; it can construct edge relationships between sentence nodes and entity mention nodes; it can construct edge relationships between entity mention nodes and entity mention nodes; it can construct edge relationships between entity mention nodes and entity nodes.
[0183] Exemplarily, when constructing an edge relationship between sentence nodes, for any sentence, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to multiple sentences following the sentence; when constructing an edge relationship between a sentence node and an entity mention node, if the sentence includes an entity mention, the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention; when constructing an edge relationship between an entity mention node and an entity mention node, if two entity mentions are in the same sentence, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions have the same event role, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions represent the same entity, the entity mention nodes corresponding to the two entity mentions have an edge relationship; when constructing an edge relationship between an entity mention node and an entity node, if the entity mention corresponds to an entity, the entity mention node corresponding to the entity mention has an edge relationship with the entity node corresponding to the entity.
[0184] Exemplarily, the determination module 82 is specifically used to determine the target sentence vector corresponding to the initial sentence vector and the target entity vector corresponding to the initial entity vector based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector and the initial entity mention vector, respectively: obtain a sentence relationship graph, a sentence and entity mention relationship graph, and an entity mention and entity relationship graph based on the heterogeneous relationship graph; wherein the sentence relationship graph is used to represent the association relationship between sentences, the sentence and entity mention relationship graph is used to represent the association relationship between sentences and entity mentions, and the entity mention and entity relationship graph is used to represent the association relationship between entity mentions and entities; determine the target sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, the sentence and entity mention relationship graph, the initial sentence vector and the initial entity mention vector; determine the target entity vector corresponding to the initial entity vector based on the entity mention and entity relationship graph, the initial entity vector and the initial entity mention vector.
[0185] Exemplarily, when the determination module 82 determines the target sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, the sentence and entity mention relationship graph, the initial sentence vector and the initial entity mention vector, it is specifically used to: determine the associated sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, and determine the first node attention vector based on the initial sentence vector and the associated sentence vector; determine the inter-sentence graph fusion feature based on the first node attention vector and the associated sentence vector; determine the first graph attention vector based on the inter-sentence graph fusion feature and the initial sentence vector; determine the initial entity mention vector corresponding to the initial sentence vector based on the sentence and entity mention relationship graph, and determine the second node attention vector based on the initial sentence vector and the initial entity mention vector; determine the sentence mention graph fusion feature based on the second node attention vector and the initial entity mention vector; determine the second graph attention vector based on the sentence mention graph fusion feature and the initial sentence vector; determine the target sentence vector based on the inter-sentence graph fusion feature, the first graph attention vector, the sentence mention graph fusion feature, the second graph attention vector and the initial sentence vector.
[0186] Exemplarily, the determination module 82 determines the target entity vector corresponding to the initial entity vector based on the entity mention and entity relationship graph, the initial entity vector and the initial entity mention vector, and is specifically used to: determine the initial entity mention vector corresponding to the initial entity vector based on the entity mention and entity relationship graph; determine the node attention vector based on the initial entity vector and the initial entity mention vector; determine the entity mention and inter-entity graph fusion features based on the node attention vector and the initial entity mention vector; determine the target entity vector based on the entity mention and inter-entity graph fusion features and the initial entity vector.
[0187] Exemplarily, when the determination module 82 determines at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, it is specifically used to: determine the target event type based on the target sentence vector; determine multiple event roles corresponding to the target event type; for each event role, based on the target sentence vector and the target entity vector, select the target entity corresponding to the event role from the multiple entities; and determine the event record based on the target entity corresponding to each event role.
[0188] Exemplarily, when determining the target event type based on the target sentence vector, the determination module 82 is specifically used to: for each event type in the event type list, input the target sentence vector into the trained event type recognition model to obtain the predicted probability corresponding to the event type; if the predicted probability is greater than a preset threshold, determine that the event type is the target event type; if the predicted probability is not greater than the preset threshold, determine that the event type is not the target event type.
[0189] Exemplarily, when the determination module 82 selects the target entity corresponding to the event role from the multiple entities based on the target sentence vector and the target entity vector, it is specifically used to: determine the path representation matrix corresponding to the event role, the path representation matrix including the feature vectors corresponding to the target entities corresponding to each event role preceding the event role; when the target text corresponds to multiple target event types, determine the memory matrix, the memory matrix including the path representation matrices of the multiple target event types corresponding to the target text, and one path representation matrix corresponds to the feature vectors corresponding to the target entities corresponding to all event roles in an event record; based on the target sentence vector, the target entity vector, the path representation matrix and the memory matrix, select the target entity corresponding to the event role from the multiple entities; or, based on the target sentence vector, the target entity vector and the path representation matrix, select the target entity corresponding to the event role from the multiple entities.
[0190] Exemplarily, the determination module 82 selects the target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector, the path representation matrix and the memory matrix, and is specifically used to: for each entity, input the target sentence vector, the target entity vector, the path representation matrix and the memory matrix into the classifier model to obtain the predicted probability corresponding to the entity; if the predicted probability is greater than a preset threshold, the entity is determined to be the target entity corresponding to the event role; otherwise, the entity is determined not to be the target entity corresponding to the event role.
[0191] Exemplarily, after determining at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, the determination module 82 is also used to: display the event record corresponding to the target text on the target page; and / or, store the event record corresponding to the target text in the target knowledge graph; and / or, if the event record corresponding to the target text matches the target information of interest, push the information corresponding to the target text to the target device corresponding to the target information of interest.
[0192] Based on the same application concept as the above method, an event extraction device is proposed in the embodiment of the present application. Figure 9 As shown, the event extraction device includes: a processor 91 and a machine-readable storage medium 92, the machine-readable storage medium 92 stores machine-executable instructions that can be executed by the processor 91; the processor 91 is used to execute the machine-executable instructions to implement the event extraction method disclosed in the above example of this application.
[0193] Based on the same application concept as the above method, an embodiment of the present application further provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the event extraction method disclosed in the above example of the present application can be implemented. The above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0194] The systems, devices, modules or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any of these devices. For the convenience of description, the above devices are described separately according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0195] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the functions specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0196] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. An event extraction method, characterized in that: The method comprises: Obtaining a plurality of sentences in a target text, a plurality of entities in the plurality of sentences, and a plurality of entity mentions; Determining initial sentence vectors corresponding to the plurality of sentences, initial entity vectors corresponding to the plurality of entities, and initial entity mention vectors corresponding to the plurality of entity mentions; generating a heterogeneous relationship graph based on the plurality of sentences, the plurality of entities, and the plurality of entity mentions, the heterogeneous relationship graph including association relationships between sentences, entity mentions, and entities; Based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, respectively determining a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector; Determining at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, where the event record includes multiple entities for describing the same event; The step of determining a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector comprises: Based on the heterogeneous relationship graph, a sentence relationship graph, a sentence-entity mention relationship graph, and an entity mention-entity relationship graph are obtained; wherein the sentence relationship graph includes association relationships between sentences, the sentence-entity mention relationship graph includes association relationships between sentences and entity mentions, and the entity mention-entity relationship graph includes association relationships between entity mentions and entities; Based on the sentence relationship graph, the sentence and entity mention relationship graph, the initial sentence vector and the initial entity mention vector, determine the target sentence vector corresponding to the initial sentence vector; wherein, based on the sentence relationship graph, determine the associated sentence vector corresponding to the initial sentence vector, and determine the first node attention vector based on the initial sentence vector and the associated sentence vector; determine the inter-sentence graph fusion feature based on the first node attention vector and the associated sentence vector; determine the first graph attention vector based on the inter-sentence graph fusion feature and the initial sentence vector; determine the initial entity mention vector corresponding to the initial sentence vector based on the sentence and entity mention relationship graph, and determine the second node attention vector based on the initial sentence vector and the initial entity mention vector; determine the inter-sentence graph fusion feature based on the second node attention vector and the initial entity mention vector; determine the second graph attention vector based on the inter-sentence graph fusion feature and the initial sentence vector; determine the target sentence vector based on the inter-sentence graph fusion feature, the first graph attention vector, the inter-sentence graph fusion feature, the second graph attention vector and the initial sentence vector; Based on the entity mention and entity relationship graph, the initial entity vector and the initial entity mention vector, a target entity vector corresponding to the initial entity vector is determined.
2. The method according to claim 1, characterized in that Generating a heterogeneous relationship graph based on the plurality of sentences, the plurality of entities, and the plurality of entity mentions includes: Constructing a plurality of sentence nodes corresponding to the plurality of sentences, a plurality of entity nodes corresponding to the plurality of entities, and a plurality of entity mention nodes corresponding to the plurality of entity mentions; Construct edge relationships between sentence nodes; Construct edge relationships between sentence nodes and entity mention nodes; Construct edge relationships between entity mention nodes; Build edge relationships between entity mention nodes and entity nodes.
3. The method according to claim 2, characterized in that When constructing the edge relationship between sentence nodes, for any sentence, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to the multiple sentences following the sentence; When constructing the edge relationship between a sentence node and an entity mention node, if a sentence includes an entity mention, then the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention; When constructing the edge relationship between entity mention nodes, if two entity mentions are in the same sentence, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions have the same event role, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions represent the same entity, the entity mention nodes corresponding to the two entity mentions have an edge relationship; When constructing an edge relationship between an entity mention node and an entity node, if an entity mentions a corresponding entity, then the entity mention node corresponding to the entity mention has an edge relationship with the entity node corresponding to the entity.
4. The method according to claim 1, wherein The determining, based on the entity mention and entity relationship graph, the initial entity vector, and the initial entity mention vector, a target entity vector corresponding to the initial entity vector includes: Determine an initial entity mention vector corresponding to an initial entity vector based on the entity mention and entity relationship graph; determine a node attention vector based on the initial entity vector and the initial entity mention vector; determine an entity mention and entity relationship graph fusion feature based on the node attention vector and the initial entity mention vector; The target entity vector is determined based on the fusion features of entity mentions and entity graphs and the initial entity vector.
5. The method according to claim 1, characterized in that The determining, based on the target sentence vector and the target entity vector, at least one event record corresponding to the target text includes: Determining a target event type corresponding to the target text based on the target sentence vector; Determining multiple event roles corresponding to the target event type; For each event role, based on the target sentence vector and the target entity vector, selecting a target entity corresponding to the event role from the multiple entities; The event record corresponding to the target text is determined based on the target entity corresponding to each event role.
6. The method according to claim 5, characterized in that The determining the target event type corresponding to the target text based on the target sentence vector includes: For each event type in the event type list, input the target sentence vector into the trained event type recognition model to obtain the predicted probability corresponding to the event type; If the predicted probability is greater than a preset threshold, determining the event type as a target event type; If the predicted probability is not greater than a preset threshold, it is determined that the event type is not a target event type.
7. The method according to claim 5, characterized in that The step of selecting, for each event role, a target entity corresponding to the event role from the multiple entities based on the target sentence vector and the target entity vector includes: Determine a path representation matrix corresponding to the event role, wherein the path representation matrix includes feature vectors corresponding to target entities corresponding to each event role preceding the event role; When the target text corresponds to multiple target event types, a memory matrix is determined, wherein the memory matrix includes path representation matrices of the multiple target event types corresponding to the target text, and one path representation matrix corresponds to feature vectors corresponding to target entities corresponding to all event roles in an event record; Selecting a target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector, the path representation matrix, and the memory matrix; or Based on the target sentence vector, the target entity vector and the path representation matrix, a target entity corresponding to the event role is selected from the multiple entities.
8. The method according to claim 7, characterized in that The selecting a target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector, the path representation matrix, and the memory matrix includes: For each entity, input the target sentence vector, the target entity vector, the path representation matrix, and the memory matrix into a classifier model to obtain a predicted probability corresponding to the entity; If the predicted probability is greater than a preset threshold, the entity is determined to be the target entity corresponding to the event role; otherwise, the entity is determined not to be the target entity corresponding to the event role.
9. The method according to claim 1 or 5, characterized in that After determining at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, the method further includes: Display the event record corresponding to the target text on the target page; and / or, Storing event records corresponding to the target text in the target knowledge graph; and / or, If the event record corresponding to the target text matches the target information of interest, the information corresponding to the target text is pushed to the target device corresponding to the target information of interest.
10. An event extraction device, characterized in that: The device comprises: An acquisition module, configured to acquire a plurality of sentences in a target text, and acquire a plurality of entities and a plurality of entity mentions in the plurality of sentences; a determination module, configured to determine initial sentence vectors corresponding to the plurality of sentences, initial entity vectors corresponding to the plurality of entities, and initial entity mention vectors corresponding to the plurality of entity mentions; a generation module, configured to generate a heterogeneous relationship graph based on the plurality of sentences, the plurality of entities, and the plurality of entity mentions, wherein the heterogeneous relationship graph includes association relationships between sentences, entity mentions, and entities; The determination module is further configured to determine, based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector, and the initial entity mention vector, a target sentence vector corresponding to the initial sentence vector and a target entity vector corresponding to the initial entity vector; The determination module is further configured to determine at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, where the event record includes multiple entities used to describe the same event; Wherein, the determination module is specifically used to determine the target sentence vector corresponding to the initial sentence vector and the target entity vector corresponding to the initial entity vector based on the heterogeneous relationship graph, the initial sentence vector, the initial entity vector and the initial entity mention vector, respectively: obtain a sentence relationship graph, a sentence and entity mention relationship graph, and an entity mention and entity relationship graph based on the heterogeneous relationship graph; wherein, the sentence relationship graph is used to represent the association relationship between sentences, the sentence and entity mention relationship graph is used to represent the association relationship between sentences and entity mentions, and the entity mention and entity relationship graph is used to represent the association relationship between entity mentions and entities; based on the sentence relationship graph, the sentence and entity mention relationship graph, the initial sentence vector and the initial entity mention vector, determine the target sentence vector corresponding to the initial sentence vector; based on the entity mention and entity relationship graph, the initial entity vector and the initial entity mention vector, determine the target entity vector corresponding to the initial entity vector; Among them, the determination module determines the target sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, the sentence and entity mention relationship graph, the initial sentence vector and the initial entity mention vector, and is specifically used to: determine the associated sentence vector corresponding to the initial sentence vector based on the sentence relationship graph, and determine the first node attention vector based on the initial sentence vector and the associated sentence vector; determine the inter-sentence graph fusion feature based on the first node attention vector and the associated sentence vector; determine the first graph attention vector based on the inter-sentence graph fusion feature and the initial sentence vector; determine the initial entity mention vector corresponding to the initial sentence vector based on the sentence and entity mention relationship graph, and determine the second node attention vector based on the initial sentence vector and the initial entity mention vector; determine the sentence mention graph fusion feature based on the second node attention vector and the initial entity mention vector; determine the second graph attention vector based on the sentence mention graph fusion feature and the initial sentence vector; determine the target sentence vector based on the inter-sentence graph fusion feature, the first graph attention vector, the sentence mention graph fusion feature, the second graph attention vector and the initial sentence vector.
11. The device according to claim 10, characterized in that in, When generating a heterogeneous relationship graph based on the multiple sentences, multiple entities and multiple entity mentions, the generation module is specifically used to: construct multiple sentence nodes corresponding to the multiple sentences, multiple entity nodes corresponding to the multiple entities, and multiple entity mention nodes corresponding to the multiple entity mentions; and construct edge relationships between sentence nodes; Build edge relationships between sentence nodes and entity mention nodes; build edge relationships between entity mention nodes and entity mention nodes; build edge relationships between entity mention nodes and entity nodes; Among them, when constructing the edge relationship between sentence nodes and sentence nodes, for any sentence, the sentence node corresponding to the sentence has an edge relationship with the sentence nodes corresponding to the multiple sentences following the sentence; when constructing the edge relationship between sentence nodes and entity mention nodes, if the sentence includes entity mention, the sentence node corresponding to the sentence has an edge relationship with the entity mention node corresponding to the entity mention; when constructing the edge relationship between entity mention nodes and entity mention nodes, if two entity mentions are in the same sentence, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions have the same event role, the entity mention nodes corresponding to the two entity mentions have an edge relationship; if two entity mentions represent the same entity, the entity mention nodes corresponding to the two entity mentions have an edge relationship; when constructing the edge relationship between entity mention nodes and entity nodes, if the entity mention corresponds to an entity, the entity mention node corresponding to the entity mention has an edge relationship with the entity node corresponding to the entity; Wherein, the determination module determines the target entity vector corresponding to the initial entity vector based on the entity mention and entity relationship graph, the initial entity vector and the initial entity mention vector, and is specifically used to: determine the initial entity mention vector corresponding to the initial entity vector based on the entity mention and entity relationship graph; determine the node attention vector based on the initial entity vector and the initial entity mention vector; determine the entity mention and inter-entity graph fusion feature based on the node attention vector and the initial entity mention vector; determine the target entity vector based on the entity mention and inter-entity graph fusion feature and the initial entity vector; The determining module is specifically configured to determine, based on the target sentence vector and the target entity vector, at least one event record corresponding to the target text: determine a target event type based on the target sentence vector; determine multiple event roles corresponding to the target event type; for each event role, select a target entity corresponding to the event role from the multiple entities based on the target sentence vector and the target entity vector; and determine the event record based on the target entity corresponding to each event role. Wherein, when determining the target event type based on the target sentence vector, the determination module is specifically used to: for each event type in the event type list, input the target sentence vector into the trained event type recognition model to obtain the predicted probability corresponding to the event type; if the predicted probability is greater than a preset threshold, determine that the event type is the target event type; if the predicted probability is not greater than the preset threshold, determine that the event type is not the target event type; Wherein, the determination module is specifically used to select the target entity corresponding to the event role from the multiple entities based on the target sentence vector and the target entity vector: determine the path representation matrix corresponding to the event role, the path representation matrix including the feature vectors corresponding to the target entities corresponding to each event role preceding the event role; when the target text corresponds to multiple target event types, determine a memory matrix, the memory matrix including the path representation matrices of the multiple target event types corresponding to the target text, and one path representation matrix corresponds to the feature vectors corresponding to the target entities corresponding to all event roles in an event record; select the target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector, the path representation matrix and the memory matrix; or select the target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector and the path representation matrix; Wherein, the determination module selects the target entity corresponding to the event role from the multiple entities based on the target sentence vector, the target entity vector, the path representation matrix and the memory matrix, and is specifically used to: for each entity, input the target sentence vector, the target entity vector, the path representation matrix and the memory matrix into the classifier model to obtain the predicted probability corresponding to the entity; if the predicted probability is greater than a preset threshold, determine that the entity is the target entity corresponding to the event role; otherwise, determine that the entity is not the target entity corresponding to the event role; Among them, after the determination module determines at least one event record corresponding to the target text based on the target sentence vector and the target entity vector, it is also used to: display the event record corresponding to the target text on the target page; and / or, store the event record corresponding to the target text in the target knowledge graph; and / or, if the event record corresponding to the target text matches the target information of interest, push the information corresponding to the target text to the target device corresponding to the target information of interest.
12. An event extraction device, characterized in that: include: a processor and a machine-readable storage medium storing machine-executable instructions capable of being executed by the processor; The processor is configured to execute machine-executable instructions to implement the method steps described in any one of claims 1-9.
Citation Information
Patent Citations
Method and device for extracting chapter-level event based on multi-granularity entity heterogeneous graph
CN114742016A