CN116842949A - Event extraction method, device, electronic equipment and storage medium - Google Patents

Event extraction method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116842949A
CN116842949A CN202310612524.5A CN202310612524A CN116842949A CN 116842949 A CN116842949 A CN 116842949A CN 202310612524 A CN202310612524 A CN 202310612524A CN 116842949 A CN116842949 A CN 116842949A
Authority
CN
China
Prior art keywords
event
node
argument
determining
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310612524.5A
Other languages
Chinese (zh)
Inventor
赵文
李皓辰
王宇
温立强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University filed Critical Peking University
Priority to CN202310612524.5A priority Critical patent/CN116842949A/en
Publication of CN116842949A publication Critical patent/CN116842949A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Probability & Statistics with Applications (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Machine Translation (AREA)

Abstract

The application relates to the technical field of data processing, and provides an event extraction method, an event extraction device, electronic equipment and a storage medium, wherein the event extraction method comprises the following steps: determining a candidate trigger word set and an argument set based on prompt learning; constructing an event iso-composition based on the candidate trigger word set and the argument set; clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes; and carrying out event extraction based on the event mode. According to the method, trigger words and arguments of the event are directly generated based on prompt learning, an external knowledge base and manual rules are not needed, meanwhile, information interaction between the inside of the event and the event is enhanced by constructing the event abnormal composition, and under the condition that a predefined event template is not used, an event mode can be automatically generated, and the accuracy and efficiency of event extraction are improved.

Description

Event extraction method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an event extraction method, an event extraction device, an electronic device, and a storage medium.
Background
Currently, most existing event extraction works require a manually predefined event pattern as pre-information, but the manual template has the following problems: the method is time-consuming and labor-consuming, the number and coverage of event modes manually defined by field experts are limited, and missing events and arguments exist; migration is difficult and requires redefinition of patterns manually as the domain of event extraction and data sets change.
Based on this, the above problem is solved with free event extraction (liberal Event Extraction, LEE), automatically discovering event patterns and extracting events at the same time. However, free event extraction suffers from the following problematic drawbacks: highly dependent on semantic analysis tools and external knowledge bases, and requiring manual rules to eliminate noise and build pairs Ji Yingshe between multilingual resources; only the influence of the internal event parameters on the event type is considered, and the influence of the trigger on the parameters and the interaction of the event and the event connection are not considered; the modules in the model are connected in a pipeline form, and reverse information transmission does not exist among different modules so as to update parameters in the training process together.
Therefore, the existing event extraction method has the problem of low event extraction efficiency.
Disclosure of Invention
The application provides an event extraction method, an event extraction device, electronic equipment and a storage medium, which are used for solving the problem of low event extraction efficiency, and the event extraction method, the device and the storage medium are used for directly generating trigger words and argument of an event based on prompt learning without an external knowledge base and manual rules, and meanwhile, the event mode can be automatically generated under the condition that a predefined event template is not used by constructing an event abnormal composition to strengthen information interaction between the inside of the event and the event, so that the accuracy and the efficiency of event extraction are improved.
The application provides an event extraction method, which comprises the following steps:
determining a candidate trigger word set and an argument set based on prompt learning;
constructing an event iso-composition based on the candidate trigger word set and the argument set;
clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes;
and carrying out event extraction based on the event mode.
In one embodiment, the constructing an event iso-graph based on the set of candidate trigger words and the set of arguments includes:
taking each candidate trigger word in the candidate trigger word set and each argument in the argument set as a node of the event abnormal composition;
determining semantic embedding of each node to construct the event iso-graph.
In one embodiment, the determining semantic embeddings of nodes to construct the event profile includes:
determining the attention coefficients of each node and the neighbor nodes thereof;
normalizing the attention coefficient to determine a first semantic embedding of each node based on the normalized attention coefficient;
determining a second semantic embedding for each node based on the multi-headed attention and the first semantic embedding for each node;
and constructing the event heterogram based on the second semantic embedding of each node.
In one embodiment, the determining the candidate trigger word set and the argument set based on hint learning includes:
converting the original input text into a prompt template based on the prompt learning;
inputting the prompt template into a preset language model, and obtaining candidate trigger words and candidate arguments output by the preset language model, wherein the preset language model is obtained by training by adopting a sample prompt template;
the set of candidate trigger words is constructed based on the candidate trigger words, and the set of candidate argument elements is constructed based on the candidate argument elements.
In one embodiment, the clustering the nodes in the event profile includes:
randomly selecting K nodes in the event abnormal graph as initial clustering centers;
and calculating the distance between each node and each cluster center, and distributing each node to the cluster center closest to the node to obtain at least one event type cluster and at least one argument type cluster.
In one embodiment, the naming the label of the clustered clusters includes:
if the cluster is an event type cluster, determining a target node closest to the event type cluster, and taking a node text of the target node as a label of the event type cluster;
if the cluster is an argument type cluster, determining a label name of the argument type cluster based on a set label name.
In one embodiment, the extracting the event based on the event mode includes:
determining a matching result of the text to be extracted and the event mode;
and carrying out event extraction on the text to be extracted based on the matching result.
The application also provides an event extraction device, which comprises:
the set determining module is used for determining a candidate trigger word set and an argument set based on prompt learning;
the event abnormal composition construction module is used for constructing an event abnormal composition based on the candidate trigger word set and the argument set;
the event pattern generation module is used for clustering the nodes in the event abnormal graph and naming the clustered clusters by labels so as to generate an event pattern;
and the event extraction module is used for carrying out event extraction based on the event mode.
The application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the event extraction method as described in any of the above when executing the program.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of event extraction as described in any of the above.
According to the event extraction method, the event extraction device, the electronic equipment and the storage medium, candidate trigger word sets and argument sets are determined based on prompt learning; constructing an event iso-composition based on the candidate trigger word set and the argument set; clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes; and carrying out event extraction based on the event mode. According to the method, trigger words and arguments of the event are directly generated based on prompt learning, an external knowledge base and manual rules are not needed, meanwhile, information interaction between the inside of the event and the event is enhanced by constructing the event abnormal composition, and under the condition that a predefined event template is not used, an event mode can be automatically generated, and the accuracy and efficiency of event extraction are improved.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an event extraction method according to the present application;
FIG. 2 is a second flow chart of the event extraction method according to the present application;
FIG. 3 is a schematic diagram of an event extraction device according to the present application;
fig. 4 is a schematic structural diagram of an electronic device provided by the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The event extraction method, apparatus, electronic device, and storage medium of the present application are described below with reference to fig. 1 to 4.
Specifically, the present application provides an event extraction method, and referring to fig. 1, fig. 1 is one of flow diagrams of the event extraction method provided by the present application.
The event extraction method provided by the embodiment of the application comprises the following steps:
step 100, determining a candidate trigger word set and an argument set based on prompt learning;
it should be noted that events are important components of speech and text, describing changes in the state of entities; event extraction aims at identifying and classifying events and finding their participants according to the event pattern.
The elements composing the event comprise event trigger words, event types, event arguments and argument roles, wherein the event trigger words are the most representative words or phrases in the event, usually verbs or nouns, and the event trigger words are in one-to-one correspondence; the event type is the category of the occurrence event, describing the nature of the event; the event argument is a participant of an event and mainly consists of an entity, a value and time, wherein the value is a non-entity event participant; an argument role is the role an event argument plays in an event.
Since the semantic analysis tool and the additional knowledge base (requiring manual formulation) are relied on to align the results of the semantic analysis with the resources in the knowledge base, it is very cumbersome and difficult to migrate to a new domain,
the embodiment of the application adopts the prompt learning method to directly generate the output result from the target sentence without using an additional knowledge base. Specifically, based on a prompt learning method, converting an original input text into a prompt template, wherein the prompt template comprises an initial input, a prompt identification token and unfilled slots, then inputting the prompt template into a preset language model, filling the unfilled slots in the prompt template through the preset language model to obtain a final character string, finally outputting candidate trigger words and candidate argument, constructing a candidate trigger word set based on the output candidate trigger words, and constructing a candidate argument set based on the output candidate argument.
The preset language model is obtained by training a sample prompt template, wherein the prompt template is a text character string and comprises unfilled slots, and the purpose of training the language model is to fill the slots with data.
Optionally, the hint template is pre-constructed, for example, assuming that the input sentence is x, the hint template constructed by using the hint prefix is:
prompt (x) is the semantic hint associated with x, and y is the result of the generation. As in the example of table 1, the sentence has a transportation event triggered by the trigger word "departure", which event includes the event argument "panda", "zoo", etc. Nouns and verbs (because event triggers are mostly nouns and verbs) and entities (because event arguments are entities) in the sentence are added to the hint Prompt (x) to generate a semi-structured text y composed of candidate trigger words and arguments. In addition, to enhance the effect of the hint template, 20 virtual tags soft token are added to the hint template, wherein the virtual tags have the same dimension as the actual words.
TABLE 1
X (input) Panda leaves zoo when going on
Prompt (X) Departure, panda, zoo, soft token 20
y The "departure" event comprises pandas and zoos
Step 200, constructing an event iso-composition based on the candidate trigger word set and the argument set;
it should be noted that, the event iso-graph is used to represent the semantic embedding of learning acquisition events and arguments, and at the same time, the information interaction between the events inside and outside the event can be enhanced through the event iso-graph.
Referring to fig. 2, for each input sentence x, two sets are generated by a hint learning method: the candidate trigger word set trigs= { t1, t2,..: candidate trigger word nodes (black dots in fig. 2) and argument nodes (white dots in fig. 2); meanwhile, the event heterogram comprises two relation edges: trigger word-argument edges inside an event (solid lines in fig. 2) and event-event edges outside an event (dashed lines in fig. 2), i.e., edges between candidate trigger word nodes.
Step 300, clustering the nodes in the event abnormal graph, and naming the clustered clusters by labels to generate an event mode;
and clustering the nodes in the event abnormal graph by adopting a clustering algorithm to obtain different types of clustering clusters, and then naming each clustering cluster by using a label so as to generate an event mode. For example, clustering is performed on high-frequency phrases and key nouns appearing in each application field, label naming is performed on approximate words with similar distances according to a clustering result, and event modes are generated by referring to events defined by knowledge in related fields.
Optionally, the event mode includes an event type and an argument, for example, for a purchase type event, the argument is included as "buyer", "seller", "amount", "time", "place", etc., and the event corresponds to the event mode as follows: < purchase event, "buyer", "seller", "amount", "time", "place >.
And step 400, performing event extraction based on the event mode.
The event extraction is an information extraction task oriented to unstructured text or semi-structured data, and refers to a text processing technology for extracting an event of a specified type and related entity information from natural language text and forming structured data output.
Event extraction can be applied to various application fields, for example, in the security field, real-time news event extraction is performed on global crisis; in the intelligent traffic field, a system for extracting real-time driving information by utilizing social media provides important events such as traffic jam, weather forecast and the like for drivers; in the legal field, the extraction of events from court decisions may provide a visual overview of the occurrence of an entire case by representing major legal events, as well as related temporal information.
Event extraction can be broken down into 4 sub-tasks: triggering word recognition, event type classification, argument recognition and role classification tasks, wherein the triggering word recognition and the event type classification can be combined into an event recognition task, and the event recognition task is used for judging the event type of each word attribution in a sentence and is a multi-classification task based on words; the argument recognition and the role classification can be combined into an argument role classification task, and the role classification task is used for judging the role relation between any pair of trigger words and entities in sentences and is a multi-classification task based on word pairs.
When the event extraction is carried out, firstly, a matching result of the text to be extracted and the event mode is determined, and then the event extraction is carried out on the text to be extracted based on the matching result. For example, the event type and the event argument are obtained from the event schema, then the event type and the event argument are matched with the text to be extracted, and if the matching is successful, the event extraction is performed.
According to the event extraction method provided by the embodiment of the application, the candidate trigger word set and the argument set are determined based on prompt learning; constructing an event heterogram based on the candidate trigger word set and the argument set; clustering nodes in the event heterograms, and naming labels of clustered clusters to generate event modes; event extraction is performed based on the event pattern. According to the method, trigger words and arguments of the event are directly generated based on prompt learning, an external knowledge base and manual rules are not needed, meanwhile, information interaction between the inside of the event and the event is enhanced by constructing the event abnormal composition, and under the condition that a predefined event template is not used, an event mode can be automatically generated, and the accuracy and efficiency of event extraction are improved.
In one embodiment, the constructing an event iso-graph based on the set of candidate trigger words and the set of arguments includes:
step 210, using each candidate trigger word in the candidate trigger word set and each argument in the argument set as a node of the event abnormal pattern;
step 220, determining semantic embedding of each node to construct the event iso-graph.
After the candidate trigger word set and the argument set are determined, each candidate trigger word in the candidate trigger word set and each argument in the argument set are used as nodes of event heterograms, such as candidate trigger word nodes and argument nodes; semantic embedding of each node is then determined to construct an event iso-graph. Specifically, determining the attention coefficients of each node and the neighbor nodes thereof; normalizing the attention coefficient to determine a first semantic embedding of each node based on the normalized attention coefficient; determining a second semantic embedding of each node based on the multi-head attention and the first semantic embedding of each node; an event heterostructure is constructed based on the second semantic embedding of each node.
For example, using a graphical attention network (Graph Attention Network, GAT) approach, semantic embedding of candidate trigger words and arguments is computed and feature interactions inside and between events are obtained. If a node i in the event heterogram has a neighbor node j, firstly embedding words of the node i and the node j for feature transformation, and then calculating an attention coefficient e between the node i and the node j ij
e ij =<W i h i ,W j h j >,j∈N i
W i ∈W d ,W j ∈W d
Wherein W is i Transformation parameter matrix representing corresponding type of node i, W j Transformation parameter matrix representing corresponding type of node j, h i Original word embedding vector representing node i, i.e. initial semantic embedding, h j The original word representing node j embeds a vector, < -, > represents the inner product of the vector, N i Representing a set of neighbor nodes of node i, W d Representing a transformation parameter matrix, W trig Transformation parameter matrix representing event trigger words, W arg The transformation parameter matrix representing the argument, d representing the neighbor node.
Further, the attention coefficients of the node i and all neighbor nodes are normalized by using a softmax activation function, so that the attention coefficients of the node i and all neighbor nodes are obtained:
wherein alpha is ij Represents the attention coefficient after normalization processing, and LeakyReLU () represents the activation function, e ij Attention coefficients, e, representing node i and neighbor node j ik Attention coefficients representing node i and neighbor node k, N i Representing a set of neighbor nodes for node i.
And adding nonlinear characteristics by using a LeakyReLU () activation function, and performing normalization processing to obtain the attention coefficients between the node i and all the neighbor nodes.
Further, the neighbor node characteristics of each node are weighted and summed to obtain a new semantic embedding of the node.
Wherein h is i ' New semantic embedding representing node i, σ represents the activation function LeakyReLU (), N i Representing a set of neighbor nodes, α, of node i ij Represents the attention coefficient after normalization, W l j Represents the L < th th Transformation parameter matrix of individual head, h j The original word representative of node j is embedded in the vector.
Further, new semantic embedding h of node i is extended by multi-head attention (multihead attention) i And', averaging the generated multiple new features, and obtaining the semantic embedding of the candidate trigger words and candidate argument which introduce feature interaction through the drawing meaning force on the event iso-graph.
Wherein H is i ' represents the pair h i ' semantic embedding after optimization, K represents the number of attention heads, sigma represents the activation function LeakyReLU (), N i Representing a set of neighbor nodes, α, of node i ij Represents the attention coefficient after normalization, W l j Represents the L < th th Transformation parameter matrix of individual head, h j The original word representative of node j is embedded in the vector.
After determining the semantic embedding of each node, determining the connection relation between the nodes based on the semantic embedding of each node, and then constructing the event iso-graph based on the connection relation. For example, assuming node i can be semantically embedded with its neighbor node j, node i and node j are connected.
According to the embodiment of the application, the event abnormal composition is constructed by using each candidate trigger word node in the candidate trigger word set and each argument node in the argument set so as to represent the semantic embedding of the learning acquisition event and the argument, and meanwhile, the information interaction between the internal event and the external event can be enhanced through the event abnormal composition, so that the efficiency and the accuracy of event extraction are improved.
In one embodiment, the clustering the nodes in the event profile includes:
step 310, randomly selecting K nodes in the event profile as initial cluster centers;
and 320, calculating the distance between each node and each cluster center, and distributing each node to the cluster center closest to the node to obtain at least one event type cluster and at least one argument type cluster.
In the embodiment of the application, the K-means clustering algorithm is adopted to cluster the nodes in the event heterograms, and optionally, other clustering algorithms, such as a K-media algorithm and a CLARANS algorithm, can be also adopted.
Specifically, all nodes in the event abnormal graph are divided into K groups, K nodes are randomly selected as initial clustering centers, then the distance between each node and each clustering center is calculated, each node is distributed to the clustering center closest to the node, wherein the node distributed to the clustering center and the clustering center represent one cluster, each distributed sample node, the clustering center of the cluster is recalculated according to the existing nodes in the cluster, the process is repeated until the termination condition is met, and finally the clustering is carried out to obtain K trig Clusters of event types k arg A cluster of argument types. Alternatively, the termination condition may be that no (or a minimum number of) nodes are reassigned to different clusters, or that no (or a minimum number of) cluster centers are changed again, the sum of squares of the errors and the local minimum.
For example, for node i (assuming i is a candidate trigger word), the probability that node i belongs to each cluster is calculated based on the distance of node i to each cluster.
Wherein dist () represents the Euclidean distance, c j Represents the center of the jth cluster, c t Represents the center, k, of the t-th cluster trig Representing clusters of event types.
Optionally, in selecting k trig Value sum k arg At the time of the value,there are two ways: selecting the same label number as the public data set; the number of event types and the number of arguments are explored freely. Wherein the first way aims at the case of supervised training of the method of computation, maps clustered results to existing labels, and the second way aims at finding more event types and argument types, determining the optimal choice by means of contour coefficients (silhouette coefficient).
According to the embodiment of the application, the nodes in the event heterograms are clustered through the k-means clustering algorithm to obtain different event type clusters and argument type clusters, so that event modes can be conveniently generated based on the different event type clusters and argument type clusters, and the event extraction efficiency is improved.
In one embodiment, the naming the label of the clustered clusters includes:
step 330, if the cluster is an event type cluster, determining a target node closest to the event type cluster, and taking a node text of the target node as a label of the event type cluster;
step 340, if the cluster is an argument type cluster, determining a label name of the argument type cluster based on the set label name.
And for the clustering result of the candidate trigger words, namely if the clustering cluster is an event type cluster, selecting the node text closest to the target node in the event type cluster as the label of the event type cluster. For the clustering result of the candidate argument, namely, the clustering cluster is an argument type cluster, because the entity text is large in diversity, the label name of the argument type cluster is determined based on the set label name, for example, a manual method is used for label naming.
For each event type, find all argument types with which there are edges in the event graph. If the attention coefficient of both is greater than the threshold value θ, it is added to the event pattern.
According to the embodiment of the application, different label naming modes are adopted through different clustering clusters, so that the accuracy of label naming is improved.
In order to further analyze and explain the event extraction method provided by the present application, referring to fig. 2, an embodiment of the present application provides a graph model method (promt-based Graph Model for Liberal Event Extraction, PGLEE) for combining free event extraction and event mode induction based on Prompt learning, so as to implement end-to-end free event extraction.
For example, input sentences, using a prompt-based learning method to generate candidate trigger words and candidate arguments, without the need for an external knowledge base; then, based on the candidate trigger words and the candidate argument, constructing an event heterogram to enhance information interaction between the internal event and the external event, and acquiring semantic embedding between the internal event and the external event through a graph representation learning algorithm; and finally, generating an event mode by using a clustering algorithm and tag naming and executing event extraction. The prompt-based graph model synchronously updates parameters in the model through a joint training process, so that reverse information transmission is realized.
For example, a new event pattern s is introduced during the free event extraction with reference to table 2.
TABLE 2
The embodiment of the application provides an end-to-end free event extraction model, which directly generates trigger words and argument of an event by using a prompt generation model, and does not need an external knowledge base and manual rules; the method comprises the steps of building an event abnormal composition to strengthen information interaction between the event and the inside of the event, obtaining semantic embedding between the event and the outside event through a graph representation learning algorithm, generating an event mode by using a clustering algorithm and tag naming and executing event extraction, and based on the event mode, automatically generating the event mode under the condition that a predefined event template is not used, thereby reducing labor cost, simplifying event extraction operation and further improving the efficiency and accuracy of event extraction.
Fig. 3 is a schematic structural diagram of an event extraction apparatus according to the present application, and referring to fig. 3, an embodiment of the present application provides an event extraction apparatus, which includes a set determining module 301, an event abnormal pattern constructing module 302, an event pattern generating module 303, and an event extracting module 304.
A set determining module 301, configured to determine a candidate trigger word set and an argument set based on prompt learning;
an event heterogeneous graph construction module 302, configured to construct an event heterogeneous graph based on the candidate trigger word set and the argument set;
the event pattern generation module 303 is configured to cluster the nodes in the event profile, and name the clustered clusters to generate an event pattern;
the event extraction module 304 is configured to perform event extraction based on the event mode.
According to the event extraction device provided by the embodiment of the application, the candidate trigger word set and the argument set are determined based on prompt learning; constructing an event heterogram based on the candidate trigger word set and the argument set; clustering nodes in the event heterograms, and naming labels of clustered clusters to generate event modes; event extraction is performed based on the event pattern. According to the method, trigger words and arguments of the event are directly generated based on prompt learning, an external knowledge base and manual rules are not needed, meanwhile, information interaction between the inside of the event and the event is enhanced by constructing the event abnormal composition, and under the condition that a predefined event template is not used, an event mode can be automatically generated, and the accuracy and efficiency of event extraction are improved.
In one embodiment, the event profile construction module 302 is specifically configured to:
taking each candidate trigger word in the candidate trigger word set and each argument in the argument set as a node of the event abnormal composition;
determining semantic embedding of each node to construct the event iso-graph.
In one embodiment, the event profile construction module 302 is specifically configured to:
determining the attention coefficients of each node and the neighbor nodes thereof;
normalizing the attention coefficient to determine a first semantic embedding of each node based on the normalized attention coefficient;
determining a second semantic embedding for each node based on the multi-headed attention and the first semantic embedding for each node;
and constructing the event heterogram based on the second semantic embedding of each node.
In one embodiment, the set determining module 301 is specifically configured to:
converting the original input text into a prompt template based on the prompt learning;
inputting the prompt template into a preset language model, and obtaining candidate trigger words and candidate arguments output by the preset language model, wherein the preset language model is obtained by training by adopting a sample prompt template;
the set of candidate trigger words is constructed based on the candidate trigger words, and the set of candidate argument elements is constructed based on the candidate argument elements.
In one embodiment, the event pattern generation module 303 is specifically configured to:
randomly selecting K nodes in the event abnormal graph as initial clustering centers;
and calculating the distance between each node and each cluster center, and distributing each node to the cluster center closest to the node to obtain at least one event type cluster and at least one argument type cluster.
In one embodiment, the event pattern generation module 303 is specifically configured to:
if the cluster is an event type cluster, determining a target node closest to the event type cluster, and taking a node text of the target node as a label of the event type cluster;
if the cluster is an argument type cluster, determining a label name of the argument type cluster based on a set label name.
In one embodiment, the event extraction module 304 is specifically configured to:
determining a matching result of the text to be extracted and the event mode;
and carrying out event extraction on the text to be extracted based on the matching result.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 410, communication interface 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other through communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform an event extraction method comprising:
determining a candidate trigger word set and an argument set based on prompt learning;
constructing an event iso-composition based on the candidate trigger word set and the argument set;
clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes;
and carrying out event extraction based on the event mode.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-only memory (ROM), a random access memory (RAM, randomAccessMemory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the event extraction method provided by the above methods, the method comprising:
determining a candidate trigger word set and an argument set based on prompt learning;
constructing an event iso-composition based on the candidate trigger word set and the argument set;
clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes;
and carrying out event extraction based on the event mode.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. An event extraction method, comprising:
determining a candidate trigger word set and an argument set based on prompt learning;
constructing an event iso-composition based on the candidate trigger word set and the argument set;
clustering the nodes in the event heterograms, and naming labels of the clustered clusters to generate event modes;
and carrying out event extraction based on the event mode.
2. The event extraction method according to claim 1, wherein the constructing an event iso-graph based on the candidate trigger word set and the argument set comprises:
taking each candidate trigger word in the candidate trigger word set and each argument in the argument set as a node of the event abnormal composition;
determining semantic embedding of each node to construct the event iso-graph.
3. The method of event extraction according to claim 2, wherein said determining semantic embedding of each node to construct said event profile comprises:
determining the attention coefficients of each node and the neighbor nodes thereof;
normalizing the attention coefficient to determine a first semantic embedding of each node based on the normalized attention coefficient;
determining a second semantic embedding for each node based on the multi-headed attention and the first semantic embedding for each node;
and constructing the event heterogram based on the second semantic embedding of each node.
4. The event extraction method according to claim 1, wherein the determining a set of candidate trigger words and a set of argument based on prompt learning comprises:
converting the original input text into a prompt template based on the prompt learning;
inputting the prompt template into a preset language model, and obtaining candidate trigger words and candidate arguments output by the preset language model, wherein the preset language model is obtained by training by adopting a sample prompt template;
the set of candidate trigger words is constructed based on the candidate trigger words, and the set of candidate argument elements is constructed based on the candidate argument elements.
5. The method of event extraction according to claim 1, wherein the clustering of nodes in the event profile comprises:
randomly selecting K nodes in the event abnormal graph as initial clustering centers;
and calculating the distance between each node and each cluster center, and distributing each node to the cluster center closest to the node to obtain at least one event type cluster and at least one argument type cluster.
6. The method of event extraction according to claim 5, wherein the labeling the clustered clusters comprises:
if the cluster is an event type cluster, determining a target node closest to the event type cluster, and taking a node text of the target node as a label of the event type cluster;
if the cluster is an argument type cluster, determining a label name of the argument type cluster based on a set label name.
7. The event extraction method according to claim 1, wherein the event extraction based on the event pattern comprises:
determining a matching result of the text to be extracted and the event mode;
and carrying out event extraction on the text to be extracted based on the matching result.
8. An event extraction apparatus, comprising:
the set determining module is used for determining a candidate trigger word set and an argument set based on prompt learning;
the event abnormal composition construction module is used for constructing an event abnormal composition based on the candidate trigger word set and the argument set;
the event pattern generation module is used for clustering the nodes in the event abnormal graph and naming the clustered clusters by labels so as to generate an event pattern;
and the event extraction module is used for carrying out event extraction based on the event mode.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the event extraction method of any of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the event extraction method according to any of claims 1 to 7.
CN202310612524.5A 2023-05-29 2023-05-29 Event extraction method, device, electronic equipment and storage medium Pending CN116842949A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310612524.5A CN116842949A (en) 2023-05-29 2023-05-29 Event extraction method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310612524.5A CN116842949A (en) 2023-05-29 2023-05-29 Event extraction method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116842949A true CN116842949A (en) 2023-10-03

Family

ID=88164249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310612524.5A Pending CN116842949A (en) 2023-05-29 2023-05-29 Event extraction method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116842949A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725191A (en) * 2024-02-18 2024-03-19 卓世智星(天津)科技有限公司 Guide information generation method and device of large language model and electronic equipment
CN117725191B (en) * 2024-02-18 2024-05-28 卓世智星(天津)科技有限公司 Guide information generation method and device of large language model and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725191A (en) * 2024-02-18 2024-03-19 卓世智星(天津)科技有限公司 Guide information generation method and device of large language model and electronic equipment
CN117725191B (en) * 2024-02-18 2024-05-28 卓世智星(天津)科技有限公司 Guide information generation method and device of large language model and electronic equipment

Similar Documents

Publication Publication Date Title
CN110705301B (en) Entity relationship extraction method and device, storage medium and electronic equipment
CN109885692A (en) Knowledge data storage method, device, computer equipment and storage medium
CN106709754A (en) Power user grouping method based on text mining
WO2021031825A1 (en) Network fraud identification method and device, computer device, and storage medium
CN112883193A (en) Training method, device and equipment of text classification model and readable medium
CN111866004B (en) Security assessment method, apparatus, computer system, and medium
CN110543633B (en) Sentence intention identification method and device
CN112926045B (en) Group control equipment identification method based on logistic regression model
CN111274804A (en) Case information extraction method based on named entity recognition
CN113626607B (en) Abnormal work order identification method and device, electronic equipment and readable storage medium
CN109933792A (en) Viewpoint type problem based on multi-layer biaxially oriented LSTM and verifying model reads understanding method
CN116049412B (en) Text classification method, model training method, device and electronic equipment
CN113627530A (en) Similar problem text generation method, device, equipment and medium
CN112685550A (en) Intelligent question answering method, device, server and computer readable storage medium
CN113821587A (en) Text relevance determination method, model training method, device and storage medium
CN111723182A (en) Key information extraction method and device for vulnerability text
CN116304064A (en) Text classification method based on extraction
CN104200222B (en) Object identifying method in a kind of picture based on factor graph model
CN111125379A (en) Knowledge base expansion method and device, electronic equipment and storage medium
CN116842949A (en) Event extraction method, device, electronic equipment and storage medium
CN116187442A (en) Dynamically updated intelligent customer service knowledge base system
CN113032567B (en) Position embedding interpretation method and device, computer equipment and storage medium
CN112883703B (en) Method, device, electronic equipment and storage medium for identifying associated text
CN115114500A (en) Rumor detection method and system based on reported information and propagation heteromorphic graph
CN113535945B (en) Text category recognition method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination