Information extraction method and device, electronic equipment and computer readable storage medium

By using entity recognition and text segmentation technologies and taking time entities as event extraction triggers, the problem of low accuracy and high cost of existing information extraction methods is solved, and efficient and accurate schedule event extraction is achieved.

CN116796748BActive Publication Date: 2026-07-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2023-06-25
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing information extraction methods suffer from low accuracy and high cost, difficulty in accurately extracting information from multiple schedule events simultaneously, and the potential for error accumulation due to multi-cascaded tasks.

Method used

By performing entity recognition on the text to be extracted, the entity text content and location information of time information are obtained. Based on the time entity as the trigger for event extraction, candidate segment information is extracted, and entity annotation and text segmentation are performed. The model is trained using a pre-trained network and conditional random field, reducing the cost of manual definition.

Benefits of technology

It improves the accuracy of information extraction, reduces labor and time costs, avoids error accumulation, and can accurately extract information from multiple schedule events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116796748B_ABST
    Figure CN116796748B_ABST
Patent Text Reader

Abstract

The present disclosure provides an information extraction method and device, an electronic device and a computer readable storage medium, and relates to the technical field of information. The information extraction method comprises: performing entity recognition on a text to be extracted to obtain entity text content containing time information and position information corresponding to the entity text content; extracting candidate segment information from the text to be extracted based on the entity text content and the position information; performing entity labeling and text segmentation on the candidate segment information to obtain an entity labeling result and a text segmentation result; and extracting event information in the candidate segment information according to the entity labeling result and the text segmentation result. The present disclosure can improve the accuracy of event information extraction and reduce the cost of event information extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information technology, specifically to an information extraction method, an information extraction device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the development of information technology and artificial intelligence, intelligent services that users can perceive are gradually increasing. For example, schedule creation is one of the most frequent needs in users' daily lives. Users often need to extract schedule events from a large amount of information, which has led to the emergence of a large number of information extraction methods.

[0003] Currently, existing information extraction methods suffer from low accuracy and high cost, which to some extent affects the user experience. Summary of the Invention

[0004] The purpose of this disclosure is to provide an information extraction method, an information extraction device, an electronic device, and a computer-readable storage medium, thereby improving the accuracy of information extraction and reducing the cost of the information extraction method to at least a certain extent.

[0005] According to a first aspect of this disclosure, an information extraction method is provided, comprising: performing entity recognition on the text to be extracted to obtain entity text content containing time information and location information corresponding to the entity text content; extracting candidate fragment information from the text to be extracted based on the entity text content and location information; performing entity annotation and text segmentation on the candidate fragment information to obtain entity annotation results and text segmentation results; and extracting event information from the candidate fragment information based on the entity annotation results and text segmentation results.

[0006] According to a second aspect of this disclosure, an information extraction apparatus is provided, comprising: an entity recognition module for performing entity recognition on the text to be extracted to obtain entity text content containing time information and location information corresponding to the entity text content; a first information extraction module for extracting candidate fragment information from the text to be extracted based on the entity text content and location information; an information processing module for performing entity annotation and text segmentation on the candidate fragment information to obtain entity annotation results and text segmentation results; and a second information extraction module for extracting event information from the candidate fragment information based on the entity annotation results and text segmentation results.

[0007] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to implement the above-described method by executing the executable instructions.

[0008] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described above.

[0009] The information extraction method provided in this disclosure has two aspects. First, it performs entity recognition on the text to be extracted to obtain entity text content containing time information and the corresponding location information. Based on the entity text content and location information, candidate segment information is extracted from the text to be extracted. The time entity is used as the trigger for event extraction to extract candidate segment information, which facilitates the subsequent extraction of event information from the candidate segment information. Based on the time entity, the candidate segment information can be accurately extracted. Compared with the traditional multi-cascaded task pipeline method for event extraction, it avoids error accumulation and improves the accuracy of information extraction. Second, based on the time entity, there is no need to manually predefine event types and trigger words in the early stage, which greatly reduces the manual and time costs of extracting event information.

[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0012] Figure 1 The illustration schematically depicts a "smart screen recognition - schedule creation" method in an exemplary embodiment of this disclosure.

[0013] Figure 2 The diagram illustrates the stages involved in an exemplary embodiment of this disclosure.

[0014] Figure 3 The flowchart illustrating an information extraction method in an exemplary embodiment of the present disclosure is shown schematically.

[0015] Figure 4 This illustration schematically shows a result of performing time entity recognition on the text to be extracted in an exemplary embodiment of the present disclosure.

[0016] Figure 5 The flowchart schematically illustrates an implementation of extracting candidate fragment information in an exemplary embodiment of the present disclosure.

[0017] Figure 6 The flowchart illustrates an implementation method for extracting event information from candidate fragment information in an exemplary embodiment of the present disclosure.

[0018] Figure 7The flowchart illustrating an exemplary embodiment of the present disclosure is shown.

[0019] Figure 8 This diagram illustrates a setting of a flag bit in an exemplary embodiment of the present disclosure.

[0020] Figure 9 The illustration shows a schematic diagram of a model to be trained in an exemplary embodiment of the present disclosure.

[0021] Figure 10 The schematic diagram illustrates the encoding structure of a pre-trained network in an exemplary embodiment of the present disclosure.

[0022] Figure 11 The diagram illustrates an attention network in an exemplary embodiment of the present disclosure.

[0023] Figure 12 The flowchart illustrating an exemplary embodiment of the present disclosure is shown.

[0024] Figure 13 The diagram illustrates an information extraction method according to an exemplary embodiment of the present disclosure.

[0025] Figure 14 A schematic diagram of the composition of an information extraction apparatus that can be applied to exemplary embodiments of the present disclosure is shown.

[0026] Figure 15 A schematic diagram of the composition of an electronic device to which the exemplary embodiments of the present disclosure may be applied is shown. Detailed Implementation

[0027] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0028] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0029] With the continuous development of artificial intelligence, end users are increasingly perceptible to AI (Artificial Intelligence) technologies. For example, schedule creation is one of the high-frequency needs in end users' daily lives; for instance, among the 15 million daily requests for smart screen recognition, schedule requests account for approximately 7.5%. Figure 1 The illustration shows a schematic diagram of an exemplary embodiment of the present disclosure, namely "Smart Screen Recognition - Schedule Creation," which allows for the quick extraction of schedule event information from a text file for easy viewing by the user. Similar examples include "Smart SMS."

