Text extraction model training method, extraction method, device, equipment and medium

By concatenating input text and event templates in the text extraction model, performing encoding and decoding, and training the model based on a loss function, the problem of low efficiency and accuracy in event extraction in existing technologies is solved, and a highly efficient event extraction effect is achieved.

CN116186195BActive Publication Date: 2025-12-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111421531.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-12-30
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

In existing technologies, machine learning-based event extraction methods struggle to achieve good extraction results with limited training data, resulting in low efficiency and accuracy.

Method used

By concatenating the input text from the training set with the event template, the text extraction model is used for encoding and decoding. The predicted extraction results are generated by combining the event template, and the model is trained based on the loss function to improve the efficiency and accuracy of event extraction.

Benefits of technology

It improves the efficiency and accuracy of event extraction, achieves global optimization in event extraction learning, and reduces the dependence on the amount of training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116186195B_ABST
    Figure CN116186195B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text extraction model training method, an extraction method, an apparatus, a device and a medium, which are related to the technical field of artificial intelligence and can be applied to various scenes such as cloud technology, artificial intelligence, intelligent transportation and auxiliary driving. The method comprises the following steps: obtaining a training set, the training set comprising a plurality of input texts and corresponding target extraction results, each input text being spliced according to a sample text and a corresponding event template; using a text extraction model to sequentially encode and decode the training set to obtain a predicted extraction result; the predicted extraction result representing predicted sentence information determined by filling the sample text into the corresponding event template; and performing model training based on the predicted extraction result and the corresponding target extraction result. In this way, the event extraction efficiency and the event extraction effect are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence, and in particular to a text extraction model training method, extraction method, apparatus, device, and medium. Background Technology

[0002] Event extraction is an important component of information extraction. It transforms the rich unstructured text in the objective world into structured event description information, such as event elements including the entities involved, the time of occurrence, and the location of occurrence. It can be applied to fields such as media resource recommendation and public opinion monitoring.

[0003] In related technologies, event extraction methods mainly include machine learning-based methods, which use machine learning models to extract each event element from the text. This not only reduces the efficiency and effectiveness of event extraction, but also makes the extraction accuracy highly dependent on a large amount of labeled data. With less training data, it is not easy to obtain good extraction results. Summary of the Invention

[0004] This disclosure provides a text extraction model training method, extraction method, apparatus, device, and medium to solve at least one technical problem in the prior art.

[0005] On the one hand, this disclosure provides a method for training a text extraction model, including:

[0006] Obtain a training set, which includes multiple training samples. Each training sample includes input text and a corresponding target extraction result. The input text is formed by concatenating the sample text with the corresponding event template.

[0007] The feature extraction module in the text extraction model is used to encode each input text in the training set to obtain multiple encoded feature information.

[0008] The text extraction model uses a decoding module to decode multiple encoded feature information to obtain a prediction extraction result; the prediction extraction result represents the prediction statement information determined by filling the sample text into the corresponding event template.

[0009] Based on the predicted extraction results and the corresponding target extraction results, the first loss is determined;

[0010] The text extraction model is trained based on the first loss to obtain a fully trained text extraction model.

[0011] On the other hand, a text extraction method is also provided, including:

[0012] Obtain the text to be extracted and the event template corresponding to the text;

[0013] The text is concatenated with the corresponding event template to obtain the target text;

[0014] The target text is extracted using a text extraction model to obtain the text extraction result; wherein the text extraction model is trained using any of the text extraction model training methods described above.

[0015] On the other hand, a text extraction model training device is also provided, characterized in that the device includes:

[0016] The first acquisition module is used to acquire a training set, which includes multiple training samples. Each training sample includes input text and a corresponding target extraction result. The input text is formed by concatenating the sample text with the corresponding event template.

[0017] The encoding module is used to encode each input text in the training set using the feature extraction module in the text extraction model to obtain multiple encoded feature information.

[0018] The decoding module is used to decode multiple encoded feature information using the decoding module in the text extraction model to obtain the prediction extraction result; the prediction extraction result includes the prediction statement information determined by filling the sample text into the corresponding event template.

[0019] The first loss determination module is used to determine the first loss based on the predicted extraction result and the corresponding target extraction result;

[0020] The training module is used to train the text extraction model based on the first loss to obtain a trained text extraction model.

[0021] On the other hand, a text extraction device is also provided, the device comprising:

[0022] The second acquisition module is used to acquire the text to be extracted and the event template corresponding to the text;

[0023] The splicing module is used to splice the text with the corresponding event template to obtain the target text;

[0024] The extraction module is used to extract the target text using a text extraction model to obtain the text extraction result; wherein the text extraction model is trained using any of the text extraction model training methods described above.

[0025] On the other hand, an electronic device is also provided, the electronic device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement any of the methods described above.

[0026] On the other hand, a computer-readable storage medium is also provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement any of the methods described above.

[0027] On the other hand, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described above.

[0028] The present disclosure provides a text extraction model training method, extraction method, apparatus, device, and medium, which have the following technical effects:

