Method and device for extracting arguments, electronic equipment and storage medium
By employing a dynamic multi-pooling and iterative event extraction method, trigger words and entity relationships in multi-event sentences are identified, solving the problems of information omission and low recall in existing methods and achieving higher accuracy and recall.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2026-03-17
AI Technical Summary
Existing event extraction methods tend to miss valuable information in multi-event sentences and only focus on directly related argument entities, resulting in low precision and recall.
By dynamically multi-pooling to obtain trigger words and combining them with entity relationships, an iterative mechanism is used to identify directly and indirectly related arguments, thereby improving the accuracy of information extraction.
It improves the accuracy and recall of event extraction, makes up for the missing information in existing methods, and solves the problem of insufficient identification of indirect related arguments.
Smart Images

Figure CN117056501B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and more particularly to an argument extraction method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of natural language processing and the rapid growth of online information, the difficulty for people to obtain personalized information continues to increase, making event extraction a hot research topic in the field of information extraction. The task of event extraction is to extract event elements from unstructured text and organize them into a structured form.
[0003] Existing event extraction methods rely on pooling layers that can only capture the most important information in a sentence. Therefore, when extracting events from sentences with multiple events, valuable information may be missed, leading to low precision and recall. Furthermore, when extracting arguments, these methods only focus on arguments directly related to the trigger word, thus missing arguments indirectly related to the trigger word, resulting in low argument recall as well. Summary of the Invention
[0004] In view of this, the purpose of this disclosure is to provide an argument extraction method, apparatus, electronic device and storage medium.
[0005] As one aspect of this disclosure, a method for extracting arguments is provided, comprising:
[0006] Get the target text;
[0007] The target text is subjected to dynamic multi-pooling processing to obtain the trigger words of the target text;
[0008] Determine several entities in the target text and the relationships between those entities;
[0009] Based on the trigger word, the entities and the relationships between the entities, the arguments of the target text are extracted.
[0010] Optionally, the step of performing dynamic multi-pooling processing on the target text to obtain the trigger words of the target text includes:
[0011] The target text is vectorized to obtain the vectorized target text;
[0012] Based on a preset pooling range, the vectorized target text is dynamically multi-pooled to obtain the trigger words of the vectorized target text.
[0013] Optionally, the step of vectorizing the target text to obtain the vectorized target text includes:
[0014] Determine a sequence of words in the target text;
[0015] The word sequences are mapped to obtain vector representations of the word sequences.
[0016] The vector representations of the several word sequences are concatenated to obtain the vectorized target text.
[0017] Optionally, the dynamic multi-pooling process performed on the vectorized target text based on a preset pooling range to obtain the trigger words of the vectorized target text includes:
[0018] Identify several candidate trigger words in the vectorized target text;
[0019] Based on the first pooling range, the candidate trigger words are subjected to a first pooling process to obtain the first semantic features of the candidate trigger words.
[0020] The first pooling range is adjusted based on the positions of the candidate trigger words in the vectorized target text to obtain the second pooling range;
[0021] Based on the second pooling range, the candidate trigger words are subjected to a second pooling process to obtain the second semantic features of the candidate trigger words.
[0022] The trigger words of the vectorized target text are determined based on the first semantic feature and the second semantic feature.
[0023] Optionally, determining the trigger words of the vectorized target text based on the first semantic feature and the second semantic feature includes:
[0024] The first semantic feature and the second semantic feature are merged to obtain the target feature;
[0025] Based on the target features, the trigger words of the vectorized target text are determined;
[0026] The target feature is represented as follows:
[0027] Context(W,w i =concat(c i,l ,c i,r )
[0028] Where Context represents the target feature, W represents a sequence of words in the vectorized target text, and w iLet c be the i-th word in a sequence of words, and concat represents the merging operation. i,l ,c i,r These are the first semantic feature and the second semantic feature, respectively.
[0029] Optionally, the step of extracting arguments from the target text based on the trigger word, the plurality of entities, and the relationships between the plurality of entities includes:
[0030] Calculate the association probability between each of the entities and the trigger word, and take the entity whose association probability is greater than a preset value as the first argument of the target text;
[0031] Based on the relationships between the entities, the first argument is iteratively processed to obtain the second argument of the target text;
[0032] Extract the second argument.
[0033] Optionally, the association probability is expressed as:
[0034]
[0035] Where, p Role For the probability of association, and These are the linear transformation parameters for the trigger word and several entities, respectively.
[0036] As a second aspect of this disclosure, this disclosure also provides an argument extraction device, comprising:
[0037] The target text acquisition module is configured to acquire the target text.
[0038] The trigger word acquisition module is configured to perform dynamic multi-pooling processing on the target text to obtain the trigger words of the target text;
[0039] The entity relationship determination module is configured to: determine several entities in the target text and the relationships between the several entities;
[0040] The argument extraction module is configured to extract arguments from the target text based on the trigger word, the entities, and the relationships between the entities.
[0041] As a third aspect of this disclosure, this disclosure also provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the argument extraction method described above provided in this disclosure.
[0042] As a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is also provided, the non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the methods described in any of the above-mentioned methods.
[0043] As described above, in this disclosure, the target text to be extracted is first obtained, and then the target text is dynamically pooled multiple times to obtain the trigger words of the target text. Then, the entities in the target text are identified, and the relationships between the entities are analyzed. Finally, the arguments of the target text are extracted through the trigger words, entities, and relationships between entities. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in this disclosure or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1A This is a schematic diagram of an argument extraction method provided in an embodiment of the present disclosure.
[0046] Figure 1B This is a schematic diagram of a method for determining trigger words provided in an embodiment of this disclosure.
[0047] Figure 1C This is a schematic diagram of an argument extraction method provided in an embodiment of the present disclosure.
[0048] Figure 2 This is a schematic diagram of the structure of an argument extraction device provided in an embodiment of the present disclosure.
[0049] Figure 3 This is a schematic diagram of an electronic device structure for an argument extraction method provided in an embodiment of this disclosure. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0051] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0052] With the development of natural language processing and the rapid growth of online information, the difficulty for people to obtain personalized information continues to increase, making event extraction a hot research topic in the field of information extraction. The task of event extraction is to extract event elements from unstructured text and organize them into a structured form.
[0053] Existing event extraction methods rely on pooling layers that can only capture the most important information in a sentence. Therefore, when extracting events from sentences with multiple events, valuable information may be missed, leading to low precision and recall. Furthermore, when extracting arguments, these methods only focus on arguments directly related to the trigger word, thus missing arguments indirectly related to the trigger word, resulting in low argument recall as well.
[0054] To address the aforementioned problems, this disclosure provides a method, apparatus, electronic device, and storage medium for argument extraction. Using this method, the present disclosure first obtains the target text (i.e., text composed of natural language characters) to be extracted. Then, it performs dynamic multiple pooling processes on the target text using different pooling ranges to obtain the trigger words of the target text. Next, it performs sentence analysis on the target text and identifies the entities (e.g., driving, car accident, etc.) and the relationships between entities. Finally, by combining the influence of trigger words, entities, and relationships between entities, the arguments of the target text are determined, and ultimately, the determined arguments are extracted.
[0055] This disclosure employs an iterative event argument extraction method. After identifying arguments with direct semantic association to the trigger word, it gradually identifies arguments with indirect semantic association by leveraging the relationships between entity semantics. This overcomes the deficiency in existing event argument extraction methods that neglect indirect semantically associated arguments. Furthermore, this disclosure approximates different levels of entity relevance through an attention mechanism, thereby resolving the issue of discrepancies in inference results for the same target entity based on different arguments, further improving the accuracy of the event argument extraction model.
[0056] After introducing the basic principles of this disclosure, various non-limiting embodiments of this disclosure will be described in detail below.
[0057] Figure 1A This is a schematic diagram of an argument extraction method provided in an embodiment of the present disclosure.
[0058] Figure 1A The argument extraction method shown further includes the following steps:
[0059] Step S10: Obtain the target text.
[0060] In some optional embodiments, the argument extraction method of this disclosure can be implemented by an argument extraction model. Specifically, the argument extraction model can first obtain the target text from which the argument information to be extracted can be text information composed of characters in natural language (i.e., a complete sentence).
[0061] In some optional embodiments, after obtaining the target text, the argument extraction model can be pre-trained using the target text so that the argument extraction model in this disclosure becomes familiar with the information such as words in the target text, thereby making it more convenient for the argument extraction model to perform argument extraction work.
[0062] In some optional embodiments, the aforementioned pre-training process may specifically involve first inputting the target text into the argument extraction model, and then the argument extraction model encoding and analyzing the text information of the target text to determine the number, meaning, and part-of-speech information of several word sequences in the target text, thereby completing the pre-training process of the argument extraction model in this disclosure.
[0063] Step S20: Perform dynamic multi-pooling processing on the target text to obtain the trigger words of the target text.
[0064] In some optional embodiments, step S20 further includes:
[0065] S201: The target text is vectorized to obtain the vectorized target text.
[0066] In some optional embodiments, step S201 further includes:
[0067] S2011: Determine a sequence of words in the target text.
[0068] S2012: Perform mapping processing on the several word sequences to obtain vector representations of the several word sequences.
[0069] S2013: Concatenate the vector representations of the several word sequences to obtain the vectorized target text.
[0070] In some alternative embodiments, the argument extraction model can be used to extract arguments after pre-training. Specifically, the target text can first be vectorized using this argument extraction model.
[0071] In some optional embodiments, the aforementioned vectorization process can be represented as follows: first, several word sequences in the target text are determined (i.e., several word sequences determined in the pre-training process); then, these word sequences are mapped to obtain vector representations of several word sequences; finally, according to the position of these word sequences in the target text, the vector representations of these word sequences are concatenated to obtain the vector representation of the target text (i.e., the vectorized target text).
[0072] In some optional embodiments, the aforementioned process of vectorizing the target text can also be represented as: for all word sequences W = {W1, ..., W2} in the target text... n-1 W n} Perform word vector transformation to obtain the vector representation H = {H1, ..., H2} n-1 H n}
[0073] In some optional embodiments, the argument extraction model employs a bidirectional attention structure, allowing it to compute input and output representations entirely based on self-attention mechanisms, without using sequence-aligned recurrent neural networks or convolutional neural network models. Consequently, its feature extraction capability is significantly stronger than existing neural network models (i.e., it can extract semantic features from sentences, thus obtaining better semantic representations).
[0074] In some optional embodiments, this invention utilizes an argument extraction model to map the input word sequence into vectors, and then concatenates these vectors in sequence to obtain a vectorized representation of the target text. Specifically, the input to the argument extraction model can include three parts (i.e., Token Embedding, Segment Embedding, and Position Embedding). Token Embedding uses WordPiece embedding, and Segment Embedding identifies the sentence number where the word is located (in this disclosure, for each input target text, all word sequences are numbered 1). Position Embedding preserves the positional information of the word sequence; a vector is randomly initialized for each position and then added to the model training. Finally, the three embeddings corresponding to each word are superimposed to form the input to the argument extraction model.
[0075] In some optional embodiments, since the argument extraction model in this disclosure uses bidirectional encoding, the training results can also reflect the semantic relationship between a certain word sequence and other word sequences in the target text, thereby characterizing the polysemy of the word sequence and ultimately obtaining a better word sequence distribution representation.
[0076] S202: Classify the feature representation based on its type to obtain a classified feature representation.
[0077] Figure 1B This is a schematic diagram of a method for determining trigger words provided in an embodiment of this disclosure.
[0078] In some alternative embodiments, such as Figure 1B As shown, step S202 further includes the following steps:
[0079] S2021: Determine several candidate trigger words in the target text after vectorization.
[0080] S2022: Perform a first pooling process on the candidate trigger words based on the first pooling range to obtain the first semantic features of the candidate trigger words.
[0081] S2023: Based on the positions of the candidate trigger words in the target text after vectorization, the first pooling range is adjusted to obtain the second pooling range.
[0082] S2024: Perform a second pooling process on the candidate trigger words based on the second pooling range to obtain the second semantic features of the candidate trigger words.
[0083] S2025: Determine the trigger word of the vectorized target text based on the first semantic feature and the second semantic feature.
[0084] In some alternative embodiments, after the target text is vectorized, the argument extraction model can determine the trigger words in the target text, and then extract the arguments in the target text using the determined trigger words.
[0085] In some optional embodiments, the process of determining trigger words in the target text can be represented as first determining several candidate trigger words in the target text. It is understood that, in order to make the final determined trigger words more accurate, the argument extraction model can use all word sequences in the target text as candidate trigger words for the target text (e.g., if the target text is "I and you are in a meeting"; then the candidate trigger words are "I, you, meeting").
[0086] In some optional embodiments, after determining a number of candidate trigger words, the argument extraction model can perform a first pooling process on the target text based on a preset first pooling range to obtain the first semantic feature of each candidate trigger word (e.g., the left semantic feature of the candidate trigger word).
[0087] In some optional embodiments, after obtaining the left-hand semantic features of the candidate trigger words, the first pooling range can be adjusted according to the position of the candidate trigger words in the target text to obtain the second pooling range. Then, the target text is pooled a second time using the second pooling range to obtain the second semantic features of each candidate trigger word (e.g., the right-hand semantic features of the candidate trigger word).
[0088] In some optional embodiments, after obtaining the first and second semantic features of the target text, they can be merged to obtain the target features of the target text (i.e., features used to interpret the central meaning of the target text). Then, trigger words (i.e., candidate trigger words related to the target features) can be determined using these target features.
[0089] In some optional embodiments, the calculation formula for the aforementioned two pooling processes is expressed as follows:
[0090] c i,l =max(h0,…,h) i )
[0091] c i,r =max(h i ,…,h n )
[0092] Among them, c i,l This indicates the first pooling process; ci,r This indicates the second pooling process; max is a function that takes the maximum value of a specified dimension, which in this disclosure is the dimension corresponding to the word sequence length.
[0093] In some optional embodiments, the aforementioned merging process to obtain the target feature can be represented as:
[0094] Context(W,w i =concat(c i,l ,c i,r )
[0095] Where Context represents the target feature, W represents a sequence of words in the vectorized target text, and w i Let c be the i-th word in a sequence of words, and concat represents the merging operation. i,l ,c i,r These are the first semantic feature and the second semantic feature, respectively.
[0096] In some optional embodiments, after obtaining the trigger word of the target text, the method of this disclosure further includes:
[0097] S2026: Input the trigger word and target features into a preset event probability distribution model to determine the event type of the trigger word.
[0098] In some optional embodiments, after obtaining the trigger word, the argument extraction model can input the trigger word and the target features of the target text into the event probability distribution model, and then calculate the probability of the event type corresponding to the trigger word through the event probability distribution model. Finally, the event type with the highest probability is selected as the event type of the trigger word.
[0099] In some optional embodiments, the process of calculating the probability of the event type corresponding to this trigger word using an event probability distribution model can be represented as:
[0100]
[0101] in, For trigger word w i The probability of the event, W ED and b ED The parameters are the linear transformation parameters of the event probability distribution layer.
[0102] Step S30: Determine several entities in the target text and the relationships between the several entities.
[0103] In some optional embodiments, to make the arguments identified in this disclosure more accurate, this disclosure also introduces the influence of entities in the target text and the relationships between entities on the arguments. Specifically, the argument extraction model may first identify the entities in the target text and analyze the identified entities to obtain the relationships between these entities.
[0104] In some alternative embodiments, to amplify the influence of entities on argument extraction, entities in the target text can also be all word sequences in the target text (e.g., "I, you, meeting"). Accordingly, after analyzing the entities, the relationships between them can be obtained as "event" (e.g., meeting) and "event object" (e.g., I and you).
[0105] Step S40: Based on the trigger word, the entities and the relationships between the entities, extract the arguments of the target text.
[0106] Figure 1C This is a schematic diagram of an argument extraction method provided in an embodiment of the present disclosure.
[0107] In some alternative embodiments, such as Figure 1C As shown, step S40 specifically includes:
[0108] S401: Calculate the association probability between each of the plurality of entities and the trigger word, and take the entity whose association probability is greater than a preset value as the first argument of the target text.
[0109] S402: Iteratively process the first argument based on the relationship between the entities to obtain the second argument of the target text.
[0110] S403: Extract the second argument.
[0111] In some optional embodiments, after obtaining the entities in the target text and the relationships between them, the arguments in the target text can be determined based on the association probability between the trigger word and them. Specifically, the argument extraction model can first calculate the association probability between each entity among several entities and the trigger word, then take the entities with an association probability greater than a preset value as the first arguments of the target text (i.e., arguments with a direct semantic relationship to the target text), and finally extract the first arguments. It is understood that the aforementioned preset value is a value determined by the operator after observing the association results.
[0112] In some alternative embodiments, the aforementioned association probability can be expressed as:
[0113]
[0114] Where, p Role For the probability of association, and These are the linear transformation parameters for the trigger word and several entities, respectively.
[0115] In some optional embodiments, to make the obtained arguments more accurate, the argument extraction model also considers the influence of the relationships between entities on the arguments. Specifically, the argument extraction model can iteratively process the first argument based on the relationships between entities to obtain the second argument of the target text (i.e., the argument that has an indirect semantic relationship with the target text), and then extract the second argument to obtain the set of all arguments related to the target text (i.e., those with direct semantic relationships and those with indirect semantic relationships).
[0116] In some optional embodiments, the argument extraction model of this disclosure focuses only on precision, thus simplifying parameter selection compared to existing models. Furthermore, the model of this disclosure can generate arguments (i.e., first arguments) that are directly semantically related to the trigger word, which largely avoids confusion in early iterations and thus solves the cold start problem.
[0117] In some optional embodiments, the aforementioned process of determining the first argument can also be expressed as follows: using an argument extraction model to encode the entity and obtain the vector representation of the entity, and then classifying the target text into argument roles based on the vector representation of the entity and the trigger word to obtain arguments that have a direct semantic association with the trigger word.
[0118] In some optional embodiments, the aforementioned entity encoding process can be the same as step S201. That is, word vector transformation W = {W1, ..., W2} is performed on all word sequences composed of words in the target text. n-1 W n}, thus obtaining the vector representation of the entity H = {H1, ..., H2}. n-1 H n}
[0119] The vector representation of the entity is as follows:
[0120] e i =mean(w i,j )
[0121] Among them, w i,j For the j-th word of entity i, e i Let i be the vector representation of entity i.
[0122] In some optional embodiments, the same method can also be used to obtain the vector representation of the trigger word, specifically as follows:
[0123] t i =mean(wi,j )
[0124] Among them, w i,j For the j-th word of trigger word i, t i Let i be the vector representation of the trigger word i.
[0125] In some optional embodiments, after obtaining the vector representations of the entity and the trigger word, the first argument in the target text can be determined by argument role classification. Specifically, the argument role classification layer in the argument extraction model first receives the features of the argument entity and the trigger word (i.e., the aforementioned vector representations), and inputs them into the argument role classification layer to generate an argument role probability distribution. Then, the argument role with the highest probability is selected as the first argument.
[0126] In some optional embodiments, the aforementioned process of determining the second argument can also be expressed as follows: for the currently known set of arguments (i.e., the first argument), the entity relationship between the target entity and the corresponding argument is combined, and the argument extraction model is used to iteratively process it to obtain the second argument of the target text.
[0127] In some optional embodiments, a first argument with direct semantic association can be used as the initial input argument of the argument extraction model, and then iteratively processed to obtain a second argument with indirect semantic association with the target text. During the iterative process, the first argument expands with the increase of the number of iterations of the argument extraction model, and then other argument roles (such as the second argument) can be gradually inferred.
[0128] In some optional embodiments, by iteratively processing the first argument, only a few role categories of the first argument are updated in each iteration, thereby simplifying the argument extraction model structure and making it easier to optimize. Furthermore, this disclosure introduces entity relationship information as an aid, which can significantly improve the feature analysis upper limit of the argument extraction model, thereby enhancing the interaction between tasks in the information extraction domain.
[0129] In some optional embodiments, the argument extraction model of this disclosure is further provided with an argument disambiguation module. This argument disambiguation module can calculate the degree of association between known arguments (e.g., the first argument and the second argument) and ambiguous arguments, thereby eliminating ambiguous information in the first argument and the second argument. The aforementioned degree of association can be calculated using an attention mechanism.
[0130] In some optional embodiments, the argument disambiguation module can calculate the correlation between the first argument and the second argument, and then aggregate the role probability distributions predicted by all arguments for the first argument and the second argument with the correlation as the weight, and finally select the role type with the highest probability as the final role type of the argument determined in this disclosure.
[0131] In some optional embodiments, the argument disambiguation module can also first generate argument role types based on the first and second arguments, as well as event type information and relation type information. The formula for the aforementioned event type information is:
[0132] ev i =Embedding event (event i )
[0133] Among them, ev i It is a dense representation of event types, Embedding event For event type embedding layer, event i The event category number for the trigger word t.
[0134] In some optional embodiments, the formula for the aforementioned relationship type information is:
[0135] relation i =Embedding rel (rel i )
[0136] Among them, relation i It is a dense representation of relation types, Embedding rel For the relation type embedding layer, rel i For argument a i Relationship category number.
[0137] In some optional embodiments, after obtaining the argument role type, the relevance of the argument role type can be calculated. Specifically, the probability of an argument participating in a characteristic event type varies under different relations, and argument a is controlled according to the probability. i The degree of influence on the identification of candidate argument roles.
[0138] In some optional embodiments, the aforementioned relevance calculation formula is as follows:
[0139]
[0140] in, For argument a i The degree of relevance to argument a.
[0141] In some optional embodiments, after obtaining the relevance score, the relevance score can be used as a weight to aggregate the role probability distribution of all arguments predicted for candidate arguments. The aforementioned aggregation formula can be expressed as:
[0142]
[0143] Where, p a Let be the role probability distribution of argument a.
[0144] In some alternative embodiments, p can be selected after aggregation. a The category with the highest probability is selected as the role of argument 'a'. Then, after calculating the roles of all arguments, the set of arguments whose role type is not "non-argument" is selected as the known arguments for the next iteration, and the set of arguments whose role type is "non-argument" is selected as the candidate argument set for the next iteration. Finally, both sets are input into the iterative event argument extraction model for the next iteration.
[0145] In summary, this disclosure first obtains the target text for argument extraction, then performs dynamic multiple pooling processes on the target text to obtain the trigger words of the target text, then identifies the entities in the target text, analyzes these entities to obtain the relationships between entities, and finally extracts the arguments of the target text through the trigger words, entities, and relationships between entities.
[0146] Using the methods described above, this disclosure generates unique representation codes for each candidate trigger word through a dynamic multi-pooling mechanism. Compared to traditional methods, this allows for the extraction of multiple valuable pieces of information from a sentence, avoiding the situation where the pooling layer can only extract the most important information when a sentence contains multiple events. Secondly, the event argument extraction model uses an iterative mechanism, which, compared to traditional methods, can gradually extract arguments with indirect semantic connections to the trigger word through multiple iterations, reducing the model's overemphasis on the trigger word.
[0147] Based on the same technical concept, corresponding to the methods of any of the above embodiments, this disclosure also provides an argument extraction device, which can realize the argument extraction method described in any of the above embodiments.
[0148] Figure 2 This is a schematic diagram of an argument extraction device provided in an embodiment of the present disclosure.
[0149] Figure 2 The argument extraction device shown further includes the following modules:
[0150] Target text acquisition module 10, trigger word acquisition module 20, entity relationship determination module 30, and argument extraction module 40;
[0151] The target text acquisition module 10 is configured to acquire target text.
[0152] The trigger word acquisition module 20 is configured to perform dynamic multi-pooling processing on the target text to obtain the trigger words of the target text. Specifically, the following steps are executed:
[0153] The target text is vectorized to obtain the vectorized target text, including:
[0154] Determine a sequence of words in the target text;
[0155] The word sequences are mapped to obtain vector representations of the word sequences.
[0156] The vector representations of the several word sequences are concatenated to obtain the vectorized target text;
[0157] Based on a preset pooling range, the vectorized target text is dynamically multi-pooled to obtain the trigger words of the vectorized target text, including:
[0158] Identify several candidate trigger words in the vectorized target text;
[0159] Based on the first pooling range, the candidate trigger words are subjected to a first pooling process to obtain the first semantic features of the candidate trigger words.
[0160] The first pooling range is adjusted based on the positions of the candidate trigger words in the vectorized target text to obtain the second pooling range;
[0161] Based on the second pooling range, the candidate trigger words are subjected to a second pooling process to obtain the second semantic features of the candidate trigger words.
[0162] Based on the first semantic feature and the second semantic feature, the trigger words of the vectorized target text are determined, including:
[0163] The first semantic feature and the second semantic feature are merged to obtain the target feature;
[0164] Based on the target features, the trigger words of the vectorized target text are determined;
[0165] The target feature is represented as follows:
[0166] Context(W,w i =concat(c i,l ,c i,r )
[0167] Where Context represents the target feature, W represents a sequence of words in the vectorized target text, and w i Let c be the i-th word in a sequence of words, and concat represents the merging operation. i,l ,c i,r These are the first semantic feature and the second semantic feature, respectively.
[0168] The entity relationship determination module 30 is configured to: determine several entities in the target text and the relationships between the several entities.
[0169] The argument extraction module 40 is configured to extract arguments from the target text based on the trigger word, the plurality of entities, and the relationships between the plurality of entities. Specifically, the following steps are performed:
[0170] Calculate the association probability between each of the plurality of entities and the trigger word, and take the entity whose association probability is greater than a preset value as the first argument of the target text; wherein, the association probability is expressed as:
[0171]
[0172] Where, p Role For the probability of association, and These are the linear transformation parameters for the trigger word and several entities, respectively;
[0173] Based on the relationships between the entities, the first argument is iteratively processed to obtain the second argument of the target text;
[0174] Extract the second argument.
[0175] Based on the same technical concept, corresponding to the methods of any of the above embodiments, this disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the argument extraction method described in any of the above embodiments.
[0176] Figure 3This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0177] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0178] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0179] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0180] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0181] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0182] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0183] The electronic devices described above are used to implement the corresponding argument extraction methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0184] Based on the same technical concept, corresponding to the methods of any of the above embodiments, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the argument extraction method as described in any of the above embodiments.
[0185] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0186] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the argument extraction method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0187] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this disclosure (including the claims) is limited to these examples; within the framework of this disclosure, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this disclosure as described above, which are not provided in detail for the sake of brevity.
[0188] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this disclosure, the provided drawings may or may not show well-known power / ground connections to integrated circuit (IC) chips and other components. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this disclosure, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this disclosure will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuitry) have been set forth to describe exemplary embodiments of this disclosure, it will be apparent to those skilled in the art that the embodiments of this disclosure may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0189] Although this disclosure has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0190] This disclosure is intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method of extracting arguments, characterized by, The method comprises the following steps: acquiring a target text; performing dynamic multi-pooling processing on the target text to obtain a trigger word of the target text; the dynamic multi-pooling processing on the target text to obtain the trigger word of the target text comprises: performing vectorization processing on the target text to obtain a vectorization-processed target text; performing dynamic multi-pooling processing on the vectorization-processed target text based on a preset pool range to obtain a trigger word of the vectorization-processed target text; the dynamic multi-pooling processing on the vectorization-processed target text based on the preset pool range to obtain the trigger word of the vectorization-processed target text comprises: determining a plurality of candidate trigger words in the vectorization-processed target text; performing first pool processing on the plurality of candidate trigger words based on a first pool range to obtain a first semantic feature of the plurality of candidate trigger words; adjusting the first pool range based on positions of the plurality of candidate trigger words in the vectorization-processed target text to obtain a second pool range; performing second pool processing on the plurality of candidate trigger words based on the second pool range to obtain a second semantic feature of the plurality of candidate trigger words; determining the trigger word of the vectorization-processed target text based on the first semantic feature and the second semantic feature; the determination of the trigger word of the vectorization-processed target text based on the first semantic feature and the second semantic feature comprises: performing merging processing on the first semantic feature and the second semantic feature to obtain a target feature; determining the trigger word of the vectorization-processed target text based on the target feature; wherein the target feature is represented as: in, For target features, This refers to a sequence of words in the target text after vectorization. For the first word in a sequence of several words One word, This indicates a merge operation. These are the first semantic feature and the second semantic feature, respectively; determining a plurality of entities in the target text and relationships between the plurality of entities; extracting an argument of the target text based on the trigger word, the plurality of entities and the relationships between the plurality of entities.
2. The method of claim 1, wherein, the vectorization processing on the target text to obtain a vectorization-processed target text comprises: determining a plurality of word sequences in the target text; performing mapping processing on the plurality of word sequences to obtain vector representations of the plurality of word sequences; splicing the vector representations of the plurality of word sequences to obtain the vectorization-processed target text.
3. The method of claim 1, wherein, the extraction of the argument of the target text based on the trigger word, the plurality of entities and the relationships between the plurality of entities comprises: calculating an association probability of each entity in the plurality of entities with the trigger word, and taking an entity with an association probability greater than a preset value as a first argument of the target text; performing iterative processing on the first argument based on the relationships between the entities to obtain a second argument of the target text; extracting the second argument.
4. The method of claim 3, wherein, the association probability is represented as: wherein, is the probability of association probability, and are linear transformation parameters of the trigger word and the number of entities, respectively.
5. A device for extracting arguments, characterized by The method comprises the following steps: a target text acquisition module configured to acquire a target text; a trigger word acquisition module configured to perform dynamic multi-pooling processing on the target text to obtain a trigger word of the target text; the dynamic multi-pooling processing on the target text to obtain the trigger word of the target text comprises: vectorize the target text to obtain a vectorized target text; perform dynamic multi-pooling processing on the vectorized target text based on a preset pooling range to obtain a trigger word of the vectorized target text, including: determining a plurality of candidate trigger words in the vectorized target text; performing first pooling processing on the plurality of candidate trigger words based on a first pooling range to obtain a first semantic feature of the plurality of candidate trigger words; adjusting the first pooling range based on positions of the plurality of candidate trigger words in the vectorized target text to obtain a second pooling range; performing second pooling processing on the plurality of candidate trigger words based on the second pooling range to obtain a second semantic feature of the plurality of candidate trigger words; determining the trigger word of the vectorized target text based on the first semantic feature and the second semantic feature; the determining the trigger word of the vectorized target text based on the first semantic feature and the second semantic feature includes: performing merging processing on the first semantic feature and the second semantic feature to obtain a target feature; determining the trigger word of the vectorized target text based on the target feature; wherein the target feature is represented as: in, For target features, This refers to a sequence of words in the target text after vectorization. For the first word in a sequence of several words One word, This indicates a merge operation. These are the first semantic feature and the second semantic feature, respectively; an entity relationship determination module configured to determine a plurality of entities in the target text and relationships among the plurality of entities; an argument extraction module configured to extract arguments of the target text based on the trigger word, the plurality of entities, and the relationships among the plurality of entities.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the method of any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Generative event argument extraction method and system and storage medium
CN115238045A