[0030] In related technologies, event extraction schemes typically include four tasks: trigger word detection, event type detection, event argument extraction, and argument role recognition. Trigger word detection: Trigger words are crucial information in event extraction; they are words appearing in the event-related text that most clearly express the occurrence of the event, usually verbs or nouns. For example, in the sentence "20 years ago, in the spring, he was born," "born" is the event trigger word in the event-related text. Event type detection: This involves determining the event type through classification or other methods. Due to the criticality of trigger words in events, they can also be considered as trigger word type detection. The event type depends on the design of the event pattern or the event graph. For example, in a certain event pattern, events triggered by words like "bite" or "kill" are defined as "harm" type events. Event argument extraction: Event arguments refer to the participants in an event, comprising data such as entities, time, values, and text. For example, in "Zhang San was successfully promoted in 2022," "Zhang San" and "2022" are both event arguments for the "promotion" event. Argument role identification: Based on the definition of event patterns or event graphs, extracted event arguments are classified according to their specific roles in the event. For example, in a certain "police event graph", "Zhang San", "Li Si", etc., are all "perpetrators" in their corresponding criminal records.

[0031] However, the above solutions have the following drawbacks: 1) There are multi-level cascading errors: Since the above four cascading tasks are included, the event extraction is carried out in a pipeline manner, which can easily lead to the accumulation of errors; 2) High labor costs: Most of the above solutions require manual pre-definition or manual mining of event types and corresponding event trigger words, which is time-consuming and labor-intensive.

[0032] In addition, if multiple schedule events appear in a text, the existing information extraction methods cannot accurately extract information about multiple schedule events at the same time.

[0033] Based on one or more of the above-mentioned problems, this disclosure provides an information extraction scheme. Figure 2The diagram illustrates the stages involved in the information extraction scheme of this disclosure embodiment, as shown below. Figure 2 As shown, the technical solution of this disclosure includes a model training stage and a model application stage.

[0034] In this embodiment, the provided model training method can be executed by a terminal device. During the model training phase, the terminal device acquires text data, which is text data after entity annotation and segmentation annotation. The text data is input into the pre-trained network in the model to be trained to obtain text vector features. Based on the text vector features, entity annotation is performed using the annotation network in the model to be trained, and a first loss information is determined based on the obtained entity annotation results and text data. Based on the text vector features, text segmentation is performed using the text segmentation network in the model to be trained, and a second loss information is determined based on the obtained text segmentation results and text data. The parameters in the model to be trained are adjusted by combining the first loss information and the second loss information to obtain the target model.

[0035] The model application phase can also be executed on the terminal device. During this phase, the terminal device can perform entity recognition on the text to be extracted, obtaining entity text content containing time information and the corresponding location information. Based on the entity text content and location information, candidate segment information is extracted from the text to be extracted. Entity annotation and text segmentation are performed on the candidate segment information to obtain entity annotation results and text segmentation results. Event information is extracted from the candidate segment information based on the entity annotation results and text segmentation results. In the case where all steps involved in the information extraction scheme provided in this embodiment can be executed by the terminal device, all steps can be executed by the terminal device processor.

[0036] The terminal device can be an intelligent device with information processing capabilities, such as a smartphone, computer, tablet computer, in-vehicle device, wearable device, monitoring device, etc. The terminal device can also be referred to as a mobile terminal, terminal, mobile device, etc. This disclosure does not limit the type of terminal device.

[0037] Furthermore, the technical solutions provided in the embodiments of this disclosure can also be executed by a server. Correspondingly, in this server-executed manner, the server can respond to a triggering command to begin executing the steps in the technical solutions of the embodiments of this disclosure. This triggering command can be sent by a user-used terminal device, or it can be triggered locally by the server in response to some automated event. The server can be a backend system providing the relevant services in the embodiments of this disclosure, and may include a single electronic device with computing capabilities, such as a portable computer, desktop computer, or smartphone, or a cluster of multiple electronic devices.

[0038] Furthermore, the technical solutions of this disclosure can also be executed collaboratively by a terminal device and a server. In this method of collaborative execution by an electronic device and a server, some steps in the technical solutions provided by this disclosure are executed by the terminal device, while other steps are executed by the server. For example, the technical solutions provided by this disclosure can have the server perform the model training phase and send the trained target model to the terminal device, whereby the terminal device performs the model application phase, i.e., event extraction.

[0039] It should be noted that in this method where the terminal device and the server work together, the steps executed by the terminal device and the server can be dynamically adjusted according to the actual situation, and no special restrictions are imposed on this.

[0040] In this embodiment of the disclosure, the technical solution is described as being executed by a terminal device.

[0041] Figure 3 A flowchart of an information extraction method according to an exemplary embodiment of the present disclosure is shown, such as... Figure 3 The information extraction method of this disclosure embodiment may include steps S310 to S340:

[0042] In step S310, entity recognition is performed on the text to be extracted to obtain the entity text content containing time information and the location information corresponding to the entity text content.

[0043] In the exemplary embodiments of this disclosure, entity text content containing time information refers to text content that includes time entities used to indicate time, such as "Date", "9 o'clock", "June 15, 2023 AM", etc., and is not listed one by one. The position information corresponding to the entity text content refers to the corresponding position of the time entity in the text to be extracted, such as "starting position + entity length (number of characters)".

[0044] See Figure 4, which illustrates a schematic diagram of the result of performing time entity recognition on the text to be extracted according to an exemplary embodiment of this disclosure. Figure 4 The system identifies two time entities from the model to be extracted, such as "Date," indicating that the date in the extraction request query is "tomorrow" (which can be inferred as 2023 / 04 / 27 based on the current date 2023 / 04 / 26). "Offset" indicates that the starting position of "tomorrow" in the original text is "0" (i.e., the 0th character), and "length" is "2," indicating that the entity has 2 characters. In other words, entity recognition of the text to be extracted yields entity text content containing time information.

[0045] It should be noted that the embodiments of this disclosure can recognize the text to be extracted using a time entity recognition model, such as a time entity recognition model trained by the CRF (conditional random field) algorithm, and can be compressed. The embodiments of this disclosure do not impose any special limitations on this.

[0046] For example, training data can be acquired and preprocessed, then CRF model standard training can be performed based on the preprocessed training data, and the resulting model can be statically compressed to obtain a time entity recognition model.

[0047] Specifically, the feature weight coefficients of the target feature set in the trained entity recognition model can be obtained first. This target feature set includes text features extracted by multiple entity recognition models. The trained entity recognition model refers to a neural network model trained on multiple samples to obtain an entity recognition model that meets the requirements. This entity recognition model includes feature functions generated based on multiple training samples and text features extracted by multiple information extraction models. Then, according to the feature weight system of each text feature, the target feature set is compressed successively according to a preset ratio. Each time, a preset ratio of weaker features is deleted, and the remaining features are used for further training. Finally, a standard test set is used to confirm the model evaluation index of the entity recognition model after each compression. When it reaches a preset threshold, the feature set corresponding to the entity recognition model after this compression is taken as the optimal feature set and used as the feature set in the compressed entity recognition model, thus achieving model compression and obtaining the time entity recognition model of this embodiment.

[0048] It should be noted that other model compression methods or model training methods can also be used to obtain the time entity recognition model in the embodiments of this disclosure, and no special limitation is made in this regard.