[0029] This embodiment of the disclosure obtains a training set, which includes multiple training samples. Each training sample includes input text and a corresponding target extraction result. The input text is concatenated from the sample text and the corresponding event template. The feature extraction module in the text extraction model encodes each input text in the training set to obtain multiple encoded feature information. The decoding module in the text extraction model decodes the multiple encoded feature information to obtain a predicted extraction result. The predicted extraction result represents the predicted statement information determined by filling the sample text into the corresponding event template. Based on the predicted extraction result and the corresponding target extraction result, a first loss is determined. The text extraction model is trained based on the first loss to obtain a trained text extraction model. Thus, by encoding the concatenated sample text and event template, and directly generating a predicted statement containing event arguments through the decoding module in the text extraction model, the joint learning and extraction of event papers and roles is combined. This not only improves the efficiency of event extraction but also achieves global optimization in event extraction learning based on the introduction of event templates, thereby improving the event extraction effect and model extraction accuracy. Attached Figure Description

[0030] To more clearly illustrate the technical solutions and advantages in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a schematic diagram of the application environment of a text extraction model training method provided in this embodiment of the disclosure;

[0032] Figure 2 This is a flowchart illustrating a text extraction model training method provided in an embodiment of this disclosure;

[0033] Figure 3 This is a flowchart illustrating a text extraction model training method provided in an embodiment of this disclosure;

[0034] Figure 4 This is a flowchart illustrating a text extraction model training method provided in an embodiment of this disclosure;

[0035] Figure 5 This is a flowchart illustrating a text extraction model training method provided in an embodiment of this disclosure;

[0036] Figure 6 This is a schematic diagram of the structure of a text extraction model provided in an embodiment of this disclosure;

[0037] Figure 7 This is a flowchart illustrating a text extraction method provided in an embodiment of this disclosure;

[0038] Figure 8 This is a structural block diagram of a text extraction model training device provided in an embodiment of this disclosure;

[0039] Figure 9 This is a structural block diagram of a text extraction device provided in an embodiment of this disclosure;

[0040] Figure 10 This is a schematic diagram of the hardware structure of a device for implementing the method provided in the embodiments of this disclosure. Detailed Implementation

[0041] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.

[0042] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0043] To facilitate understanding of the technical solutions described above and their resulting technical effects in the embodiments of this disclosure, the terms used in the embodiments of this disclosure are briefly introduced as follows:

[0044] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0045] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.

[0046] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0047] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0048] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0049] Event trigger words: The core words that indicate the occurrence of an event, mostly verbs or nouns.

[0050] Event arguments: represent the participants in an event, mainly composed of entities, values, and time.

[0051] Event argument roles: The roles that event arguments play in an event, such as attacker, victim, etc.

[0052] Event extraction is an important method for transforming rich, unstructured text from the objective world into structured knowledge. Event extraction refers to parsing natural text describing events to obtain structured event description information, which generally includes event trigger word extraction, event argument extraction, and argument role determination.

[0053] The solutions provided in this application involve artificial intelligence technologies such as machine learning and natural language processing, which are specifically illustrated through the following embodiments.

[0054] The text extraction model training method disclosed herein can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1 As shown, the hardware environment may include at least terminal 10 and server 20.

[0055] Terminal 10 can acquire a training set, which includes multiple training samples. Each training sample includes input text and a corresponding target extraction result. The input text is constructed by concatenating the sample text with a corresponding event template. Server 20 uploads the training set to the server. The server uses the feature extraction module in the text extraction model to encode each input text in the training set to obtain multiple encoded feature information. The server then uses the decoding module in the text extraction model to decode the multiple encoded feature information to obtain a predicted extraction result. The predicted extraction result represents the predicted statement information determined by filling the sample text into the corresponding event template. Based on the predicted extraction result and the corresponding target extraction result, a first loss is determined. The text extraction model is trained based on the first loss to obtain a fully trained text extraction model.

[0056] The aforementioned terminal 10 may be a physical device such as a tablet computer, laptop computer, desktop computer, smartphone, smart speaker, smart wearable device, digital assistant, augmented reality device, virtual reality device, or an application running on a physical device, but is not limited to these.

[0057] The aforementioned server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, smart TV, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, and this disclosure does not impose any restrictions.

[0058] It should be noted that the aforementioned server 20 can be implemented as a cloud server in the cloud. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, available on demand, and is flexible and convenient. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to a backend system for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.

[0059] In some embodiments, the server 20 described above can also be implemented as a node in a blockchain system. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0060] The text extraction method disclosed herein can also be applied to, for example, Figure 1In the application environment shown, the terminal can obtain the text to be extracted and its corresponding event template, and upload the text and event template to the server. The server concatenates the text with the corresponding event template to obtain the target text; it then uses a trained text extraction model to extract the target text and obtain the text extraction result.

[0061] It should be noted that in practical applications, the above-mentioned text extraction model training method or text extraction method can also be implemented in the terminal, or jointly implemented by the terminal and the server.

[0062] Of course, the methods provided in this disclosure are not limited to... Figure 1 The hardware environment shown can also be used in other possible hardware environments, and this disclosure does not limit the scope of the embodiments. Figure 1 The functions that each device in the hardware environment shown can perform will be described in subsequent method embodiments, and will not be elaborated on here.

[0063] Figure 2 This is a flowchart illustrating a text extraction model training method provided in this disclosure. This disclosure provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent a unique execution order. The executing entity of this text extraction model training method can be the text extraction model training device provided in this disclosure, or a server integrating the data processing device, wherein the text extraction model training device can be implemented in hardware or software. Taking the executing entity as described above... Figure 1 Let's take the server in the example of this as an illustration. Figure 2 As shown, the method may include:

[0064] S201: Obtain a training set, which includes multiple training samples. Each training sample includes input text and the corresponding target extraction result. The input text is formed by concatenating the sample text with the corresponding event template.

