Text extraction method and device based on self-association pointer generation network and medium
By adding spatial constraints and information constraints to the self-association pointer generation network, the problem of failure to fully consider new generation word constraints in the prior art is solved, and the accuracy of text extraction is improved.
Patent Information
- Application Number
- CN202411680503.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing pointer generation network fails to fully consider the constraints of newly generated words during text extraction, which affects the accuracy of text extraction.
The text extraction method based on the self-association pointer generation network is adopted to filter text sequences through relationship extraction and attention weight calculation, and spatial constraints and information amount constraints in discriminators are added to the self-association pointer generation network to generate a more accurate text sequence.
Improves the accuracy of text extraction and ensures that the generated text sequence can more accurately reflect the semantic information of the original text data.
Smart Images

Figure CN119623457A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text data processing, and more specifically, to a text extraction method, device and medium based on a self-association pointer generation network. Background Art
[0002] With the rapid development of the Internet, more and more text data is generated, and the problem of text information overload is becoming increasingly serious. It is very necessary to perform a "dimensionality reduction" process on various types of texts. Text summarization is one of the important means. Text summarization aims to convert text or text collections into short summaries containing key information. According to the output type, it can be divided into extractive summaries and generative summaries. Extractive summaries extract key sentences and keywords from the source document to form a summary, and the summary is all derived from the original text. Generative summaries allow the generation of new words and phrases that are not in the original text to form a summary based on the original text.
[0003] When extracting text data, the existing pointer generation network mainly generates new text sequences through the contextual semantics of the source text data. However, this method only constrains the source text data and does not consider the constraints of newly generated words when generating new text sequences. In a sense, newly generated words have a very important impact on the accuracy of the formed text sequence. Therefore, how to take newly generated words into consideration in the text extraction process to improve the accuracy of text extraction is a technical problem to be solved by the present invention. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a text extraction method, device and medium based on a self-associative pointer generation network to improve the accuracy of text extraction.
[0005] In a first aspect, the present invention provides a text extraction method based on a self-associative pointer generation network, the method comprising:
[0006] Get text data;
[0007] Based on the text data, performing relationship extraction to extract sentence triplets; calculating attention weights of all words in the text data based on the triplets; and screening words based on the attention weights to obtain a text sequence;
[0008] Constructing a text extraction model, the text extraction model includes a self-associative pointer generation network and a discriminator, the self-associative pointer generation network generates a discrete sequence in response to an input text sequence and feeds the discrete sequence to the discriminator; the discriminator obtains a score for each discrete sequence in response to the input discrete sequence, and uses the discrete sequence with the highest score as the final generated sequence; adding a spatial constraint to the self-associative pointer generation network, the spatial constraint allows the self-associative pointer generation network to generate words that do not exist in the text sequence, and the information amount constraint in the discriminator is used to constrain the information amount of the generated sequence output by the discriminator;
[0009] A text data set is constructed, the text extraction model is trained using the text data set, and text extraction is implemented through the trained text extraction model.
[0010] Furthermore, based on the triples, the attention weights of all words in the text data are calculated by the following formula:
[0011]
[0012] In the formula, E ij represents the attention value between the i-th word in the text data and the j-th word in the triple, T represents the matrix transpose operation, LeakyRELU represents the activation function, represents the mapping vector, W represents the projection matrix, and Respectively represent the word vector between the i-th word in the text data and the j-th word in the triple, a ij represents the attention weight between the i-th word in the text data and the j-th word in the triple, exp represents the empirical function, the i-th word in the text data and the j-th word in the triple form a word pair, K represents the number of word pairs, and k represents the word pair sequence number.
[0013] Furthermore, the words are screened based on the attention weights to obtain a text sequence, including:
[0014] Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold;
[0015] If the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight;
[0016] If the attention weight is less than or equal to the first threshold but greater than the second threshold, based on the preset vocabulary, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to the set ratio, and directly delete the words that are not replaced;
[0017] If the attention weight is less than or equal to the second threshold, directly deleting the word in the text data of the word pair corresponding to the attention weight;
[0018] Combine the retained and replaced words in the text data to obtain a text sequence.
[0019] Furthermore, the self-associative pointer generation network includes an encoder and a decoder. The self-associative pointer generation network generates a discrete sequence in response to an input text sequence through the following formula and feeds it to the discriminator, including:
[0020] Based on the encoder and decoder, the probability is calculated by the following formula:
[0021]
[0022] P v =softmax(V'(V[s t ,h' i ])+b2)+b'2
[0023]
[0024] P=P g P v +(1-P g )
[0025] In the formula, h' i represents the output of the encoder, h i represents the hidden state of the encoder, s t represents the state of the decoder, b1 represents the bias parameter, W h and W s Denote the weight matrices of the encoder and decoder respectively, P v represents the probability of a sequence generating a word from the vocabulary, P g represents the probability distribution of all words in the vocabulary, P represents the probability of the current generated sequence; V', V, b2, b'2, b3, ω h ,ω s ,ω t Both represent learnable parameters
[0026] The optimal sequence is selected according to the calculated probability of the current generated sequence, and a discrete sequence is generated and fed to the discriminator.
[0027] Furthermore, the discriminator includes a label extraction module and a scoring module, wherein the label extraction module is used to extract the first m words in the discrete sequence as labels, and the scoring module generates a score of the corresponding discrete sequence based on the labels.
[0028] Furthermore, the spatial constraint is expressed as:
[0029]
[0030] In the formula, S 空 represents the spatial score of the discrete sequence, y i and j Both represent the word vectors in the text sequence in the discrete sequence, x n and x m Both represent word vectors in the discrete sequence that do not exist in the text sequence; i and j represent the serial numbers of the word vectors in the discrete sequence that exist in the text sequence, M1 represents the total number of word vectors in the discrete sequence that exist in the text sequence, m and n represent the serial numbers of the word vectors in the discrete sequence that exist in the text sequence, and M2 represents the total number of word vectors in the discrete sequence that exist in the text sequence.
[0031] Furthermore, the information constraint is expressed as:
[0032]
[0033] In the formula, S represents the information constraint, M represents the number of input discrete sequences, i1 represents the sequence number of the input discrete sequence and its corresponding text data, and y i1 represents a discrete sequence, x i1 Represents the text data corresponding to the discrete sequence, N represents the number of text data, l represents the expected length of the generated sequence, and C1 and C2 represent hyperparameters.
[0034] In a second aspect, the present invention provides a text extraction device based on a self-associative pointer generation network, the device comprising:
[0035] A data acquisition unit, configured to acquire text data;
[0036] A sequence extraction unit is configured to perform relationship extraction based on the text data to extract sentence triplets; calculate attention weights of all words in the text data based on the triplets; and filter words based on the attention weights to obtain a text sequence;
[0037] The model building unit is configured to build a text extraction model, wherein the text extraction model includes a self-associative pointer generation network and a discriminator, wherein the self-associative pointer generation network generates a discrete sequence in response to an input text sequence and feeds the discrete sequence to the discriminator; the discriminator obtains a scoring score for each discrete sequence in response to the input discrete sequence, and uses the discrete sequence of scoring scores as the final generated sequence; a space constraint is added to the self-associative pointer generation network, wherein the space constraint allows the self-associative pointer generation network to generate words that do not exist in the text sequence, and an information amount constraint is added to the discriminator, which is used to constrain the information amount of the generated sequence output by the discriminator;
[0038] The model training unit constructs a text data set, uses the text data set to train the text extraction model, and implements text extraction through the trained text extraction model.
[0039] Furthermore, the model building unit is further configured to:
[0040] Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold;
[0041] If the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight;
[0042] If the attention weight is less than or equal to the first threshold but greater than the second threshold, based on the preset vocabulary, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to the set ratio, and directly delete the words that are not replaced;
[0043] If the attention weight is less than or equal to the second threshold, directly deleting the word in the text data of the word pair corresponding to the attention weight;
[0044] Combine the retained and replaced words in the text data to obtain a text sequence.
[0045] In a third aspect, the present invention provides a readable storage medium, wherein the readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method as described above.
[0046] The present invention has at least the following beneficial effects:
[0047] The present invention preprocesses text data based on attention weights, and after screening out valid text sequences from the original text data, constructs a text extraction model, adds spatial constraints to the self-associative pointer generation network of the text extraction model, and the spatial constraints consider newly generated words to score the discrete sequences generated by the generation network, thereby ensuring that the obtained sequence can more accurately reflect the semantic information of the original text data and improve the accuracy of text extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of a text extraction method based on a self-associative pointer generation network according to an embodiment of the present invention is shown.
[0049] Figure 2 A sequence screening flow chart according to an embodiment of the present invention is shown.
[0050] Figure 3 A structural diagram of a text extraction model according to an embodiment of the present invention is shown.
[0051] Figure 4 A structural diagram of a text extraction device based on a self-associative pointer generation network according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and specific embodiments, but are not intended to limit the present invention. For the various steps described herein, if there is no necessity for a causal relationship between each other, the order in which they are described as examples herein should not be regarded as a limitation, and those skilled in the art should know that they can be adjusted in order, as long as the logic between them is not destroyed, resulting in the inability to implement the entire process.
[0053] The embodiment of the present invention provides a text extraction method based on a self-associative pointer generation network. Figure 1 As shown, the method includes steps S10 to S40, which are described in detail as follows.
[0054] S10: Acquire text data.
[0055] S20: Based on the text data, perform relationship extraction to extract the triples of the sentences; calculate the attention weights of all words in the text data based on the triples; and filter the words based on the attention weights to obtain a text sequence.
[0056] In this embodiment, the method of performing relation extraction on the text data to extract the triples of each sentence therein adopts the existing method, which will not be elaborated in detail here. The purpose of step S20 is to split the text data into sentences as basic units, use triples to represent the sentences, and then calculate and screen the attention weights according to the triples to obtain a text sequence of a sentence. The text sequences of each sentence obtained by the above method are recombined according to their positions in the text data to obtain the text sequence of the text data.
[0057] In some embodiments, based on the triples, the attention weights of all words in the text data are calculated by the following formula:
[0058]
[0059] In the formula, E ij represents the attention value between the i-th word in the text data and the j-th word in the triple, T represents the matrix transpose operation, LeakyRELU represents the activation function, represents the mapping vector, W represents the projection matrix, and Respectively represent the word vector between the i-th word in the text data and the j-th word in the triple, a ij represents the attention weight between the i-th word in the text data and the j-th word in the triple, exp represents the empirical function, the i-th word in the text data and the j-th word in the triple form a word pair, K represents the number of word pairs, and k represents the word pair sequence number.
[0060] In some embodiments, Figure 2 As shown, the words are filtered based on the attention weights to obtain a text sequence, including:
[0061] S21: Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold;
[0062] S22: if the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight;
[0063] S23: if the attention weight is less than or equal to the first threshold but greater than the second threshold, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to a set ratio based on the preset vocabulary, and directly delete the words that are not replaced;
[0064] S24: If the attention weight is less than or equal to the second threshold, directly delete the word in the text data of the word pair corresponding to the attention weight;
[0065] S25: Combine the retained and replaced words in the text data to obtain a text sequence.
[0066] It should be noted that what is obtained from the above steps S21 to S25 is a text sequence of a sentence in the text data.
[0067] S30, constructing a text extraction model, the text extraction model includes a self-associating pointer generation network and a discriminator, the self-associating pointer generation network responds to the input text sequence, generates a discrete sequence and feeds it to the discriminator; the discriminator responds to the input discrete sequence, obtains a scoring score for each discrete sequence, and uses the discrete sequence with the highest scoring score as the final generated sequence; adding space constraints to the self-associating pointer generation network, the space constraints allow the self-associating pointer generation network to generate words that do not exist in the text sequence, and the information amount constraints in the discriminator are used to constrain the amount of information in the generated sequence output by the discriminator.
[0068] In some embodiments, the structure diagram of the text extraction model is as follows: Figure 3 As shown, the text extraction model includes a self-associative pointer generation network 31 and a discriminator 32; wherein the self-associative pointer generation network 31 includes an encoder 311 and a decoder 312, and the self-associative pointer generation network 31 generates a discrete sequence in response to the input text sequence through the following formula and feeds it to the discriminator 32, including:
[0069] Based on the encoder 311 and the decoder 312, the probability is calculated by the following formula:
[0070]
[0071] P v =softmax(V'(V[s t ,h' i ])+b2)+b'2
[0072]
[0073] P=P g P v +(1-P g )
[0074] In the formula, h' i represents the output of the encoder, h i represents the hidden state of the encoder, s t represents the state of the decoder, b1 represents the bias parameter, W h and W s Denote the weight matrices of the encoder and decoder respectively, P v represents the probability of a sequence generating a word from the vocabulary, P g represents the probability distribution of all words in the vocabulary, P represents the probability of the current generated sequence; V', V, b2, b'2, b3, ωh ,ω s ,ω t All represent learnable parameters;
[0075] The optimal sequence is selected according to the calculated probability of the current generated sequence, and a discrete sequence is generated and fed to the discriminator 32.
[0076] In some embodiments, Figure 3 As shown, the discriminator 32 includes a label extraction module 321 and a scoring module 322. The label extraction module 321 is used to extract the first m words in the discrete sequence as labels, and the scoring module 322 generates a score corresponding to the discrete sequence based on the label.
[0077] In this embodiment, the label extraction module 321 can directly extract the first few characters / words in the discrete sequence as labels to reduce subsequent scoring calculations. The specific number can be determined according to the length of the discrete sequence. For example, if the length of the discrete sequence is L, the number can be 0.1L, and if it is a decimal, it is rounded down. The scoring model 322 calculates the score based on the label, and the specific calculation method is determined by the selected evaluation index. For example, the F1 score or ROC curve can be selected as the evaluation index, and the calculation formula of the F1 score or ROC curve can be configured in the scoring module 322 to realize the calculation of the score.
[0078] In some embodiments, the spatial constraint is expressed as:
[0079]
[0080] In the formula, S 空 represents the spatial score of the discrete sequence, y i and j Both represent the word vectors in the text sequence in the discrete sequence, x n and x m Both represent word vectors in the discrete sequence that do not exist in the text sequence; i and j represent the serial numbers of the word vectors in the discrete sequence that exist in the text sequence, M1 represents the total number of word vectors in the discrete sequence that exist in the text sequence, m and n represent the serial numbers of the word vectors in the discrete sequence that exist in the text sequence, and M2 represents the total number of word vectors in the discrete sequence that exist in the text sequence.
[0081] In this embodiment, the spatial constraint is based on the calculated spatial score of the discrete sequence. A spatial score threshold [S1, S2] can be set here. If the spatial score of the discrete sequence is within the spatial score threshold, it means that the current discrete sequence meets the requirements and is directly fed to the discriminator 32 for further processing. If the spatial score of the discrete sequence is less than or greater than the spatial score threshold, it means that the current discrete sequence does not meet the requirements and the discrete sequence needs to be regenerated.
[0082] In some embodiments, the information constraint is expressed as:
[0083]
[0084] In the formula, S represents the information constraint, M represents the number of input discrete sequences, i1 represents the sequence number of the input discrete sequence and its corresponding text data, and y i1 represents a discrete sequence, x i1 Represents the text data corresponding to the discrete sequence, N represents the number of text data, l represents the expected length of the generated sequence, and C1 and C2 represent hyperparameters.
[0085] In this embodiment, the information constraint S is a specific value. When implementing the information constraint, an information threshold [S3, S4] is set. If the currently calculated information constraint is not within the information threshold, it means that the current discrete sequence does not meet the constraint requirements, and the discrete sequence is deleted. If the currently calculated information constraint is not within the information threshold, it means that the current discrete sequence meets the constraint requirements, and its score is directly calculated.
[0086] S40, constructing a text data set, using the text data set to train a text extraction model, and implementing text extraction through the trained text extraction model.
[0087] In this embodiment, the process of training the text extraction model is the process of determining the learnable parameters in the text extraction model. The cross entropy can be selected as the loss function, and the gradient descent method can be used for training to obtain weight parameters. The text extraction model is configured with the weight parameters, and the text extraction model is finally obtained for realizing text extraction.
[0088] The embodiment of the present invention also provides a text extraction device based on a self-associative pointer generation network, such as Figure 4 As shown, the device comprises:
[0089] The data acquisition unit 401 is configured to acquire text data;
[0090] The sequence extraction unit 402 is configured to perform relationship extraction based on the text data to extract sentence triplets; calculate attention weights of all words in the text data based on the triplets; and filter words based on the attention weights to obtain a text sequence;
[0091] The model building unit 403 is configured to build a text extraction model, wherein the text extraction model includes a self-associative pointer generation network and a discriminator, wherein the self-associative pointer generation network generates a discrete sequence in response to an input text sequence and feeds the discrete sequence to the discriminator; the discriminator obtains a scoring score for each discrete sequence in response to the input discrete sequence, and uses the discrete sequence of scoring scores as the final generated sequence; a space constraint is added to the self-associative pointer generation network, wherein the space constraint allows the self-associative pointer generation network to generate words that do not exist in the text sequence, and an information amount constraint is added to the discriminator, which is used to constrain the information amount of the generated sequence output by the discriminator;
[0092] The model training unit 404 constructs a text data set, uses the text data set to train the text extraction model, and implements text extraction through the trained text extraction model.
[0093] In some embodiments, the model building unit is further configured to:
[0094] Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold;
[0095] If the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight;
[0096] If the attention weight is less than or equal to the first threshold but greater than the second threshold, based on the preset vocabulary, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to the set ratio, and directly delete the words that are not replaced;
[0097] If the attention weight is less than or equal to the second threshold, directly deleting the word in the text data of the word pair corresponding to the attention weight;
[0098] Combine the retained and replaced words in the text data to obtain a text sequence.
[0099] It should be noted that the various device structures described in this embodiment belong to the same technical concept as the previously described method, and achieve the same technical effect through the same principle, which will not be repeated here.
[0100] An embodiment of the present invention further provides a readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method described in any of the above embodiments.
[0101] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present invention with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of this application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0102] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as a feature of an invention that is not claimed for protection being necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of the embodiments of a specific invention. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the full scope of the equivalent forms of the attached claims and these claims.
Claims
1. A text extraction method based on a self-associative pointer generation network, characterized in that: The method comprises: Get text data; Based on the text data, performing relationship extraction to extract sentence triplets; calculating attention weights of all words in the text data based on the triplets; and screening words based on the attention weights to obtain a text sequence; Constructing a text extraction model, the text extraction model includes a self-associative pointer generation network and a discriminator, the self-associative pointer generation network generates a discrete sequence in response to an input text sequence and feeds the discrete sequence to the discriminator; the discriminator obtains a score for each discrete sequence in response to the input discrete sequence, and uses the discrete sequence with the highest score as the final generated sequence; adding a spatial constraint to the self-associative pointer generation network, the spatial constraint allows the self-associative pointer generation network to generate words that do not exist in the text sequence, and the information amount constraint in the discriminator is used to constrain the information amount of the generated sequence output by the discriminator; A text data set is constructed, the text extraction model is trained using the text data set, and text extraction is implemented through the trained text extraction model.
2. The method according to claim 1, characterized in that: Based on the triples, the attention weights of all words in the text data are calculated by the following formula: In the formula, E ij represents the attention value between the i-th word in the text data and the j-th word in the triple, T represents the matrix transpose operation, LeakyRELU represents the activation function, represents the mapping vector, W represents the projection matrix, and Respectively represent the word vector between the i-th word in the text data and the j-th word in the triple, a ij represents the attention weight between the i-th word in the text data and the j-th word in the triple, exp represents the empirical function, the i-th word in the text data and the j-th word in the triple form a word pair, K represents the number of word pairs, and k represents the word pair sequence number.
3. The method according to claim 2, characterized in that The words are screened based on the attention weights to obtain a text sequence, including: Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold; If the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight; If the attention weight is less than or equal to the first threshold but greater than the second threshold, based on the preset vocabulary, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to the set ratio, and directly delete the words that are not replaced; If the attention weight is less than or equal to the second threshold, directly deleting the word in the text data of the word pair corresponding to the attention weight; Combine the retained and replaced words in the text data to obtain a text sequence.
4. The method according to claim 1, characterized in that The self-associative pointer generation network includes an encoder and a decoder. The self-associative pointer generation network generates a discrete sequence in response to an input text sequence through the following formula and feeds it to the discriminator, including: Based on the encoder and decoder, the probability is calculated by the following formula: P v =softmax(V'(V[s t ,h' i ])+b2)+b'2 P=P g P v +(1-P g ) In the formula, h' i represents the output of the encoder, h i represents the hidden state of the encoder, s t represents the state of the decoder, b1 represents the bias parameter, W h and W s Denote the weight matrices of the encoder and decoder respectively, P v represents the probability of a sequence generating a word from the vocabulary, P g represents the probability distribution of all words in the vocabulary, P represents the probability of the current generated sequence; V', V, b2, b'2, b3, ω h ,ω s ,ω t Both represent learnable parameters The optimal sequence is selected according to the calculated probability of the current generated sequence, and a discrete sequence is generated and fed to the discriminator.
5. The method according to claim 1, characterized in that The discriminator includes a label extraction module and a scoring module. The label extraction module is used to extract the first m words in the discrete sequence as labels, and the scoring module generates a score of the corresponding discrete sequence based on the labels.
6. The method according to claim 1, characterized in that The spatial constraint is expressed as: In the formula, S 空 represents the spatial score of the discrete sequence, y i and j Both represent the word vectors in the text sequence in the discrete sequence, x n and x m Both represent word vectors in the discrete sequence that do not exist in the text sequence; i and j represent the ordinal numbers of the word vectors in the discrete sequence that exist in the text sequence, N1 represents the total number of word vectors in the discrete sequence that exist in the text sequence, m and n represent the ordinal numbers of the word vectors in the discrete sequence that exist in the text sequence, and M2 represents the total number of word vectors in the discrete sequence that exist in the text sequence.
7. The method according to claim 1, characterized in that The information constraint is expressed as: In the formula, S represents the information constraint, M represents the number of input discrete sequences, i1 represents the sequence number of the input discrete sequence and its corresponding text data, and y i1 represents a discrete sequence, x i1 Represents the text data corresponding to the discrete sequence, N represents the number of text data, l represents the expected length of the generated sequence, and C1 and C2 represent hyperparameters.
8. A text extraction device based on a self-associative pointer generation network, characterized in that: The device comprises: A data acquisition unit, configured to acquire text data; A sequence extraction unit is configured to perform relationship extraction based on the text data to extract sentence triplets; calculate attention weights of all words in the text data based on the triplets; and filter words based on the attention weights to obtain a text sequence; The model building unit is configured to build a text extraction model, wherein the text extraction model includes a self-associative pointer generation network and a discriminator, wherein the self-associative pointer generation network generates a discrete sequence in response to an input text sequence and feeds the discrete sequence to the discriminator; the discriminator obtains a scoring score for each discrete sequence in response to the input discrete sequence, and uses the discrete sequence of scoring scores as the final generated sequence; a space constraint is added to the self-associative pointer generation network, wherein the space constraint allows the self-associative pointer generation network to generate words that do not exist in the text sequence, and an information amount constraint is added to the discriminator, which is used to constrain the information amount of the generated sequence output by the discriminator; The model training unit constructs a text data set, uses the text data set to train the text extraction model, and implements text extraction through the trained text extraction model.
9. The device according to claim 8, characterized in that The model building unit is further configured to: Setting a first threshold and a second threshold; wherein the first threshold is greater than the second threshold; If the attention weight is greater than the first threshold, retaining the word in the text data of the word pair corresponding to the attention weight; If the attention weight is less than or equal to the first threshold but greater than the second threshold, based on the preset vocabulary, partially replace the words in the text data corresponding to the attention weight less than or equal to the first threshold but greater than the second threshold according to the set ratio, and directly delete the words that are not replaced; If the attention weight is less than or equal to the second threshold, directly deleting the word in the text data of the word pair corresponding to the attention weight; Combine the retained and replaced words in the text data to obtain a text sequence. 10 . A non-transitory computer-readable storage medium storing instructions, which, when executed by a processor, executes the method according to claim 1 .