[0049] In step S320, candidate fragment information is extracted from the text to be extracted based on the entity text content and location information.

[0050] In an exemplary embodiment of this disclosure, the text to be extracted may include one or more candidate text fragments. Each candidate text fragment may include one event information (i.e., a schedule event) or multiple event information. Therefore, event information will continue to be extracted from the candidate text fragments in subsequent steps. Event information refers to information content used to fully describe a schedule event, such as "Tomorrow morning at 9:00, music sensory integration class" or "June 25th, summer camp activity," etc.

[0051] This embodiment of the disclosure extracts candidate fragment information from the text to be extracted by using time entities and their corresponding locations. Considering the time correlation of schedule events, it accurately locates the text fragments where the schedule events are located, narrows the scope of information extraction, and can improve the accuracy of extracting event information to a certain extent.

[0052] In step S330, entity annotation and text segmentation are performed on the candidate fragment information to obtain entity annotation results and text segmentation results.

[0053] In an exemplary embodiment of this disclosure, text segmentation is performed on the candidate fragment information to obtain the probability that each sentence in the candidate fragment information is the first sentence of the text fragment. Based on the probability that each sentence is the first sentence of the text fragment, the segmented fragments in the candidate fragment information are determined. Each segmented fragment can be understood as a text fragment containing information content that fully describes a schedule event.

[0054] The embodiments disclosed herein employ a trained target model to simultaneously perform entity annotation and text segmentation on candidate fragment information, thereby reducing the inference memory occupied by edge deployment and also reducing the storage space waste caused during the model training phase.

[0055] In step S340, event information is extracted from candidate fragment information based on entity annotation results and text segmentation results.

[0056] In an exemplary embodiment of this disclosure, considering that there may be different text contents of schedule events in the candidate fragment information, in order to accurately obtain the actual schedule fragment information, after obtaining the entity annotation results and text segmentation results, the event information can be further extracted from the candidate fragment information based on the entity annotation results and text segmentation results.

[0057] The following provides a detailed explanation of each of the above steps.

[0058] In one exemplary embodiment, an implementation method for extracting candidate fragment information is provided. For example... Figure 5 As shown, extracting candidate fragment information from the text to be extracted based on entity text content and location information may include steps S510 to S530:

[0059] In step S510, the central sentence containing the entity text content in the text to be extracted is obtained based on the location information.

[0060] After obtaining the content of each entity text containing time information and the corresponding location information of each entity text in the text to be extracted, the central sentence containing the entity text content can be determined based on the location information of each entity text content. This central sentence will serve as the core of event extraction.

[0061] For example, such as Figure 4The central sentence containing "tomorrow morning at 9:00" is "There is a music sensory integration class for your child tomorrow morning at 9:00. Remember to bring your child to class on time!"

[0062] It should be noted that before obtaining the central sentence containing the entity text content in the text to be extracted based on the location information, the text to be extracted needs to be segmented into sentences. That is, the text to be extracted can be segmented into sentences according to punctuation marks such as periods, exclamation marks, and question marks. Subsequent processes are all carried out in the text to be extracted after the sentences have been segmented.

[0063] In step S520, based on the central sentence and position information, the m sentences before the central sentence and the n sentences after the central sentence are obtained, where m and n are positive integers.

[0064] After determining the central sentence, based on the positional information corresponding to the central sentence and the entity text content, m sentences preceding the central sentence and n sentences between the central sentence and the central sentence can be extracted from the text to be extracted. The specific values ​​of m and n can be set according to the actual situation and are not subject to special limitations.

[0065] Step S530: Concatenate the central sentence, m sentences, and n sentences to obtain candidate segment information.

[0066] In this embodiment, the central sentence, m sentences, and n sentences are concatenated according to the text order corresponding to the text to be extracted to obtain candidate segment information. That is, the concatenated candidate segment information is text including m+n+1 sentences.

[0067] This embodiment of the disclosure performs entity recognition on the text to be extracted, obtaining entity text content containing time information and the corresponding location information of the entity text content. Based on the entity text content and location information, candidate segment information is extracted from the text to be extracted. The time entity is used as the trigger for event extraction, and the candidate segment information is extracted from the text to be extracted, which facilitates the subsequent extraction of event information from the candidate segment information. Based on the time entity, the candidate segment information can be accurately extracted. Compared with the traditional multiple cascaded tasks that perform event extraction in a pipeline manner, this avoids error accumulation and improves the accuracy of information extraction.

[0068] In one exemplary embodiment, an implementation method for extracting event information from candidate fragment information is also provided. For example... Figure 6 As shown, extracting event information from candidate fragment information based on entity annotation results and text segmentation results may include steps S610 and S620:

[0069] Step S610: Determine the target segment corresponding to the central sentence based on probability.

[0070] Here, probability refers to the probability that each sentence in the candidate segment information included in the text segmentation result is the first sentence of the segmented segment. After determining the probability corresponding to each sentence, the target segment corresponding to the central sentence can be determined based on the probability.

[0071] For example, if the probability mentioned above is greater than a set threshold, the corresponding sentence is determined to be the first sentence of the text segment; otherwise, the corresponding sentence is not the first sentence of the text segment. Based on this, the candidate segment information can be divided into multiple segmentation segments, and each segmentation segment does not contain two or more sentences with a probability greater than the set threshold. Then, the target segmentation segment containing the central sentence can be determined from the multiple segmentation segments.

[0072] In step S620, the entity annotation results belonging to the target segment are determined as event information.

[0073] After determining the target segment containing the central sentence, the entity annotation results in that target segment are identified as an event information.

[0074] By combining steps S610 and S620, entity annotation results belonging to the same segment can be extracted as a set of event information based on the probability that each sentence in the candidate segment information is the first sentence of the segment. Even if there are multiple schedule events in the text to be extracted, multiple sets of event information can be accurately extracted based on the sequential position of consecutive sentences and the probability of the first sentence of the segment.

[0075] In one exemplary embodiment, entity annotation and text segmentation are performed on candidate fragment information based on a pre-trained target model, yielding entity annotation results and text segmentation results. The target model is a jointly trained model for entity recognition and text segmentation. Figure 7 A flowchart illustrating an embodiment of obtaining a target model according to this disclosure is shown below, in conjunction with... Figure 7 The process of obtaining the target model is explained.

[0076] Step S710: Obtain text data.

[0077] The text data consists of text data after entity annotation and segmentation annotation. Segmentation annotation refers to dividing the text data into sentences, such as by periods, exclamation marks, and question marks, and adding a flag at the beginning of each sentence. This flag is used to determine whether the current sentence can be the first sentence of a new segmented text. For example... Figure 8 The [CLS] added at the beginning of each sentence L0, L1, ..., Ln is shown.

[0078] In step S720, the text data is input into the pre-trained network of the model to be trained to obtain text vector features.