[0065] The sample text can be semantically meaningful document data used to train the text extraction model, and can include text fragments or articles consisting of several sentences. For example, it includes, but is not limited to, press releases, journal articles, documents, notices, etc. The sample text can be obtained by user input, from a database such as a local or cloud database, or by converting an acquired audio file into text; this disclosure does not specifically limit the method.

[0066] Event templates are used to indicate the event type corresponding to event elements in the text; different event types correspond to different event templates. The event element can include event arguments, argument roles, etc. For example, event types can include, but are not limited to, at least one of the following: traffic accident events, meeting events, commendation events, crime events, and death events. Correspondingly, the corresponding event templates can include templates for traffic accident events, meeting events, commendation events, crime events, and death events, etc.

[0067] Target extraction results are obtained by pre-extracting events from sample text within the input text. These results are associated with event templates in the input text, and the representation of the target extraction results differs depending on the event type.

[0068] Specifically, taking a death event as an example of input text, its corresponding event template can be represented as: <victim>exist <loc>At <time>because <cause>"Death." Among them, <victim>Indicating the victim, <loc>Indicates the location of death. <time>Indicates the time of death. <cause>Indicates the cause of death. Correspondingly, the target extraction result for this input text can be represented as: Died due to drowning in City B on XX date.

[0069] In a specific embodiment, after obtaining the sample text, the sample text can be parsed, and according to the parsing result, the event template corresponding to the sample text can be determined. Then, the sample text and the corresponding event template are subjected to splicing processing at the vector level to obtain multiple input texts. Then, a corresponding training set is constructed through the multiple input texts and the corresponding target extraction results.

[0070] In some alternative embodiments, such as Figure 3 As shown, obtaining the training set may include:

[0071] S301: Obtain multiple sample texts.

[0072] S303: Perform event type analysis on each of the sample texts.

[0073] Optionally, after obtaining multiple sample texts, the server can trigger an event type analysis command. In response to this command, the event type of each sample text is parsed to obtain the event type corresponding to each sample text. For example only, the event type may include, but is not limited to, at least one of the following: traffic accident events, meeting events, commendation events, crime events, and death events.

[0074] Optionally, the event type analysis for each of the sample texts includes:

[0075] S3031: Based on a preset event trigger word library, perform trigger word matching on each sample text to obtain the trigger word corresponding to each sample text;

[0076] S3033: Perform event type analysis on each sample text based on the trigger word corresponding to each sample text.

[0077] Optionally, before matching the sample text, the server can first perform word segmentation on each sample text. Then, it matches each word in each segmented sample text with a preset event trigger word library to detect the trigger word corresponding to each sample text. After detecting the trigger word, each trigger word in the sample text can be represented by, for example, "..." <tgr> "and"< / tgr> Wrap it up with the label "".

[0078] For example, if sample text b includes "On October 8th, driver Xiao C was involved in a multi-vehicle rear-end collision in city E, with no injuries reported," then the identified trigger words could include: <tgr> Little C< / tgr> , <tgr> E City< / tgr> , <tgr> rear-end collision< / tgr> Etc. It should be noted that the tag corresponding to this trigger word is not limited to this. Next, the event type corresponding to the sample text can be determined based on at least one trigger word corresponding to the sample text. For example, through... <tgr> rear-end collision< / tgr> The corresponding trigger words can be used to determine that the event type corresponding to sample text b is a traffic accident. Alternatively, the event type can be determined based on the frequency of trigger words in the sample text; specifically, the event type corresponding to the most frequently occurring trigger word can be taken as the event type corresponding to that sample text.

[0079] S305: Based on the analysis results, determine the event template corresponding to each of the sample texts.

[0080] Optionally, once the event type corresponding to the sample text is determined, the corresponding event template can be determined based on the event type. The event template may include an event argument extraction template.

[0081] As an example only, each sample text may correspond to multiple event types, and correspondingly, multiple event templates. Specifically, the event templates corresponding to multiple event types can be concatenated, and the concatenated event template can be used as the event template for the sample text.

[0082] As another example, when the sample text includes multiple event types, a preset number of target event types can be determined from the multiple event types according to the importance level of the event types, and the event template corresponding to the sample text can be determined according to the target event types.

[0083] S307: Concatenate each sample text with the corresponding event template to obtain the input text.

[0084] Optionally, after obtaining the event template corresponding to the sample text, one can use, for example... <s> and< / s> The delimiter is used to concatenate the sample text with the corresponding event template, and the concatenated sample text is used as the input text.

[0085] S309: Construct a training set based on the input text and the target extraction results corresponding to each input text.

[0086] Optionally, after obtaining multiple input texts, multiple training samples can be determined by combining the target extraction results corresponding to each input text to construct a training set.

[0087] As an example only, each input text in the training set S0 can be represented as: <s>Template n <s>< / s> Document n< / s> , where n is a positive integer.

[0088] S203: The feature extraction module in the text extraction model is used to encode each input text in the training set to obtain multiple encoded feature information.

[0089] The text extraction model can be a pre-trained neural network model (e.g., a pre-trained speech model) or a neural network model with initialized model parameters; this disclosure does not impose any specific limitations on it.

[0090] Optionally, the training set is input into the feature extraction module of the text extraction model, and each input text in the training set is encoded to obtain the encoded feature information corresponding to each input text. This encoded feature information can be the embedded feature representation of the input text.

[0091] S205: The decoding module in the text extraction model is used to decode multiple encoded feature information to obtain a prediction extraction result; the prediction extraction result includes the prediction statement information determined by filling the sample text into the corresponding event template.

