An event element automatic extraction system and method
By using a method based on similarity measurement and bimorphic Prompt, the compatibility and labeling deficiencies in the automatic extraction of financial event elements are resolved, enabling fast and accurate extraction of event elements and adapting to the automatic extraction needs of various types of events.
Patent Information
- Application Number
- CN202310610364.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-05-29
AI Technical Summary
Existing technologies for the automatic extraction of financial event elements suffer from problems such as poor rule matching compatibility, insufficient labeled data, long inference time, and lack of connections between event types, resulting in low efficiency and insufficient accuracy.
We employ a data processing method based on similarity metrics and a sequence generation model based on bi-state prompts. By establishing connections between event types through static and dynamic prompts, we can quickly and accurately extract event elements using a small amount of labeled data.
It can quickly locate feature positions with limited labeled data, reduce redundant information, improve model processing efficiency and accuracy, adapt to new event types, assist in manual quality inspection, and improve the efficiency and accuracy of document-level event feature extraction.
Smart Images

Figure CN116644120B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to an event element automatic extraction system and method, belonging to the technical field of artificial intelligence natural language processing. BACKGROUND
[0002] With the increasing demand of the financial industry for public opinion data monitoring and analysis, deep mining of public opinion data has gradually become a major research focus of the financial industry. Among them, the extraction of related elements of financial events is an important basis for mining public opinion data. Because part of the announcement files in the financial field are generally objective factual statements, and the event elements are basically contained in the file content, the related elements of the financial event can be automatically parsed from the announcement files of listed companies using natural language processing technology. Event element automatic extraction can produce the following values: (1) reduce the repetitive work of researchers collecting, sorting and processing announcement data; (2) provide a data basis for the monitoring and analysis of public opinion data; (3) this technology can help researchers quickly obtain structured element information of events, and speed up the research and analysis process of researchers.
[0003] Event element automatic extraction is essentially a process of structuring data, that is, regarding the event announcement file as an unstructured data, and automatically extracting the structured element information of the corresponding event according to the data. There are mainly two categories of methods commonly used on the market at present, one is based on rule templates, and the other is based on deep neural network methods. The element extraction method based on deep neural network can be further divided into sequence labeling based method, machine reading comprehension based method and sequence generation based method.
[0004] The rule matching based method first summarizes and sorts the event type corresponding to the element content to be extracted in each type of announcement; secondly, a rule extraction template is designed for each element type of each event, and the corresponding element is extracted according to the format characteristics of each element content. For example, to extract the "repurchase time" element of the "bond repurchase" type, it is concluded that the appearance format of this element is generally "repurchase date is XXXX year XX month XX day", and the rule template is used to match the corresponding content in the text to obtain the repurchase time; finally, all the extracted element texts are saved together in the form of a dictionary to obtain the final structured element content text.
[0005] The sequence labeling based method mainly imitates the named entity recognition task, adopts the structure of "encoder + classifier", encodes the input text using an encoder, and classifies each word in the text through a classifier to determine whether the word belongs to the event element content. Finally, the extracted text phrases and elements are matched. The overall framework of the sequence labeling based method is shown in Figure 1 .
[0006] The method based on machine reading comprehension is to convert the element extraction task into a question and answer task. The main idea is to design a question template and extract elements in the text in the form of reading comprehension. For example, for the "bond repurchase" event, the question corresponding to the "repurchase time" element can be designed as "on which day was the bond repurchased?" or "what is the repurchase date?", and then the question and the text to be extracted are spliced together and input into the encoder, and then the content in the text is labeled. The method based on machine reading comprehension is similar to the basic model framework structure used in sequence labeling. The main difference is the content and format of the input and output. The overall framework of the method based on machine reading comprehension is shown in Figure 2 .
[0007] The event element extraction method based on sequence generation solves the event element extraction task in a generative manner. This method generally uses various pre-trained sequence generation models, such as BART, T5, etc. The model will decode the content of each element in turn by inputting the event type and the prompt information composed of all the elements to be extracted and the text to be extracted. For example, the prompt information template for the "bond repurchase" event element extraction is "bond repurchase [SEP] repurchase time [ARG] repurchase quantity [ARG] …", where "[SEP]", "[ARG]", etc. are special separators designed by humans. The overall block diagram of the method based on sequence generation is shown in Figure 3 .
[0008] Although the above methods can achieve automatic extraction of event elements, there are still some problems in actual use:
[0009] The rule matching method uses a single and rigid style of rule templates, and the compatibility of element matching is poor. The content of the element is not matched if it is expressed differently. The induction, maintenance, and expansion of matching rules require high human cost and domain knowledge.
[0010] In the element generation method based on sequence labeling, each category depends on a large amount of labeled data set to train the model. However, the event types in the financial field are numerous, and the labeled data is less, so the accuracy of the model is poor. The migration is poor, and the performance on newly added event types is very poor. New training corpus of event types needs to be added to retrain the model, which has high maintenance cost.
[0011] The element extraction method based on machine reading comprehension needs to reason for each element of each event, so the reasoning time required by this method is long. Each event and each element in a class of events is trained separately, without establishing mutual connections.
[0012] The performance of the event element extraction method based on sequence generation depends on the pre-training of the performance-dependent model and the design of the prompt information, the existing method lacks modeling of the connection between different event types, and the generated output text cannot guarantee that it is entirely derived from the input text. SUMMARY
[0013] In order to solve the problems existing in the prior art, the present application provides an event element automatic extraction system and method, which establishes the connection between different event types, quickly and accurately extracts event elements, through a data processing method based on similarity measurement and a sequence generation model based on a two-state Prompt, in the case of only a small amount of labeled data samples.
[0014] To solve the above technical problems, the present application adopts the following technical means:
[0015] In a first aspect, the present application provides an event element automatic extraction system, comprising a model iteration module and a data iteration module;
[0016] The model iteration module is used to iteratively train an event element extraction model based on a two-state Prompt according to a labeled data set, and is also used to obtain new labeled data generated by a data iteration model and update the labeled data set;
[0017] The data iteration module is used to obtain similar contexts similar to the event element context in the labeled data set from unlabeled text data through similarity measurement, extract event elements from the similar contexts through the event element extraction model based on the two-state Prompt trained by the model iteration module, and generate new labeled data according to the event elements and the corresponding similar contexts.
[0018] In combination with the first aspect, further, the event element extraction model based on the two-state Prompt extracts event elements according to a static Prompt, a dynamic Prompt and a current context text, wherein the current context text is an event element context or a similar context input into the event element extraction model based on the two-state Prompt.
[0019] In combination with the first aspect, further, the static Prompt comprises a plurality of event types and an event element template to be extracted under each event type.
[0020] In combination with the first aspect, further, the method for obtaining the dynamic Prompt is:
[0021] Aggregating a plurality of event types belonging to the same upper category to obtain K event vectors;
[0022] Obtaining a first relevance weight according to the relevance of the current event type and the K event vectors according to expert knowledge;
[0023] By performing text semantic analysis, the similarity between the current context text and K event vectors is obtained, and the second relevance weight is derived.
[0024] The current dynamic Prompt is obtained by weighting and aggregating the K event vectors based on the first and second relevance weights.
[0025] In conjunction with the first aspect, further, in the data iteration module, similar contexts similar to the event element contexts in the labeled dataset are obtained from the unlabeled text data through a similarity metric, including:
[0026] In the unlabeled text data, every three consecutive sentences are taken as a similarity calculation unit, resulting in multiple calculation units;
[0027] Vectorize all event element contexts in the labeled dataset and all computational units in the unlabeled text data to obtain event element context feature vectors and computational unit feature vectors;
[0028] The similarity between the feature vector of each computing unit and the context feature vector of each event element is calculated using a similarity measurement algorithm.
[0029] When the similarity exceeds a preset threshold, the computational unit corresponding to the feature vector of the computational unit is a similar context.
[0030] In conjunction with the first aspect, the similarity measurement algorithm further employs cosine similarity.
[0031] Secondly, this invention proposes an automatic event element extraction method, comprising the following steps:
[0032] Obtain labeled datasets and unlabeled text data;
[0033] Based on the event element context in the labeled dataset, a similarity measure is performed on the unlabeled text data to obtain similar context;
[0034] The similar context is extracted using a bimorphic Prompt-based event feature extraction model to obtain coarse-grained event features, and the labeled dataset is then updated.
[0035] The event element extraction model based on the bi-state Prompt is iteratively trained using the labeled dataset.
[0036] In conjunction with the second aspect, the event element extraction model based on bi-state Prompt further employs static Prompt and dynamic Prompt.
[0037] According to the second aspect, further, the static prompt comprises a plurality of event types and an event element template to be extracted under each event type;
[0038] The method for obtaining the dynamic prompt comprises:
[0039] The plurality of event types belonging to the same upper category are aggregated to obtain K event vectors;
[0040] According to expert knowledge, the relevance between the current event type and the K event vectors is obtained to obtain a first relevance weight;
[0041] Through text semantic analysis, the similarity between the current context text and the K event vectors is obtained to obtain a second relevance weight;
[0042] The K event vectors are weighted and aggregated according to the first relevance weight and the second relevance weight to obtain the current dynamic prompt.
[0043] According to the second aspect, further, based on the event element context in the labeled data set, the similarity of the unlabeled text data is measured to obtain a similar context, comprising:
[0044] Each continuous 3 sentences in the unlabeled text data are taken as a similarity calculation unit to obtain a plurality of calculation units;
[0045] All event element contexts in the labeled data set and all calculation units in the unlabeled text data are vectorized to obtain event element context feature vectors and calculation unit feature vectors;
[0046] The similarity between each calculation unit feature vector and each event element context feature vector is calculated through a similarity measurement algorithm;
[0047] When the similarity exceeds a preset threshold, the calculation unit feature vector corresponding to the calculation unit is a similar context.
[0048] The following advantages can be obtained after using the above technical means:
[0049] The application provides an event element automatic extraction system and method, which uses a small amount of labeled samples and event element contexts thereof, finds similar contexts through similarity measurement, can quickly locate the position of the element, reduces redundant information, and improves the efficiency of model processing; on the other hand, similar context areas are found in unlabeled samples from the labeled samples, reducing the workload of manually searching for event element areas in unlabeled samples, and improving the accuracy of document-level event element extraction. The application introduces static Prompt and dynamic Prompt, trains an event element extraction model based on the dual-state Prompt through a continuously updated training data set (labeled data set), can make the model perceive event type information and the relationship between events during the generation process, and can help the model quickly establish the relationship between different event types. On the basis of similar contexts, the event element extraction model generates coarse-grained event elements, which can effectively improve the processing efficiency of the model, the utilization rate of unlabeled data, the accuracy of event element extraction, and can also assist manual quality inspection. Even when the labeled data is scarce and new event types appear, the method of the application still has good performance. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 A framework schematic diagram of an event element extraction method based on sequence labeling;
[0051] Figure 2 A framework schematic diagram of an event element extraction method based on machine reading comprehension;
[0052] Figure 3 A framework schematic diagram of an event element extraction method based on sequence generation;
[0053] Figure 4 A schematic diagram of the overall framework structure of the event element extraction system of the application;
[0054] Figure 5 A schematic diagram of a context text containing an event element;
[0055] Figure 6 A framework structure schematic diagram of the event element extraction model based on the dual-state Prompt of the application;
[0056] Figure 7 A production process schematic diagram of the dynamic Prompt in the embodiment of the application. DETAILED DESCRIPTION
[0057] The technical solutions of the application will be further described below with reference to the drawings:
[0058] The event element extraction task is a task of automatically identifying relevant elements of a given event type in financial event text. Assuming that a given financial event related text set D={d1, d2, …, dn} is given, the event element extraction task is to extract the event elements of the event type T from the text set D.n} and the event type corresponding to each text, which includes a set of event types T = {t1, t2, ..., t} m}, where n is the total number of texts and m is the total number of event types. Additionally, the elements to be extracted for each event type must be specified, such as event type t. j The set of elements to be extracted corresponding to (j∈[1,m]) is A. j ={a j,1 ,a j,2 ,…,a j,k}, where k is the total number of elements to be extracted from the j-th event type. Finally, for text d i (i∈[1,n]) and corresponding event type t j The model extracts the values of event elements from the text based on the given information.
[0059] Based on existing technologies, document-level financial event classification faces two major challenges: first, event texts are document-level, with a lot of redundant information, and the models are not easy to handle when the texts are too long; second, there are many types of events and a lack of annotation resources, making it difficult to annotate each type of event with fine-grained element labels.
[0060] This invention proposes an automatic event element extraction system and method. By using an event element extraction model based on bi-state Prompt and a data processing method based on similarity measurement, it solves the problems of excessive textual redundancy and scarce annotation resources, and achieves faster and more accurate event element extraction.
[0061] Example 1:
[0062] This embodiment introduces an event element extraction system, such as... Figure 4 As shown, it includes a model iteration module and a data iteration module.
[0063] The model iteration module is mainly used for iterative training of the event element extraction model based on the bi-state Prompt. Specifically, the model iteration module is used to: (1) obtain the event element context containing event elements based on the labeled data in the labeled dataset; (2) train the event element extraction model based on the bi-state Prompt using the event elements and the event element context; (3) update the labeled dataset based on the newly generated labeled data in the data iteration module and return to step (1). Among them, the labeled data refers to the financial event text that has been labeled with the content and location of the event elements.
[0064] The model iteration module needs to preprocess and feature extract the labeled data set to obtain the event element context. In the embodiment of the application, the event element context is usually a sentence containing a specific event element and the previous and next sentences of the sentence, and the three sentences together constitute an event element context. For example, if the event element to be extracted is "illegal matter", all sentences in which "*** behavior *** violates *** regulations" appear are obtained from the labeled corpus, and the previous and next sentences are obtained, and the three sentences are spliced into a sentence as the context of the "illegal matter" element. Each event element can correspond to the context of multiple sentences, as shown in Figure 5
[0065] In the embodiment of the application, the base model of the event element extraction model based on the dual-state Prompt is a Prompt-based generative element extraction model. The Prompt-based generative element extraction model splices the event type and the name of the element to be extracted of the type as prompt information and the context text, inputs them into a generative pre-training model, and decodes to generate an element sequence of a specified template. Compared with a sequence labeling model, the Prompt-based generative element extraction model has a lower dependence on labeled data and can have better performance in the case of few samples; compared with a machine reading comprehension method, the Prompt-based generative element extraction model can output all elements of a certain event in the text at one time in the reasoning stage, and has higher reasoning efficiency.
[0066] However, the existing Prompt-based generative pre-training model still has certain defects: on the one hand, the traditional Prompt-based event element extraction method inputs each event type as static prompt information into the model separately, and lacks the capture and use of the relationship between different event types; on the other hand, although some studies design context-related dynamic Prompt to model the relationship between event types, they ignore the role of event type label-related static Prompt, and only rely on.
[0067] The application proposes an event element extraction model based on dual-state Prompt on the basis of the Prompt-based generative element extraction model. In the element extraction process, static Prompt and dynamic Prompt need to be used simultaneously, as shown in Figure 6 The static Prompt, the dynamic Prompt, and the context text containing the event element are input into the encoder, and the specific event element content is decoded by the decoder of the model.
[0068] In the application scenario of the application, the event type, the elements contained under each event type, and other basic information have been obtained in advance. On this basis, the application performs automatic extraction of event elements.
[0069] The static Prompt adopted by the application includes an event type label and an event element template to be extracted, and the event type label and the event element template to be extracted can be pre-set by human. For example, the elements to be extracted for the event type of "bond repurchase" include "bond name", "repurchase time", "repurchase amount", etc., and the corresponding static Prompt is: "bond repurchase [SEP] bond name [ARG] repurchase time [ARG] repurchase amount [ARG]". The template information of the static Prompt plays a prompting role for the model to extract the corresponding elements.
[0070] The dynamic Prompt adopted by the application is calculated according to K event vectors and context text, as shown in the following formula: Figure 7 In the embodiment of the application, the event vector is not a vector corresponding to each event type to be extracted, but an aggregated vector of the upper category of the event type to be extracted. For example, "change of directors and supervisors" and "change of actual controller" belong to the upper category "personnel change", and the event elements concerned in this category are also similar, so the representations of these events can be aggregated into an event vector. The dynamic Prompt is weighted and aggregated according to the K event vectors. The basis for the weight mainly includes two aspects: one is the relevance between the current event type and each upper category obtained according to artificial expert knowledge, to obtain a first relevance weight. The expert knowledge refers to the relevance weight between the current category and the K upper event provided by an expert, so that the general event type relevance prior knowledge can be introduced into the dynamic Prompt. The other is the relevance between the current context text and each event vector obtained by calculating the similarity between the aggregated vector of the current text content and the K event vectors, to obtain a second relevance weight. The aggregated vector of the current text content can be obtained by aggregating the output characters of the encoding model, and the similarity can be obtained by calculating the cosine similarity. The K event vectors are weighted and aggregated by the first relevance weight and the second relevance weight to obtain the current dynamic Prompt. The general relevance knowledge of the event type and the dynamic relevance of the sample text can be combined and introduced into the dynamic Prompt to provide dynamic prompting information for event type extraction.
[0071] By introducing the static prompt information (event type label and event element name template) and the dynamic prompt information (event vector combination based on expert knowledge and context), the application helps the event element extraction model based on the dual-state Prompt to perceive the event type information and the relationship between events during the generation process, which helps the model to quickly establish the relationship between different event types and perform well when there is insufficient labeled data and new event types appear.
[0072] The data iteration module is mainly used for extracting coarse-grained labeled data (i.e., coarse-grained event elements) from unlabeled text data by using an event element extraction model in combination with a similarity measurement method. Specifically, similar contexts similar to the event element contexts in the labeled data set are obtained from the unlabeled text data by similarity measurement, event elements are extracted from the similar contexts by the event element extraction model based on the dual-state Prompt trained by the model iteration module, and new labeled data are generated according to the event elements and the corresponding similar contexts, wherein the similar contexts are the event element contexts in the new labeled data.
[0073] Document-level event element extraction needs to use a model or rules to extract all sentences in the full text, which will result in waste of resources when the text content is large and the elements are sparse. Therefore, quickly locating the element-containing area and narrowing down the exploration space can greatly improve the efficiency. To this end, the data iteration module of the present application adopts a data processing method based on similarity measurement, which finds similar context areas from unlabeled text data by using a small amount of labeled samples and their contexts (context is defined as the current sentence containing event elements, the previous sentence and the next sentence of the current sentence) to reduce the workload of manually searching for event element-containing areas in unlabeled samples and accelerate the data-model-data iteration process.
[0074] The data iteration module includes a similarity measurement submodule and an event element extraction submodule.
[0075] The similarity measurement submodule is specifically configured to: (1) take every 3 consecutive sentences in the unlabeled text data as a similarity calculation unit to obtain a plurality of calculation units; (2) vectorize the event element contexts in the labeled data set and the calculation units in the unlabeled text data to obtain event element context feature vectors and calculation unit feature vectors; (3) calculate the similarity between each calculation unit feature vector and each event element context feature vector in the labeled data set, and the similarity between the vectors is measured by cosine similarity; (4) when the similarity exceeds a preset threshold, the calculation unit is likely to include elements and is a similar context.
[0076] In the similarity measurement submodule, the vectorization process includes two parts: one part uses a pre-trained large language model to encode the event element contexts and the calculation units to obtain semantic features; the other part uses one-hot encoding to obtain dictionary features of the event element contexts and the calculation units. The encoding length is designed according to the characteristics of the field, and the dictionary features are added as prior knowledge to improve the accuracy of similarity calculation.
[0077] The event element extraction sub-module obtains the similar context output by the similarity measurement sub-module, and inputs the similar context into the event element extraction model based on the two-state Prompt trained at the current time, to extract event elements from the similar context.
[0078] In view of the model accuracy, an artificial quality inspection process can also be introduced after the method of the application, to manually check the coarse-grained event elements extracted by the system, so as to reduce the workload of manually searching for the event element region in the unlabeled sample, improve the accuracy of document-level event element extraction in a shorter time and with less labor cost, and on the other hand, add the event elements after manual checking and the corresponding context to the labeled data set of the model iteration module, retrain the model by using the updated labeled data set, and continuously cycle and iterate to optimize the model performance.
[0079] Embodiment 2
[0080] Based on embodiment 1, the present embodiment introduces an event element automatic extraction method, including the following steps:
[0081] Step A, obtaining a labeled data set and unlabeled text data.
[0082] Publicly published financial-related announcements are obtained through a network or other channels, and part of the text is labeled, that is, the positions and contents of different event elements in the text need to be labeled, and the context of the elements also needs to be labeled, to form a labeled data set.
[0083] Step B, based on the event element context in the labeled data set, performing similarity measurement on the unlabeled text data to obtain similar context.
[0084] Step B01, taking every 3 consecutive sentences in the unlabeled text data as a similarity calculation unit to obtain a plurality of calculation units.
[0085] Step B02, vectorizing all event element contexts in the labeled data set and all calculation units in the unlabeled text data to obtain event element context feature vectors and calculation unit feature vectors.
[0086] The specific operation of step B02 is: using a pre-trained large language model to encode the event element context and the calculation unit to obtain semantic-level features; using one-hot encoding to obtain dictionary features of the event element context and the calculation unit, and the encoding length is designed according to the characteristics of the field; combining the semantic-level features and the dictionary features to obtain the event element context feature vectors and the calculation unit feature vectors. In the present application, adding the dictionary features as prior knowledge can improve the accuracy of similarity calculation.
[0087] Step B03, calculate the similarity between each computing unit feature vector and each event element context feature vector by a cosine similarity calculation method.
[0088] Step B04, compare each similarity calculated in step B03 with a preset threshold, when the similarity exceeds the preset threshold, the computing unit corresponding to the computing unit feature vector is a similar context.
[0089] Step C, using an event element extraction model based on a two-state Prompt to extract elements from the similar context, to obtain coarse-grained event elements, and update the labeled data set.
[0090] In step C, the event element extraction model based on the two-state Prompt extracts event elements according to the static Prompt, the dynamic Prompt and the current context text, wherein the current context text is the event element context or the similar context input into the event element extraction model based on the two-state Prompt. The event element extraction model based on the two-state Prompt is iteratively trained according to the labeled data set, and the model parameters are constantly optimized.
[0091] In an embodiment of the present application, the static Prompt includes a plurality of event types and event element templates to be extracted under each event type, which are usually given artificially. The dynamic Prompt is obtained by weighted aggregation of K event vectors.
[0092] The method for obtaining the dynamic Prompt is:
[0093] (1) Aggregating a plurality of event types belonging to the same upper category to obtain K event vectors.
[0094] (2) According to expert knowledge, obtaining the relevance of the current event type and the K event vectors to obtain a first relevance weight.
[0095] (3) Through text semantic analysis, obtaining the similarity between the current context text and the K event vectors to obtain a second relevance weight.
[0096] (4) Weighted aggregation of the K event vectors according to the first relevance weight and the second relevance weight to obtain the current dynamic Prompt.
[0097] In step C, after each event element extraction is completed, a new labeled data can be generated according to the event element, the corresponding similar context and the unlabeled text data, which is used to update the labeled data set. By constantly updating the labeled data set and training the model with the updated labeled data set, the model accuracy can be effectively improved.
[0098] In practical application, the method of the present application can also introduce an artificial verification step to verify the event elements extracted by the model, obtaining more fine-grained labeled data.
[0099] In an embodiment of the present application, the method of the present application is introduced again taking administrative punishment type announcement event elements as an example:
[0100] Step 1: Taking administrative punishment type announcement event elements as an example, the following elements need to be extracted: illegal matters, illegal reasons, and penalty decisions. Collect 1000 administrative punishment type announcements of listed companies published by Shenzhen Stock Exchange and Shanghai Stock Exchange.
[0101] Step 2: Data labeling. Randomly select 50 announcements from Step 1 for labeling, in addition to labeling the position of the elements, also label the context in which the elements are located.
[0102] Step 3: Based on the labeled data in Step 2, train an event element extraction model based on the dual-state Prompt.
[0103] Step 4: Based on the event element context labeled in Step 2, calculate which sentences and element contexts in the 950 unmarked announcements in Step 1 are similar, obtaining the area that may contain event elements, i.e. similar context.
[0104] Step 5: Use the model trained in Step 3 to predict the area that may contain event elements in Step 4, obtaining coarse-grained predicted labeled data, i.e. coarse-grained event elements.
[0105] Step 6: Manually verify the coarse-grained labeled data obtained in Step 5 to obtain labeled data, and add the new labeled data to Step 1. Start a new round of data and model iteration from Step 3 until the model event element extraction f1 value reaches a certain threshold, and stop iteration.
[0106] Compared with the prior art, the system and method of the present application have the following advantages:
[0107] 1. The present application innovatively proposes an event element extraction model based on dual-state Prompt, which can enable the model to perceive event type information and the relationship between events during generation, which can help the model quickly establish the relationship between different event types. It also performs well when there is a lack of labeled data and new event types appear.
[0108] 2. The application innovatively proposes a data processing method based on similarity measurement. The method uses a small amount of labeled samples and their context. On the one hand, it can quickly locate the position of the element, reducing redundant information and improving the efficiency of model processing. On the other hand, it finds similar context areas in unlabeled samples from labeled samples, reducing the workload of manually searching for event element areas in unlabeled samples, and improving the accuracy of document-level event element extraction. Using similarity measurement to process document-level data can improve model processing efficiency, unlabeled data utilization, and assist manual quality inspection.
[0109] The above only describes the preferred embodiments of the present application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the technical principles of the present application. These improvements and modifications should also be considered within the scope of protection of the present application.
Claims
1. An event element automatic extraction system characterized by comprising: The model iteration module and the data iteration module are included. The model iteration module is configured to iteratively train a two-state Prompt-based event element extraction model according to a labeled data set, and to obtain new labeled data generated by a data iteration model and update the labeled data set. The data iteration module is configured to obtain similar contexts similar to event element contexts in the labeled data set from unlabeled text data through similarity measurement, extract event elements from the similar contexts by the two-state Prompt-based event element extraction model trained by the model iteration module, and generate new labeled data according to the event elements and the corresponding similar contexts. The two-state Prompt-based event element extraction model extracts event elements according to a static Prompt, a dynamic Prompt and a current context text, wherein the current context text is an event element context or a similar context input into the two-state Prompt-based event element extraction model. The method for obtaining the dynamic Prompt comprises the following steps: aggregating a plurality of event types belonging to the same upper category to obtain K event vectors; obtaining a first relevance weight according to the relevance between the current event type and the K event vectors according to expert knowledge; obtaining a second relevance weight according to the similarity between the current context text and the K event vectors through text semantic analysis; and weighting and aggregating the K event vectors according to the first relevance weight and the second relevance weight to obtain the current dynamic Prompt.
2. The event element automatic extraction system according to claim 1, characterized by, The static Prompt comprises a plurality of event types and an event element template to be extracted under each event type.
3. The event element automatic extraction system of claim 1, wherein In the data iteration module, the similar contexts similar to the event element contexts in the labeled data set are obtained from the unlabeled text data through similarity measurement, comprising the following steps: each continuous 3 sentences in the unlabeled text data is taken as a similarity calculation unit to obtain a plurality of calculation units; vectorizing all event element contexts in the labeled data set and all calculation units in the unlabeled text data to obtain event element context feature vectors and calculation unit feature vectors; calculating the similarity between each calculation unit feature vector and each event element context feature vector through a similarity measurement algorithm; when the similarity exceeds a preset threshold, the calculation unit corresponding to the calculation unit feature vector is a similar context.
4. The event element automatic extraction system according to claim 3, characterized by, The similarity measurement algorithm adopts cosine similarity.
5. An event element automatic extraction method characterized by comprising: The method comprises the following steps: obtaining a labeled data set and unlabeled text data; performing similarity measurement on the unlabeled text data based on the event element contexts in the labeled data set to obtain similar contexts; extracting event elements from the similar contexts by a two-state Prompt-based event element extraction model to obtain coarse-grained event elements, and updating the labeled data set; The two-state Prompt-based event element extraction model is iteratively trained according to the labeled data set. The two-state Prompt-based event element extraction model adopts a static Prompt and a dynamic Prompt. The static Prompt includes multiple event types and an event element template to be extracted under each event type; The acquisition method of the dynamic Prompt is: Aggregating multiple event types belonging to the same upper category to obtain K event vectors; According to expert knowledge, the relevance between the current event type and the K event vectors is obtained to obtain a first relevance weight; Through text semantic analysis, the similarity between the current context text and the K event vectors is obtained to obtain a second relevance weight; According to the first relevance weight and the second relevance weight, the K event vectors are weighted and aggregated to obtain the current dynamic Prompt.
6. The event element automatic extraction system of claim 5, wherein Based on the event element context in the labeled data set, the similarity of the unlabeled text data is measured to obtain a similar context, including: Taking every 3 consecutive sentences in the unlabeled text data as a calculation unit of similarity to obtain multiple calculation units; Vectorizing all event element contexts in the labeled data set and all calculation units in the unlabeled text data to obtain event element context feature vectors and calculation unit feature vectors; Through a similarity measurement algorithm, the similarity between each calculation unit feature vector and each event element context feature vector is calculated; When the similarity exceeds a preset threshold, the calculation unit feature vector corresponding to the calculation unit is a similar context.
Citation Information
Patent Citations
Method and device for obtaining training data and model training method and device
CN111177373A
Model training method and device, information processing method and device, electronic equipment and medium
CN114417974A