[0079] like Figure 9As shown, the model to be trained is a joint model, including a pre-trained network, an annotation network, and a text segmentation network. The pre-trained network includes an encoding structure, which comprises an input layer, a dynamic convolutional attention layer, and a feedforward neural network layer. The dynamic convolutional attention layer includes parallel attention networks and dynamic convolutional networks, as shown below. Figure 10 As shown.

[0080] See also Figure 10 The basic structure of the pre-trained network in this embodiment is similar to that of BERT[3], that is, it belongs to the Encoder part of the Transformer structure. It is worth noting that the encoding structure of this embodiment differs from that of BERT[3] in that part of the attention network is replaced with a dynamic convolutional network, and the replaced dynamic convolutional network runs in parallel with the unreplaced attention network.

[0081] The replaced portion of the attention network and the unreplaced attention network can be combined in any proportion according to actual needs; that is, there is no special restriction on the proportion of the replaced portion of the attention network.

[0082] like Figure 10 As shown, based on this encoding structure, the Encoder layer is reduced to 4 layers, the vocabulary can be reduced to 21128, the hidden layer vector dimension is 256, and the word vector dimension is 128. Compared with the 12-layer Encoder of BERT-base, which includes 110M parameters, the pre-trained network of this embodiment only contains 3.7M parameters, reducing the number of parameters to 3% of the original, which is more conducive to the deployment of the model on the edge.

[0083] It should be noted that before inputting text data into the pre-trained network of the model to be trained to obtain text vector features, the text data is usually pre-processed, including but not limited to unifying the messy data format, such as deleting emojis or garbled characters, converting them to lowercase letters, deleting spaces, and converting newline characters to text "\n". Of course, other pre-processing operations can also be performed in the embodiments of this disclosure, and no special restrictions are placed on them.

[0084] In addition, the preprocessed text data needs to be matched with the vocabulary corresponding to the pre-trained network to be converted into token_id and corresponding word vectors, and cls_id (i.e., the corresponding position of each CLS in token_id) needs to be recorded for subsequent prediction of whether it is the first sentence segmentation point.

[0085] The following combination Figure 10 The process of obtaining text vector features using a pre-trained network is explained.

[0086] First, the embedded representation of the text data is determined based on the input layer.

[0087] Similar to BERT, the tokens in the sentence are converted into embeddings based on the input layer, including Token Embeddings, Segment Embeddings and Position Embeddings. This embodiment will not be described in detail here.

[0088] Secondly, the first result is obtained by using an attention network to process the features of the embedded representation.

[0089] The structure of the attention network in this embodiment can be found in [reference]. Figure 11 As shown, the corresponding result x = x1, x2, ..., xn is the input sequence, represented by embeddings, where each xi is a vector of dimension d. A linear transformation maps each vector to three different vectors: a lookup vector qi, a key vector ki, and a value vector vi: qi = w q x i ki = w k x i vi = w v x i .

[0090] Among them, W q W k , This is a learnable weight matrix. Based on this, the response representation of the query vector can be obtained through the following formula (1):

[0091]

[0092] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively, and a softmax operation is performed on each row through a softmax layer, √d k This is the scaling factor.

[0093] It should be noted that the processing flow of the attention network in this embodiment can be consistent with the corresponding attention network in BERT[3], and will not be described in detail here.

[0094] Furthermore, a second result is obtained by extracting features from the embedded representation using a dynamic convolutional network.

[0095] Dynamic convolution adds a dynamic convolution kernel based on the current token to the lightweight convolution. See also... Figure 10 The structure of the dynamic convolutional network shown includes a first linear layer, gated linear units, a dynamic convolutional layer, and a second linear layer.

[0096] The following combination Figure 10 The structure of the dynamic convolutional network shown is used to explain how to extract features from the embedded representation using the dynamic convolutional network to obtain the second result.

[0097] First, the embedded representation (such as a vector of dimension max_len*d) is taken as input and mapped to a first vector through the first linear layer, that is, mapped to a vector of dimension max_len*2d.

[0098] Secondly, the second vector is obtained by processing the first vector using a gated linear unit, that is, the vector of max_len*d is obtained through the gated linear unit. It can be calculated using the following formula (2):

[0099]

[0100] Among them, h l (X) is the second vector, X is the first vector, and W, b, V, and c are the learning parameters. For element-wise multiplication, σ is the sigmoid function.

[0101] Finally, based on the second vector, feature information is extracted using a dynamic convolutional layer, and the feature information is processed through a second linear layer to obtain the second result.

[0102] Traditional convolution operations share weights through convolution channels of the same color. However, the dynamic convolution of this embodiment features a time-varying kernel. This kernel uses a function f to map a vector from d dimensions to H*k dimensions through a second linear layer before performing a lightweight convolution operation. Here, H is the number of convolution channels, and k is the width of the convolution kernel.

[0103] Specifically, the second result can be obtained through the following formulas (3) and (4) in embodiment f of this disclosure:

[0104] DynamicConv(X,i,c)=LightConv(X,f(X i ) h ,:i,c) (3)

[0105]

[0106] Among them, X i,c For the input feature information, The learning weights are defined by the function f through a linear unit with learnable weights when the present invention is processed by a dynamic convolutional layer, i.e., formula (4).

[0107] Finally, the first and second results are fused and input into a feedforward neural network to obtain text vector features.

[0108] After obtaining the first and second results, the first and second results can be concatenated, and the concatenated result can be input into the feedforward neural network to obtain text vector features.

[0109] This embodiment of the disclosure improves the accuracy of the second result by replacing part of the attention network with a dynamic convolutional network, which extracts feature information at more scales.

[0110] In step S730, entity annotation is performed using the annotation network in the model to be trained based on text vector features, and the first loss information is determined based on the obtained entity annotation results and text data.

[0111] The annotation network consists of a third linear layer and a conditional random field layer. Based on text vector features, entity annotation using the annotation network in the model to be trained includes:

[0112] First, the text vector features are input into the third linear layer to obtain the label vector; then, entity recognition is performed on the label vector through the conditional random field layer to obtain the entity annotation result.

[0113] After passing through the third linear layer, the label vectors at each position are obtained. These label vectors are then used as occurrence scores and fed into the conditional random field to obtain the globally optimal entity labeling result.

[0114] The first loss information can be determined based on the obtained entity annotation results and text data using the following formula (5):

[0115]

[0116] Where loss is the first loss information, S real S represents the annotation results (real labels) corresponding to the text data. j This refers to the entity annotation results output by the Conditional Random Field.

[0117] Specifically, Conditional Random Fields (CRFs) can model in a global way, selecting the optimal path (i.e., the path with the highest score) among all possible paths. If the input is x = [x0, x1, x2, xn] (where x is the emission score corresponding to the text string, and each word xi corresponds to an emission score vector, i.e., the label vector mentioned above, whose dimension is the number of labels), the desired decoding result is the corresponding label sequence y = [y0, y1, y2, ..., yn], formalized as the following formula (6):