[0092] Optionally, the encoded feature information is input into the decoding module of the text extraction model, and the attention feature information of the encoded feature information is calculated using the attention unit in the decoding module. The attention feature information and the encoded feature information are decoded using the decoding unit in the decoding module to extract the event arguments and corresponding roles of the sample text. Then, based on the roles corresponding to the event arguments, each event argument is filled into the corresponding slot position in the corresponding event template to form the predicted statement information, and the predicted statement information is used as the prediction extraction result.

[0093] For example, if sample text b includes "On October 8th, driver Xiao C was involved in a multi-vehicle rear-end collision in city E, with no injuries reported," the corresponding traffic accident event template would be: <driver>exist <loc>At <time>occur <type>"Accident". After the decoding module in the text extraction model decodes the encoded feature information, the event arguments and corresponding roles of the sample text b are extracted, including: (October 8th, occurrence time), (Little C, driver), (City E, occurrence location), and (rear-end collision, accident type). The extracted event arguments and corresponding roles are filled into the accident event template, that is, the predicted statement information obtained after filling can be "<Little C> had a <rear-end collision> accident in <City E> on <October 8th>", so the predicted extraction result corresponding to the sample text b can be "<Little C> had a <rear-end collision> accident in <City E> on <October 8th>".

[0094] It should be noted that if the event arguments corresponding to the extracted sample text are missing, the slot corresponding to the event argument in the event template remains unchanged. For example, if the sample text c includes "3 students in M State organized to swim in the river by themselves and unfortunately drowned", its corresponding traffic accident event template is: " <victim>exist <loc>At <time>because <cause>"Death". Because the time of the event does not exist in the sample text c. <time>"The corresponding event arguments then constitute the predicted extraction results." <time>"The corresponding slot position remains unchanged, meaning the predicted extraction result can be "<student> at <riverside> at..." <time>"Died from drowning."

[0095] S207: Based on the predicted extraction result and the corresponding target extraction result, determine the first loss.

[0096] Optionally, for the sample text c above, the predicted extraction result is "<student> at <riverside> at..." <time>"Died due to <drowning>", and the corresponding target extraction result is "<3 students> in <M State> on <time>"Died from drowning." During training, the difference between the predicted extraction result and the target extraction result based on the output of the decoding module is used as the first loss.

[0097] As an example only, the first loss corresponds to a loss function that can be, but is not limited to, a negative log-likelihood function. To measure this. At this point, the expression for the loss function corresponding to this first loss can be expressed as:

[0098]

[0099] Where, x i It is the output of the decoding module during model training, c i Pθ represents the input to the decoding module, and Pθ represents the probability of the target extraction result output by the decoding module.

[0100] S209: Train the text extraction model based on the first loss to obtain a fully trained text extraction model.

[0101] Optionally, the calculated first loss can be used to train the text extraction model to adjust the model parameters until the training termination condition is met, thus obtaining a fully trained text extraction model.

[0102] The above embodiments encode the concatenated sample text and event template, and directly generate predicted statements containing event arguments through the decoding module in the text extraction model. By combining the joint learning and extraction of event papers and roles, it not only improves the efficiency of event extraction, but also achieves global optimization in event extraction learning based on the introduction of event templates, thereby improving the event extraction effect and the model extraction accuracy.

[0103] In some alternative embodiments, such as Figure 4 and 6 As shown, the feature extraction module includes a data transformation layer and an encoder. The feature extraction module in the text extraction model encodes each input text in the training set to obtain multiple encoded feature information, including:

[0104] S401: The data transformation layer in the text extraction model is used to perform data transformation processing on each input text in the training set to obtain multiple training transformation samples.

[0105] Optionally, the data transformation layer is used to perform data-level perturbation transformations on the input text using transformation techniques to obtain various input variants S1, S2, etc. As an example, this data transformation processing includes, but is not limited to, at least one of the following: sentence order shuffling, word order shuffling, overall word vector masking, and random feature masking.

[0106] Among them, sentence order shuffling (T1) involves shuffling the order of sentences in a certain proportion of the input text, such as swapping the first and fifth sentences. The affected sentences can be kept to a relatively small proportion, such as 5%-15%.

[0107] Word order shuffling (T2): The words in the input text sentence are shuffled. For example, the sentence "3 students in M ​​state organized a swimming trip and unfortunately drowned" will be shuffled by a small proportion of the words to generate "3 students in M ​​state organized a swimming trip and unfortunately drowned".

[0108] Global masking of word vectors (T3): The input of the encoder is usually the numerical vector corresponding to a character or word. For example, if a text has 200 words and each word vector is 128-dimensional, then a certain number of words are randomly zeroed out, such as the 10th word and the 25th word.

[0109] Random feature masking (T4): Similar to the overall masking of word vectors, but only randomly selects some feature dimensions to perform zeroing operations. For example, only the 3rd dimension of the 1st word is zeroed, the 100th dimension of the 5th word is zeroed, and so on.

[0110] In some optional embodiments, the data transformation layer includes a first data transformation sublayer and a second data transformation sublayer. In this case, the step of using the data transformation layer in the text extraction model to perform data transformation processing on each input text in the training set to obtain multiple training transformation samples includes:

[0111] S4011: The first data transformation sublayer in the text extraction model is used to perform a first type of data transformation processing on each input text in the training set to obtain a first transformed sample; the first type of data transformation processing is to transform the character data in the input text except for event trigger words;