[0118] P(y|x)=P(y0,y1,...,y n |x0,x1,...,x n (6)

[0119] Furthermore, assuming the number of tags is k and the text length is n, there will obviously be N = kn paths. If Si represents the score of the i-th path, then the probability of the tag sequence appearing is as follows:

[0120]

[0121] The numerator is the fraction of the i-th path, and the denominator is the fraction of all paths.

[0122] If the score corresponding to the sequence decoded by CRF is S real The probability of its occurrence is as follows:

[0123]

[0124] Based on the above derivation process, the present embodiment can adjust formula (5) as follows:

[0125]

[0126] Furthermore, after adjusting formula (5) to the logarithmic space, it becomes:

[0127]

[0128] Where S1, S2, ..., S N The score for each path.

[0129] In step S740, text segmentation is performed using the text segmentation network in the model to be trained based on text vector features, and the second loss information is determined based on the obtained text segmentation results and text data.

[0130] The text segmentation network in this embodiment can be a classifier (Segmentation) including linear layers, or the text segmentation network can also be a CNN, RNN, BiLSTM or other structures, without any special limitation.

[0131] The text data includes multiple sentences segmented by punctuation. The text vector features are processed by a text segmentation network to obtain the text segmentation result. This result includes the text segmentation probability for each sentence. The text segmentation probability indicates the probability that a corresponding sentence is the first sentence of a segmented text.

[0132] Based on this, the second loss information is determined according to the obtained text segmentation results and text data, including:

[0133] First, for each sentence, sub-loss information is determined based on the text segmentation probability and the segmentation annotation content corresponding to the text data; then, the second loss information is determined by combining the sub-loss information corresponding to each sentence.

[0134] Specifically, the second loss information for text segmentation is obtained using a combination of "Sigmoid + cross-entropy". Since the text segmentation in this embodiment is binary (i.e., whether it is the first sentence of the segmented segment), the sub-loss information can be obtained using the following formula:

[0135]

[0136] Loss represents the sub-loss information. σ represents the segmentation annotation content (real label) corresponding to the text data, z represents the text segmentation result, and σ represents the sigmoid function.

[0137] The sub-loss information corresponding to each sentence (i.e., corresponding to cls_id) obtained by formula (11) is accumulated to obtain the second loss information.

[0138] It should be noted that the text segmentation network in this embodiment can also determine whether a text segment containing time (candidate text segment) is a schedule segment. For example, "The XX meeting was held last Friday at the Great Hall of the People" is a factual description, not a schedule.

[0139] Step S750: Combine the first loss information and the second loss information to adjust the parameters in the model to be trained to obtain the target model.

[0140] The embodiments disclosed herein can fuse first loss information and second loss information based on preset hyperparameters, so as to adjust the parameters in the model to be trained according to the obtained target loss information.

[0141] In this embodiment of the disclosure, the evaluation function during the training process of the model to be trained uses the model evaluation metric (F1 score). Specifically, the formula for the F1 score of each label is as follows:

[0142]

[0143] Precision is the proportion of samples where both the predicted and actual values ​​are 1 out of all samples where the predicted value is 1. Recall, also called recall, is the proportion of samples where both the predicted and actual values ​​are 1 out of all samples where the actual value is 1.

[0144] When evaluating a model, higher accuracy and recall result in a higher F1 score, which indicates a more accurate model.

[0145] Figure 12 A flowchart of a model training method according to an exemplary embodiment of the present disclosure is shown below, in conjunction with... Figure 12 The model training method of the present disclosure embodiments will be described.

[0146] S1211: Perform entity labeling and segmentation labeling on the data.

[0147] S1212: In one training cycle, all data in the training set are traversed, and the data is vectorized as input to the pre-trained network. The Transformer has 4 layers.

[0148] S1213: Take the hidden state (text vector features) of the last layer output of the pre-trained network, and obtain the label vectors at each position after passing through the third linear layer of the labeling network. These label vectors will be used as emission scores and fed into the CRF layer to obtain the globally optimal entity label sequence, and calculate the CRF loss (first loss information).

[0149] Meanwhile, the hidden state output from the last layer passes through another linear layer of the text segmentation network to obtain the text segmentation probability at each position corresponding to cls_id, and compares it with the labeled data to calculate the segmentation and classification loss (second loss information).

[0150] At this point, the parameters of the entire network are updated based on the first and second loss information.

[0151] S1214: Repeat S1212-S1213 over multiple training epochs until the loss function fully converges. Save the network model structure and parameters.

[0152] S1215: During prediction and inference, the vectorized text is fed into the network to obtain the entity label sequence and segmentation probability.

[0153] S1216: Based on the distribution, extract labeled data as training and testing sets according to the distribution ratio, and finally compare the accuracy of the models to determine the target model.

[0154] In one exemplary embodiment, before inputting text data into the pre-trained network of the model to be trained to obtain text vector features, the network to be trained needs to be trained to obtain a pre-trained network.

[0155] In the process of training the pre-trained network, unlike the training process of BERT[3], this embodiment replaces the NSP (Next Sentence Prediction) pre-training task with the SOP (Sentence Order Prediction) pre-training task.

[0156] Specifically, since this embodiment of the disclosure is sensitive to the sequential position of consecutive sentences, the network to be trained is trained based on the sentence order prediction task SOP, including:

[0157] First, the text data is divided into multiple sentence blocks based on the segmentation and annotation results corresponding to the text data; the target position is determined from each sentence block, and the text data is switched according to the target position to obtain two sub-text data; the order of the two sub-text data is adjusted, and the resulting negative samples are used for training.

[0158] For example, after segmenting the text data into sentences, multiple sentence blocks of preset length are constructed from the starting position of each sentence (e.g., 10 sentence blocks are obtained if 10 sentences are obtained). A position is randomly selected from each sentence block, and the sentence is split into two parts based on that position, with a 50% probability of swapping the order of the sentences. Table 1 shows the comparison results before and after using the SOP pre-training task. Using the SOP pre-training task improves both the F1 score and the relevance accuracy of named entity recognition.

[0159] Table 1

[0160] Pre-training using SOP 0.9326 0.632 Pre-training does not use SOP 0.9267 0.9619

[0161] Furthermore, in the training task of the pre-trained network, BERT's NSP task, SSO task (Sentence Structural Objective), etc. can also be used simultaneously. The above-mentioned pre-training tasks can be selected according to actual needs, and the order of each pre-training task and masking task in the embodiments of this disclosure can also be adjusted according to actual needs, and no special limitation is made in this regard.

[0162] In an exemplary embodiment, when training the network to be trained to obtain a pre-trained network, an entity mask can be used, that is, common entities such as time, address, and name are pre-trained using a whole word mask.

[0163] For example, if the original text is: Xiaoming uses a language model to predict the probability of the next word, the original BERT mask is: Xiaoming uses language [MASK] type to [MASK] predict the probability of the next word; the full word mask is: Xiaoming uses language [MASK][MASK] to [MASK][MASK] the probability of the next word; the entity mask is: [MASK][MASK] use language model to predict the probability of the next word.

[0164] Table 2 below shows the results comparison of downstream entity recognition tasks based on three masking methods: It can be seen that the entity masking method used in the embodiments of this disclosure can improve the accuracy of entity recognition tasks.

[0165] Table 2

[0166] BERT mask 0.8542 0.8275 0.8406 Entity mask 0.8946 0.8968 0.8957 Full word mask 0.8894 0.8894 0.8894

[0167] Of course, other masking methods or combinations of the various masking strategies described above can also be used in the embodiments of this disclosure. The embodiments of this disclosure include, but are not limited to, the masking methods described above.

[0168] In an exemplary embodiment, when training the network to be trained to obtain a pre-trained network, rotational relative position encoding can be used. When calculating the attention score based on the attention network, the relative position between two tokens can be directly considered, that is, relative position encoding is achieved by absolute position encoding.

[0169] Based on this, it can be directly applied in linear attention. Table 3 shows a comparison of the performance of relative position encoding and rotational position encoding on downstream entity recognition tasks:

[0170] Table 3

[0171] BERT relative position encoding 0.8867 0.833 0.859 Rotational position encoding 0.8904 0.8695 0.8695

[0172] It should be noted that the embodiments of this disclosure are applicable to different rotational relative position encoding methods and their variations, and the embodiments of this disclosure do not impose any special restrictions on the rotational relative position encoding method.

[0173] Figure 13 The diagram illustrates an information extraction method according to an exemplary embodiment of this disclosure. The following is in conjunction with... Figure 13 The information extraction method of this disclosure embodiment will be described using the extraction of schedule events as an example.

[0174] First, obtain the text to be extracted.

[0175] If speech is received, it can be converted into text using ASR (Automatic Speech Recognition) technology; if an image is received, it can be converted into text using OCR (Optical Character Recognition) technology; if text is received, it is directly used as the text to be extracted. Thus, the desired result is obtained. Figure 13 The Query L clause shown.

[0176] Secondly, the extracted text is identified based on the time entity recognition model to obtain the entity text content containing time information and the corresponding location information.

[0177] After obtaining the time entity and its corresponding location information, candidate segment information can be extracted from the text to be extracted based on the time entity and location information. That is, we obtain... Figure 13The schedule shown extracts candidate segments.

[0178] Next, the candidate fragment information is used as input to the target model.

[0179] First, the candidate segment information is converted into token_id and corresponding word vectors, cls_id, etc. based on the vocabulary corresponding to the pre-trained network, and then input into the pre-trained network of the target model.

[0180] The hidden layer output vector, batch_size*max_seq_len*emb_size, is obtained by extracting rich text features through a pre-trained network. From this vector, the comprehensive features required for entity recognition and text segmentation, namely text vector features, are extracted.

[0181] Furthermore, the text vector features are input into the annotation network and text segmentation network of the target model, respectively, to obtain entity annotation results and text segmentation results.

[0182] The optimal entity recognition annotation sequence (entity annotation result) is obtained by decoding the Linear+CRF layer (i.e., annotation network); the Segmentation classifier (text segmentation network, Linear layer) is then used to determine the probability that each sentence is the first sentence of a segmentation segment.

[0183] Finally, based on the entity annotation results and text segmentation results, event information is extracted from the candidate fragment information.

[0184] Specifically, based on the text segmentation results, entity recognition results belonging to the same segmented segment are output as a set of event information. For example... Figure 13 As shown, there are schedule events 1 and 2. Therefore, through this embodiment of the disclosure, it is possible to simultaneously identify which sentence in the input candidate segment information belongs to the first sentence of a new segment, as well as entities such as start time, end time, topic, participants, and address in the candidate segment information. Based on the model prediction results, the entity identification results belonging to the same segment are output as a set of event information.

[0185] It should be noted that the detailed information in this process description can be found in the above embodiments, and will not be repeated here.

[0186] In one exemplary embodiment, model quantization is an optimization technique that can effectively reduce model size and accelerate deep learning inference. Quantization is the process of converting network weights, activation values, etc., from high precision to low precision, such as converting a 32-bit floating-point number to an 8-bit integer (int8). In this embodiment, 8-bit quantization is used, which reduces the model size to one-quarter of the original size compared to using 32-bit floating-point numbers, facilitating model storage and updates. Of course, other quantization methods can also be used in this embodiment, including but not limited to the model quantization methods described above.

[0187] Furthermore, in order to deploy the model on user terminals (such as Android systems), the trained joint model needs to be converted into the form of the ONNX (Open Neural Network Exchange) standard computation graph, and then the ONNX runtime inference engine can be used to implement model prediction on the user terminal.

[0188] Tables 4 and 5 below show the performance test results (average input text length of 500 characters, 10,000 loops) of the information extraction method according to the embodiments of this disclosure after deployment on the terminal side and the comparison of its effect in downstream tasks:

[0189] Table 4

[0190] 12MB 14% 66ms 4.28MB

[0191] Table 5

[0192]

[0193] Here, Segment Case Acc represents the accuracy rate when all segment points in a query are correct.

[0194] Therefore, by adopting the information extraction method and model of this disclosure, converting half of the attention network into a dynamic convolutional network, and using a 4-layer encoder, the number of parameters can be greatly reduced (110M parameters --> 3.7M parameters), thereby reducing the model size. At the same time, it ensures that the fine-tuning effect on downstream tasks is almost equivalent to that of a 12-layer encoder.

[0195] In summary, the information extraction method provided in this embodiment of the present disclosure, on the one hand, performs entity recognition on the text to be extracted to obtain entity text content containing time information and the corresponding location information of the entity text content. Based on the entity text content and location information, candidate segment information is extracted from the text to be extracted. The time entity is used as the trigger for event extraction, and the candidate segment information is extracted from the text to be extracted, which facilitates the subsequent extraction of event information from the candidate segment information. Based on the time entity, the candidate segment information can be accurately extracted. Compared with the traditional multiple cascaded tasks that perform event extraction in a pipeline manner, it avoids the accumulation of errors and improves the accuracy of information extraction. On the other hand, the time entity-based approach does not require manual pre-definition of event types and trigger words in the early stage, which greatly reduces the manual and time costs of event information extraction.

[0196] On the other hand, the longer the input text, the greater the inference time and memory consumption. Therefore, traditional Transformer models generally limit the text input length to 512. However, the method of this disclosure is based on the triggering of time entities and improves the computational performance by determining candidate fragment information. It can support long text inputs, such as emails, and has high versatility.

[0197] In addition, the embodiments of this disclosure jointly train text segmentation and entity recognition models to reduce model size and accelerate model inference; at the same time, the extracted schedule entity information is automatically grouped (belonging to the same text segment) according to the text segmentation results, so that information extraction is no longer flattened.

[0198] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0199] Further reference Figure 14 As shown, an exemplary embodiment of this disclosure provides an information extraction device 1400, including an entity recognition module 1410, a first information extraction module 1420, an information processing module 1430, and a second information extraction module 1440, wherein:

[0200] The entity recognition module 1410 is used to perform entity recognition on the text to be extracted, and obtain entity text content containing time information and the location information corresponding to the entity text content; the first information extraction module 1420 is used to extract candidate fragment information from the text to be extracted based on the entity text content and location information; the information processing module 1430 is used to perform entity annotation and text segmentation on the candidate fragment information, and obtain entity annotation results and text segmentation results; the second information extraction module 1440 is used to extract event information from the candidate fragment information based on the entity annotation results and text segmentation results.

[0201] In an exemplary embodiment, the first information extraction module 1420 is configured to perform: obtaining the central sentence containing the entity text content in the text to be extracted based on the location information; obtaining m sentences before the central sentence and n sentences after the central sentence based on the central sentence and the location information, where m and n are positive integers; and concatenating the central sentence, the m sentences, and the n sentences to obtain candidate fragment information.

[0202] In one exemplary embodiment, the text segmentation result includes the probability that each sentence in the candidate segment information is the first sentence of the segmented segment; the second information extraction module 1440 is configured to perform: determining the target segmented segment corresponding to the central sentence based on the probability; and determining the entity annotation results belonging to the target segmented segment as event information.

[0203] In an exemplary embodiment, the information processing module 1430 is configured to perform entity annotation and text segmentation on candidate fragment information based on a pre-trained target model, and obtain entity annotation results and text segmentation results.