[0112] S4013: The second data transformation sub-layer in the text extraction model is used to perform a second type of data transformation on each input text in the training set to obtain a second transformed sample; the second type of data transformation is to transform the word vectors corresponding to the event trigger words in the input text.

[0113] S4015: Based on the first transformation sample and the second transformation sample, obtain multiple training transformation samples.

[0114] Optionally, the data transformation layer of this disclosure includes two data transformation sub-layers. The first data transformation sub-layer is for transformations that do not involve event-triggered words, i.e., general text transformations. Its corresponding transformation methods include at least one of the following: sentence order shuffling (T1), word order shuffling (T2), overall word vector masking (T3), and random feature masking (T4). For example, for non-event-triggered words in the input text, at least one of the four data transformations T1 to T4 can be performed.

[0115] The second data transformation sublayer focuses on the transformation of event trigger words, i.e., event text transformation. Its transformation methods include only the overall word vector masking T3 and the random feature masking T4 mentioned above. Optionally, different data transformation methods can be used for the sample text and the corresponding event template. For example, variant 1 uses T3 transformation on the trigger words in the event template, and variant 2 uses T4 transformation on the trigger words in the sample text.

[0116] As an example only, each input text in the training set S0 is represented as follows: <s>Template n <s>< / s> Document n< / s> After data transformation processing, the following can be obtained: <s>T11-Template n <s>< / s> T12-Document n< / s> , <s>T23-Template n <s>< / s> T24-Document n< / s> , <s>T12-template n <s>< / s> T14-Document n< / s> Multiple training transformation samples are used. T11, T12, and T14 refer to the T1, T2, and T4 transformations corresponding to the first data transformation process. T23 and T24 refer to the T3 and T4 transformations corresponding to the second data transformation process. <s> and< / s> These are the separators that distinguish between templates and documents.

[0117] The above embodiments utilize both ordinary text comparison and event-triggered word comparison for subsequent comparative learning, fully exploring the potential of the text extraction model and reducing the dependence on the amount of samples required.

[0118] S403: The encoder in the text extraction model is used to encode multiple training transformation samples to obtain multiple encoded feature information.

[0119] Optionally, the training transformed samples are input into the encoder of the text extraction model to encode the training transformed samples, thereby obtaining the encoded feature information corresponding to each training transformed sample. This encoded feature information can be the embedded feature representation of the training transformed sample.

[0120] Alternatively, the training transformed samples and the untransformed input text are fed together into the encoder of the text extraction model to encode the training transformed samples and the input text, respectively, to obtain the encoded feature information corresponding to each training transformed sample and the input text. This encoded feature information may include the embedded feature representation of the training transformed sample and the embedded feature representation of the input text respectively.

[0121] In an alternative implementation, such as Figure 5 and 6 As shown, the method further includes:

[0122] S405: Using the auxiliary module in the text extraction model, the pairwise encoded feature information in the multiple encoded feature information is compared and processed to obtain multiple auxiliary processing results.

[0123] The auxiliary processing result represents the similarity between each pair of encoded feature information.

[0124] In one optional implementation, the auxiliary module includes a pooling layer and a comparison layer. The auxiliary module in the text extraction model performs pairwise comparison processing on multiple encoded feature information to obtain multiple auxiliary processing results, including:

[0125] S4051: Using the pooling layer in the text extraction model, pooling is performed on each of the multiple encoded feature information to obtain the corresponding multiple pooled feature information.

[0126] S4053: Using the comparison layer in the text extraction model, the pooling feature information described in pairs is compared and analyzed to obtain multiple auxiliary processing results.

[0127] Optionally, after encoding the training transformed samples, the pooling layer in the text extraction model is used to pool the encoded feature information. For example, for the training transformed samples... <s>T11-Template n <s>< / s> T12-Document n< / s> "The two corresponding feature information can be averaged to obtain the pooling vector corresponding to the training transformed sample, and this pooling vector can be used as the corresponding pooling feature information."

[0128] After obtaining the pooling feature information corresponding to each training transformed sample, the comparison layer in the text extraction model can be used to perform similarity-based comparative analysis on the pairwise pooling feature information to obtain multiple auxiliary processing results. These auxiliary processing results may include, but are not limited to, cosine distance, Euclidean distance, etc. For pooling feature information corresponding to the same document, the corresponding auxiliary processing result is that the two have a high similarity; for example... Figure 6 As shown, for the same document, the auxiliary processing result is minimizing the distance between the two. For pooling feature information corresponding to different documents, the corresponding auxiliary processing result is that the similarity between the two is low; continuing as... Figure 6 As shown, the two auxiliary processing results for different documents are to maximize the distance.

[0129] S407: Based on the results of multiple auxiliary processing steps, determine the second loss.

[0130] As an example only, the loss function corresponding to this second loss can be, but is not limited to, [missing information]. The loss function is used for measurement. In this case, the expression for the loss function corresponding to the second loss can be expressed as:

[0131]

[0132] Here, ri and rj are different representation variants of the pooling layer output, sim represents the cosine similarity function, exp is the exponential function, and t is the temperature coefficient. For two variants from the same input document, the calculated loss is smaller; for two variants from different input documents, the calculated loss is larger.

[0133] Accordingly, training the text extraction model based on the first loss to obtain a trained text extraction model includes:

[0134] S409: Determine the target loss based on the first loss and the second loss;

[0135] S411: Train the text extraction model based on the target loss to obtain a fully trained text extraction model.