[0204] In an exemplary embodiment, the information extraction apparatus 1400 further includes a model training module configured to perform: acquiring text data, wherein the text data is text data after entity annotation and segmentation annotation; inputting the text data into a pre-trained network in the model to be trained to obtain text vector features; performing entity annotation using the annotation network in the model to be trained based on the text vector features, and determining first loss information based on the obtained entity annotation results and text data; performing text segmentation using the text segmentation network in the model to be trained based on the text vector features, and determining second loss information based on the obtained text segmentation results and text data; and adjusting the parameters in the model to be trained by combining the first loss information and the second loss information to obtain a target model.

[0205] In one exemplary embodiment, the pre-trained network includes an encoding structure comprising an input layer, a dynamic convolutional attention layer, and a feedforward neural network layer. The dynamic convolutional attention layer comprises a parallel attention network and a dynamic convolutional network. The model training module is configured to perform the following: determining the embedded representation of text data based on the input layer; performing feature processing on the embedded representation using the attention network to obtain a first result; extracting features from the embedded representation using the dynamic convolutional network to obtain a second result; and fusing the first result and the second result and inputting them into the feedforward neural network to obtain text vector features.

[0206] In an exemplary embodiment, the dynamic convolutional network includes a first linear layer, a gated linear unit, a dynamic convolutional layer, and a second linear layer; the model training module is configured to perform: mapping the embedded representation to a first vector through the first linear layer; processing the first vector based on the gated linear unit to obtain a second vector; and extracting feature information based on the second vector using the dynamic convolutional layer, and processing the feature information through the second linear layer to obtain a second result.

[0207] In an exemplary embodiment, the model training module is configured to perform: training the network to be trained based on the inter-sentence order prediction task to obtain a pre-trained network; wherein, training the network to be trained based on the inter-sentence order prediction task includes: dividing the text data into multiple sentence blocks based on the segmentation annotation results corresponding to the text data; determining the target position from each sentence block, switching the sentences according to the target position to obtain two clauses; adjusting the order of the two clauses, and using the obtained negative samples for training.

[0208] In one exemplary embodiment, the annotation network includes a third linear layer and a conditional random field layer; the model training module is configured to perform: inputting text vector features into the third linear layer to obtain label vectors; and performing entity recognition on the label vectors through the conditional random field layer to obtain entity annotation results.

[0209] In one exemplary embodiment, the text data includes multiple sentences segmented according to punctuation; the model training module is configured to perform: text segmentation on the text vector features through a text segmentation network to obtain the text segmentation probability corresponding to each sentence; wherein, the text segmentation probability is used to indicate the probability that the corresponding sentence is the first sentence of a text segmentation segment.

[0210] In one exemplary embodiment, the model training module is configured to perform the following: for each sentence, determine sub-loss information based on the text segmentation probability and the segmentation annotation content corresponding to the text data; and determine second loss information by combining the sub-loss information corresponding to each sentence.

[0211] The specific details of each module in the above-mentioned terminal have been described in detail in the method section of the implementation. For any undisclosed details, please refer to the implementation content of the method section. That is, the explanation and beneficial effects of the information extraction method of the above-mentioned embodiment are also applicable to the information extraction device 1400 of the present disclosure embodiment, and will not be elaborated here.

[0212] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0213] An exemplary embodiment of this disclosure also provides an electronic device for the above-described method. This electronic device may be the aforementioned imaging device or a server. Generally, the electronic device includes at least a processor and a memory, the memory for storing executable instructions of the processor, and the processor configured to perform the above-described method by executing the executable instructions.

[0214] The following is based on Figure 15 Taking the mobile terminal 1500 as an example, the construction of the electronic device in this embodiment of the present disclosure will be described by way of example. Those skilled in the art will understand that, apart from components specifically designed for mobile purposes, Figure 15 The structure shown can also be applied to fixed-type devices. In other embodiments, the mobile terminal 1500 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. The interface connections between the components are only schematic and do not constitute a limitation on the structure of the mobile terminal 1500. In other embodiments, the mobile terminal may also adopt a similar design to... Figure 15 Different interface connection methods, or combinations of multiple interface connection methods.

[0215] like Figure 15 As shown, the mobile terminal 1500 may specifically include: a processor 1501, a memory 1502, a bus 1503, a mobile communication module 1504, an antenna 1, a wireless communication module 1505, an antenna 2, a display screen 1506, a camera module 1507, an audio module 1508, a power module 1509, and a sensor module 1510.

[0216] Processor 1501 may include one or more processing units, such as: application processor (AP), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, encoder, decoder, DSP (Digital Signal Processor), baseband processor and / or NPU (Neural-Network Processing Unit), etc.

[0217] An encoder encodes (compresses) images or videos to reduce data size for easier storage or transmission. A decoder decodes (decompresses) the encoded data to restore the original image or video data. The mobile terminal 1500 can support one or more encoders and decoders, such as image formats like JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), and BMP (Bitmap), and video formats like MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).

[0218] The processor 1501 can be connected to the memory 1502 or other components via the bus 1503.