[0136] Optionally, after obtaining the first loss and the second loss, mathematical operations can be performed on these two losses to determine the target loss. These mathematical operations include, but are not limited to, addition and weighted summation. Then, the text extraction model is trained based on the target loss until the training termination condition is met, resulting in a fully trained text extraction model.

[0137] The above embodiments, by introducing contrastive learning and using a second loss, aim to enable the model to learn additional labels, thereby increasing the model's robustness to irrelevant interference. Furthermore, it simplifies the modeling and optimization process and enhances generalization ability. In addition, incorporating contrastive learning into model training can further address scenarios with few samples and improve the accuracy of model extraction.

[0138] To demonstrate the performance of the text extraction model trained according to this disclosure, three comparative examples are provided. Comparative example 1 is a classification-based text extraction model, comparative example 2 is a sequence labeling-based text extraction model, and comparative example 3 is a reading comprehension-based text extraction model.

[0139] In the event argument extraction test performance, the F1 score for event argument extraction of comparison file 1 is 59.36, that of comparison file 2 is 64.18, the F1 score of comparison file 3 is 52.3, and the F1 score of comparison file 1 is 67.27. This shows that the text extraction model trained in this disclosure significantly improves the precision and recall of event argument extraction.

[0140] Regarding the training sample size, the sample size required for each pair of comparisons and for achieving a 50% F1 score in this disclosure was statistically analyzed. Specifically, the required sample size for comparison document 1 was 3100, for comparison document 2 it was 2850, for comparison document 1 it was 3550, and for this disclosure it was 2450. This demonstrates that the text extraction model trained by this disclosure reduces its dependence on training data.

[0141] Figure 7 This is a flowchart illustrating a text extraction method provided in an embodiment of this disclosure. This disclosure provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent the only possible execution order. The executing entity of this text extraction method can be the text extraction model training device provided in the embodiments of this disclosure, or a server integrating the data processing device, wherein the text extraction device can be implemented in hardware or software. Taking the executing entity as described above... Figure 1 Let's take the server in the example of this as an illustration. Figure 7 As shown, the method may include:

[0142] S701: Obtain the text to be extracted and the event template corresponding to the text;

[0143] S703: Concatenate the text with the corresponding event template to obtain the target text;

[0144] S705: Use a text extraction model to extract the target text and obtain the text extraction result.

[0145] The text extraction model is trained using any of the text extraction model training methods described above.

[0146] In an optional embodiment, obtaining the event template corresponding to the text includes: matching the text with trigger words based on a preset event trigger word library to obtain the trigger words corresponding to the text; performing event type analysis on the text based on the trigger words corresponding to the text to obtain the target event type; and obtaining the event template corresponding to the target event type.

[0147] It should be noted that the detailed technical details and beneficial effects of the text extraction method provided in the above embodiments can be found in the methods provided in the embodiments of this disclosure, and will not be repeated here.

[0148] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.

[0149] Please refer to Figure 8 This diagram illustrates a structural block diagram of a text extraction model training apparatus provided in an embodiment of this disclosure. The apparatus has the functions described in the method example above; these functions can be implemented in hardware or by hardware executing corresponding software. The text extraction model training apparatus may include:

[0150] The first acquisition module 810 is used to acquire a training set, which includes multiple training samples. Each training sample includes input text and a corresponding target extraction result. The input text is formed by concatenating the sample text with the corresponding event template.

[0151] The encoding module 820 is used to encode each input text in the training set using the feature extraction module in the text extraction model to obtain multiple encoded feature information.

[0152] The decoding module 830 is used to decode multiple encoded feature information using the decoding module in the text extraction model to obtain a prediction extraction result; the prediction extraction result includes the prediction statement information determined by filling the sample text into the corresponding event template.

[0153] The first loss determination module 840 is used to determine the first loss based on the predicted extraction result and the corresponding target extraction result;

[0154] The training module 850 is used to train the text extraction model based on the first loss to obtain a trained text extraction model.

[0155] In an optional embodiment, the feature extraction module includes a data transformation layer and an encoder; the encoding module includes:

[0156] The transformation submodule is used to perform data transformation processing on each input text in the training set using the data transformation layer in the text extraction model to obtain multiple training transformation samples.

[0157] The encoding submodule is used to encode multiple training transformation samples using the encoder in the text extraction model to obtain multiple encoded feature information.

[0158] In an optional embodiment, the data transformation layer includes a first data transformation sublayer and a second data transformation sublayer; the transformation submodule includes:

[0159] The first transformation unit is used to perform a first type of data transformation processing on each input text in the training set using the first data transformation sub-layer in the text extraction model to obtain a first transformation sample; the first type of data transformation processing is to transform the character data in the input text except for event trigger words.

[0160] The second transformation unit is used to perform a second type of data transformation processing on each input text in the training set using the second data transformation sub-layer in the text extraction model to obtain a second transformation sample; the second type of data transformation processing is to transform the word vectors corresponding to the event trigger words in the input text.

[0161] The combination unit is used to obtain multiple training transformation samples based on the first transformation sample and the second transformation sample.

[0162] In an optional embodiment, the apparatus further includes:

[0163] An auxiliary training module is used to compare pairwise encoded feature information among multiple encoded feature information using an auxiliary module in the text extraction model to obtain multiple auxiliary processing results; the auxiliary processing results represent the similarity between pairwise encoded feature information.

[0164] The second loss determination module is used to determine a second loss based on multiple auxiliary processing results;

[0165] Accordingly, the training module includes:

[0166] The total loss determination submodule is used to determine the target loss based on the first loss and the second loss;

[0167] The training submodule is used to train the text extraction model based on the target loss to obtain a trained text extraction model.

[0168] In an optional embodiment, the auxiliary module includes a pooling layer and a contrast layer. The auxiliary training module includes:

[0169] The pooling submodule is used to perform pooling processing on each of the multiple encoded feature information in the text extraction model using the pooling layer to obtain the corresponding multiple pooled feature information.

[0170] The comparison submodule is used to compare and analyze the pooled feature information in pairs using the comparison layer in the text extraction model to obtain multiple auxiliary processing results.

[0171] In an optional embodiment, the first acquisition module includes:

[0172] The `get` submodule is used to retrieve multiple sample texts;

[0173] The analysis submodule is used to perform event type analysis on each of the sample texts;

[0174] The template determination submodule is used to determine the event template corresponding to each sample text based on the analysis results;

[0175] The splicing submodule is used to splice each sample text with the corresponding event template to obtain the input text;

[0176] A submodule is constructed to build a training set based on the input text and the target extraction results corresponding to each input text.

[0177] In an optional embodiment, the analysis submodule includes:

[0178] The matching unit is used to perform trigger word matching on each sample text based on a preset event trigger word library to obtain the trigger word corresponding to each sample text.

[0179] The analysis unit is used to perform event type analysis on each sample text based on the trigger word corresponding to each sample text.

[0180] In an optional embodiment, the decoding module includes:

[0181] The first decoding submodule is used to input multiple encoded feature information into the decoding module of the text extraction model;

[0182] The second decoding submodule is used to calculate the attention feature information of the encoded feature information using the attention unit in the decoding module;

[0183] The third decoding submodule is used to decode the attention feature information and the encoding feature information using the decoding unit in the decoding module to obtain the prediction extraction result.

[0184] The apparatus provided in the above embodiments can execute the corresponding methods in the embodiments of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.

[0185] Please refer to Figure 9 This diagram illustrates a structural block diagram of a text extraction device according to an embodiment of this disclosure. The device implements the functions described in the method example above; these functions can be implemented in hardware or by hardware executing corresponding software. The text extraction device may include:

[0186] The second acquisition module 910 is used to acquire the text to be extracted and the event template corresponding to the text;

[0187] The splicing module 920 is used to splice the text with the corresponding event template to obtain the target text;

[0188] The extraction module 930 is used to extract the target text using a text extraction model to obtain the text extraction result; wherein the text extraction model is trained using any of the above-mentioned text extraction model training methods.

[0189] In an optional embodiment, the second acquisition module includes:

[0190] The analysis submodule is used to perform event type analysis on the text based on the trigger words corresponding to the text, and obtain the target event type;

[0191] The acquisition submodule is used to acquire the event template corresponding to the target event type.

[0192] The apparatus provided in the above embodiments can execute the corresponding methods in the embodiments of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.

[0193] This disclosure provides a computer device that may include a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the text extraction model training method or any of the text extraction methods described in the above method embodiments.

[0194] This disclosure also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded by a processor and executed by any of the text extraction model training methods or any of the text extraction methods described in the above method embodiments.

[0195] This disclosure also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the text extraction model training methods described in the above method embodiments, or any of the text extraction methods described.

[0196] Furthermore, Figure 10 A schematic diagram of a hardware structure for implementing the methods provided in the embodiments of this disclosure is shown. The device may be a computer terminal, a mobile terminal, or other device, and may also participate in or include the apparatus provided in the embodiments of this disclosure. Figure 10 As shown, the computer terminal 11 may include one or more processors 112 (shown as 112a, 112b, ..., 112n in the figure) 112 (processor 112 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 114 for storing data, and a transmission device 116 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 10 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 11 may also include... Figure 10 The more or fewer components shown, or having the same Figure 10 The different configurations shown.

[0197] It should be noted that the aforementioned one or more processors 112 and / or other data processing circuitry are generally referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 11 (or mobile device). As per the embodiments of this disclosure, the data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0198] The memory 114 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in this embodiment. The processor 112 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned neural network processing method. The memory 114 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 114 may further include memory remotely located relative to the processor 112, and these remote memories can be connected to the computer terminal 11 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0199] The transmission device 116 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 11. In one example, the transmission device 116 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 116 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0200] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 11 (or mobile device).

[0201] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.

[0202] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0203] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0204] The above description is only a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.< / time> < / time> < / time> < / time> < / time> < / cause> < / time> < / loc> < / victim> < / type> < / time> < / loc> < / driver> < / cause> < / time> < / loc> < / victim> < / cause> < / time> < / loc> < / victim>

Claims

1. A method for training a text extraction model, characterized in that, The method comprises: obtaining a training set comprising a plurality of training samples, each training sample comprising input text and corresponding target extraction results, the input text being spliced according to sample text and corresponding event templates; encoding each input text in the training set using a feature extraction module in the text extraction model to obtain a plurality of encoded feature information; decoding the plurality of encoded feature information using a decoding module in the text extraction model to obtain a predicted extraction result; the predicted extraction result represents the predicted sentence information determined by filling the sample text into the corresponding event template; determining a first loss based on the predicted extraction result and the corresponding target extraction result; training the text extraction model based on the first loss to obtain a trained text extraction model.

2. The method of claim 1, wherein, The feature extraction module comprises a data transformation layer and an encoder; the encoding of each input text in the training set using the feature extraction module in the text extraction model to obtain a plurality of encoded feature information comprises: performing data transformation processing on each input text in the training set using the data transformation layer in the text extraction model to obtain a plurality of training transformation samples; encoding the plurality of training transformation samples using the encoder in the text extraction model to obtain a plurality of encoded feature information.