[0219] The memory 1502 can be used to store executable program code, including instructions. The processor 1501 executes various functional applications and data processing of the mobile terminal 1500 by running the instructions stored in the memory 1502. The memory 1502 can also store application data, such as images, videos, and other files.

[0220] The communication functions of mobile terminal 1500 can be implemented through mobile communication module 1504, antenna 1, wireless communication module 1505, antenna 2, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 1504 can provide 3G, 4G, and 5G mobile communication solutions for mobile terminal 1500. Wireless communication module 1505 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication for mobile terminal 1500.

[0221] The display screen 1506 is used to implement display functions, such as displaying the user interface, images, videos, and displaying abnormal prompts. The camera module 1507 is used to implement shooting functions, such as capturing images and videos to acquire scene images. The audio module 1508 is used to implement audio functions, such as playing audio and capturing voice. The power module 1509 is used to implement power management functions, such as charging the battery, supplying power to the device, and monitoring battery status. The sensor module 1510 may include one or more sensors for implementing corresponding sensing and detection functions.

[0222] Furthermore, exemplary embodiments of this disclosure also provide a computer-readable storage medium storing a program product capable of implementing the methods described above. In some possible embodiments, various aspects of this disclosure may also be implemented as a program product including program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0223] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0224] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.

[0225] Furthermore, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0226] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. An information extraction method, characterized in that, include: Entity recognition is performed on the text to be extracted to obtain entity text content containing time information and the location information corresponding to the entity text content; Based on the entity text content and the location information, candidate fragment information is extracted from the text to be extracted; The candidate fragment information is subjected to entity annotation and text segmentation to obtain entity annotation results and text segmentation results; the text segmentation results include the probability that each sentence in the candidate fragment information is the first sentence of the segmented fragment; wherein, the central sentence containing the entity text content in the text to be extracted is obtained according to the position information; based on the central sentence and the position information, m sentences before the central sentence and n sentences after the central sentence are obtained, where m and n are positive integers; the central sentence, the m sentences, and the n sentences are concatenated to obtain the candidate fragment information; Based on the entity annotation results and the text segmentation results, event information is extracted from the candidate segment information; wherein, the target segmentation segment corresponding to the central sentence is determined based on the probability, and the entity annotation results belonging to the target segmentation segment are determined as the event information.

2. The method according to claim 1, characterized in that, The step of performing entity annotation and text segmentation on the candidate fragment information to obtain entity annotation results and text segmentation results includes: The candidate fragment information is labeled with entities and segmented with text based on a pre-trained target model to obtain the entity labeling results and the text segmentation results.

3. The method according to claim 2, characterized in that, The process of obtaining the target model includes: Acquire text data, wherein the text data is text data after entity annotation and segmentation annotation; The text data is input into a pre-trained network in the model to be trained to obtain text vector features; Based on the text vector features, entity annotation is performed using the annotation network in the model to be trained, and the first loss information is determined based on the obtained entity annotation results and the text data. Based on the text vector features, text segmentation is performed using the text segmentation network in the model to be trained, and second loss information is determined based on the obtained text segmentation results and the text data. The parameters in the model to be trained are adjusted by combining the first loss information and the second loss information to obtain the target model.

4. The method according to claim 3, characterized in that, The pre-trained network includes an encoding structure, which includes an input layer, a dynamic convolutional attention layer, and a feedforward neural network layer. The dynamic convolutional attention layer includes a parallel attention network and a dynamic convolutional network. The step of inputting the text data into a pre-trained network in the model to be trained to obtain text vector features includes: The embedded representation of the text data is determined based on the input layer; The attention network is used to perform feature processing on the embedded representation to obtain a first result; The second result is obtained by extracting features from the embedded representation using the dynamic convolutional network. The first result and the second result are fused and then input into the feedforward neural network to obtain the text vector features.

5. The method according to claim 4, characterized in that, The dynamic convolutional network includes a first linear layer, gated linear units, a dynamic convolutional layer, and a second linear layer; the step of extracting features from the embedded representation using the dynamic convolutional network to obtain a second result includes: The embedded representation is mapped to a first vector through the first linear layer; The second vector is obtained by processing the first vector based on the gated linear unit. Based on the second vector, feature information is extracted using the dynamic convolutional layer, and the feature information is processed through the second linear layer to obtain the second result.

6. The method according to claim 3, characterized in that, Before inputting the text data into the pre-trained network of the model to be trained to obtain text vector features, the method further includes: The pre-trained network is obtained by training the network to be trained based on the sentence order prediction task. The training of the network to be trained based on the inter-sentence sequence prediction task includes: Based on the segmentation and annotation results corresponding to the text data, the text data is divided into multiple sentence blocks; Determine the target position from each of the sentence blocks, and segment the sentence according to the target position to obtain two clauses; Adjust the order of the two clauses and use the resulting negative samples for training.

7. The method according to claim 3, characterized in that, The annotation network includes a third linear layer and a conditional random field layer; the entity annotation based on the text vector features, using the annotation network in the model to be trained, includes: The text vector features are input into the third linear layer to obtain the label vector; The entity labeling result is obtained by performing entity recognition on the label vector through the conditional random field layer.

8. The method according to claim 3, characterized in that, The text data includes multiple sentences segmented according to punctuation; the text segmentation based on the text vector features, using the text segmentation network in the model to be trained, includes: The text segmentation network is used to segment the text vector features to obtain the text segmentation probability of each sentence. The text segmentation probability is used to indicate the probability that the corresponding sentence is the first sentence of a text segment.

9. The method according to claim 8, characterized in that, The step of determining the second loss information based on the obtained text segmentation result and the text data includes: For each sentence, sub-loss information is determined based on the text segmentation probability and the segmentation annotation content corresponding to the text data; The second loss information is determined by combining the sub-loss information corresponding to each sentence.

10. An information extraction device, characterized in that, include: The entity recognition module is used to perform entity recognition on the text to be extracted, and obtain the entity text content containing time information and the location information corresponding to the entity text content; The first information extraction module is used to extract candidate fragment information from the text to be extracted based on the entity text content and the location information. An information processing module is used to perform entity annotation and text segmentation on the candidate fragment information to obtain entity annotation results and text segmentation results. The text segmentation results include the probability that each sentence in the candidate fragment information is the first sentence of the segmented fragment. Specifically, the module obtains the central sentence containing the entity text content in the text to be extracted based on the location information; based on the central sentence and the location information, it obtains m sentences before the central sentence and n sentences after the central sentence, where m and n are positive integers; and it concatenates the central sentence, the m sentences, and the n sentences to obtain the candidate fragment information. The second information extraction module is used to extract event information from the candidate segment information based on the entity annotation results and the text segmentation results; wherein, the target segment corresponding to the central sentence is determined based on the probability, and the entity annotation results belonging to the target segment are determined as the event information.

11. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.