3. The method of claim 2, wherein, The data transformation layer comprises a first data transformation sub-layer and a second data transformation sub-layer; the data transformation processing of each input text in the training set using the data transformation layer in the text extraction model to obtain a plurality of training transformation samples comprises: performing first-type data transformation processing on each input text in the training set using the first data transformation sub-layer in the text extraction model to obtain first transformation samples; the first-type data transformation processing is transformation processing on character data in the input text other than event trigger words; performing second-type data transformation processing on each input text in the training set using the second data transformation sub-layer in the text extraction model to obtain second transformation samples; the second-type data transformation processing is transformation processing on word vectors corresponding to event trigger words in the input text; obtaining a plurality of training transformation samples based on the first transformation samples and the second transformation samples.

4. The method according to claim 2 or 3, characterized in that, The method further comprises: comparing two pieces of encoded feature information in the plurality of encoded feature information using an auxiliary module in the text extraction model to obtain a plurality of auxiliary processing results; the auxiliary processing result represents the similarity between the two pieces of encoded feature information; determining a second loss based on the plurality of auxiliary processing results; Correspondingly, the training of the text extraction model based on the first loss to obtain a trained text extraction model comprises: determining a target loss based on the first loss and the second loss; training the text extraction model based on the target loss to obtain a trained text extraction model.

5. The method of claim 4, wherein, The auxiliary module comprises a pooling layer and a comparison layer; the comparison of two pieces of encoded feature information in the plurality of encoded feature information using the auxiliary module in the text extraction model to obtain a plurality of auxiliary processing results comprises: The pooling layer in the text extraction model is used for performing pooling processing on each of the plurality of encoded feature information, and a plurality of pooled feature information is obtained. The contrast layer in the text extraction model is used for performing contrast analysis on each two of the pooled feature information, and a plurality of auxiliary processing results are obtained.

6. The method according to any one of claims 1 to 5, characterized in that, The obtaining of the training set comprises: obtaining a plurality of sample texts; performing event type analysis on each of the sample texts; determining an event template corresponding to each of the sample texts based on the analysis result; splicing each of the sample texts with the corresponding event template to obtain an input text; constructing a training set based on the input text and a target extraction result corresponding to each of the input texts.

7. The method of claim 6, wherein, The event type analysis on each of the sample texts comprises: matching a preset event trigger word library with each of the sample texts to obtain a trigger word corresponding to each of the sample texts; performing event type analysis on each of the sample texts according to the trigger word corresponding to each of the sample texts.

8. The method according to any one of claims 1 to 5, characterized in that, The decoding module in the text extraction model is used for performing decoding processing on the plurality of encoded feature information to obtain a predicted extraction result: inputting the plurality of encoded feature information into the decoding module in the text extraction model; calculating attention feature information of the encoded feature information by using an attention unit in the decoding module; performing decoding processing on the attention feature information and the encoded feature information by using a decoding unit in the decoding module to obtain a predicted extraction result.

9. A method of text extraction, characterized by, It comprises: obtaining a text to be extracted and an event template corresponding to the text; splicing the text with the corresponding event template to obtain a target text; performing extraction processing on the target text by using a text extraction model to obtain a text extraction result; wherein the text extraction model is trained by using the text extraction model training method of any one of claims 1-8.

10. The method of claim 9, wherein, The event template corresponding to the text is obtained by: matching a preset event trigger word library with the text to obtain a trigger word corresponding to the text; performing event type analysis on the text according to the trigger word corresponding to the text to obtain a target event type; obtaining an event template corresponding to the target event type. 11.A text extraction model training apparatus, characterized by comprising: The device comprises: a first obtaining module configured to obtain a training set, wherein the training set comprises a plurality of training samples, and each training sample comprises an input text and a corresponding target extraction result, and the input text is obtained by splicing a sample text and a corresponding event template; an encoding module configured to perform encoding processing on each input text in the training set by using a feature extraction module in a text extraction model to obtain a plurality of encoded feature information; a decoding module configured to perform decoding processing on the plurality of encoded feature information by using a decoding module in the text extraction model to obtain a predicted extraction result, wherein the predicted extraction result comprises predicted sentence information determined by filling the sample text into the corresponding event template; a first loss determining module configured to determine a first loss based on the predicted extraction result and the corresponding target extraction result. The training module is configured to train the text extraction model based on the first loss to obtain a trained text extraction model.

12. A text extraction apparatus characterized by comprising: The device comprises: The second acquisition module is configured to acquire text to be extracted and an event template corresponding to the text. The splicing module is configured to splice the text and the corresponding event template to obtain target text. The extraction module is configured to perform extraction processing on the target text by using a text extraction model to obtain a text extraction result, wherein the text extraction model is trained by using the text extraction model training method in any one of claims 1-8.

13. An electronic device, comprising: The electronic device comprises a processor and a memory, and the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the text extraction model training method in any one of claims 1-8 or the text extraction method in claim 9 or 10.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the text extraction model training method in any one of claims 1-8 or the text extraction method in claim 9 or 10.

15. A computer program product, characterised in that, The computer program product comprises at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the text extraction model training method in any one of claims 1-8 or the text extraction method in claim 9 or 10.

Citation Information

Patent Citations

  • Event argument extraction method and device and electronic equipment

    CN111325020A

  • Event extraction model generation method and device, and text event extraction method and device

    CN112116075A