Text sequence generation method, device, equipment and medium

The method enhances text sequence generation by fusing initial and structured text features using neural networks, correcting errors and improving fluency and accuracy in text editing.

JP7553202B2Active Publication Date: 2024-09-18DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022567688
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-06-24
Filing Date
2021-06-21
Publication Date
2024-09-18
Estimated Expiration
2041-06-21

AI Technical Summary

Technical Problem

Conventional text conversion techniques often result in factual errors, omissions, and produce text articles that are stiff and not fluent.

Method used

A method and apparatus for generating text sequences by extracting initial and structured text features, fusing them to improve accuracy and fluency, using neural networks and fact triplets to enhance text editing.

Benefits of technology

Improves the fluency and accuracy of generated text sequences by correcting factual errors and enhancing naturalness, addressing the stiffness and inaccuracies in conventional text conversion technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007553202000035
    Figure 0007553202000035
  • Figure 0007553202000030
    Figure 0007553202000030
  • Figure 0007553202000028
    Figure 0007553202000028
Patent Text Reader

Abstract

The present disclosure provides a text sequence generation method, apparatus, device, and medium, including the steps of: obtaining an initial text sequence and extracting initial text features from the initial text sequence; obtaining a structured text sequence associated with facts in the initial text sequence and extracting structured features from the structured text sequence; and fusing the initial text features and the structured features to generate a target text sequence. The technical solution according to the present disclosure improves the accuracy and fluency of the target text by aligning and fusing different types of sequences associated with facts to generate a new text sequence.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to a Chinese patent application bearing application number 202010591970.9 and entitled "Text sequence generation method, device, apparatus and medium" filed with the China National Intellectual Property Office on June 24, 2020, the entire contents of which are incorporated herein by reference.

[0002] Technical Field TECHNICAL FIELD The embodiments of the present disclosure relate to the field of artificial intelligence, and in particular to a method, apparatus, device and medium for generating text sequences. [Background technology]

[0003] With the popularity of information application software, it is necessary to process and provide a large amount of information data to users. Information data can be displayed in various forms, such as text, image, and video. Articles formed based on text are an important form of information display.

[0004] Due to the large number of articles to process, currently, various automated text conversion techniques are employed to generate or convert articles in order to convert the original text material into text articles that meet current needs. Such techniques include machine translation when used to convert between different languages ​​or different text formats, and automatic conversion of articles to summaries when used to convert between articles and summaries.

[0005] However, traditional text conversion techniques may contain factual errors or omissions, and the text articles obtained after conversion are generally relatively stiff and not fluent. Summary of the Invention [Problem to be solved by the invention]

[0006] The embodiments of the present disclosure provide a method, apparatus, device and medium for generating a text sequence, which realizes an optimization of the method for generating a text article as a text sequence, and improves the accuracy and fluency of the text article. [Means for solving the problem]

[0007] According to a first aspect, an embodiment of the present disclosure provides a method for generating a text sequence, the method comprising: obtaining an initial text sequence and extracting initial text features from the initial text sequence; obtaining a structured text sequence associated with a fact in the initial text sequence and extracting structured features from the structured text sequence; and fusing the initial text features and the structural features to generate a target text sequence.

[0008] According to a second aspect, an embodiment of the present disclosure further provides a device for generating a text sequence, the device comprising: an initial text feature extraction module for extracting initial text features of the initial text sequence; a structured feature extraction module for extracting structured features from the structured text sequence; and a fusion module for fusion to generate a target text sequence based on the initial text features and the structural features.

[0009] According to a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising: one or more processors; and a memory for storing one or more programs; The one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method for generating a text sequence according to any embodiment of the present disclosure.

[0010] According to a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, the computer program being adapted to implement the method for generating a text sequence according to any embodiment of the present disclosure when executed by a processor.

[0011] According to a fifth aspect, an embodiment of the present disclosure further provides a computer program product, the computer program product including a computer program that, when executed by a processor, realizes the method for generating a text sequence according to any embodiment of the present disclosure.

[0012] According to a sixth aspect, an embodiment of the present disclosure further provides a computer program, which, when executed by a processor, realizes the method for generating a text sequence according to any embodiment of the present disclosure. Effect of the Invention

[0013] In the embodiment of the present disclosure, a text sequence generation method combines a text sequence with a structured text sequence to improve the fluency of a target text sequence generated by the text sequence, and improves the factual accuracy of the target text sequence with the structured text sequence, thereby solving technical problems such as the existence of factual errors or omissions in text conversion technology, and the text articles obtained after conversion are stiff and not fluent, and improving the accuracy and fluency of text editing. [Brief description of the drawings]

[0014] The above and other features, advantages and aspects of each embodiment of the present disclosure will become more apparent with reference to the following specific embodiments in combination with the accompanying drawings. Throughout the accompanying drawings, the same or similar drawing marks indicate the same or similar elements. It should be understood that the accompanying drawings are illustrative, and the originals and elements are not necessarily drawn to scale. [Figure 1] 1 is a flowchart of a text sequence generating method according to Example 1 of the present disclosure. [Figure 2A] 11 is a flowchart of a text sequence generating method according to Example 2 of the present disclosure. [Figure 2B] FIG. 11 is a structural schematic diagram of a text sequence generating method according to Example 2 of the present disclosure; [Figure 2C] FIG. 11 is a structural schematic diagram of a text sequence generating method according to Example 2 of the present disclosure; [Diagram 3] 11 is a flowchart of a text sequence generating method according to Example 3 of the present disclosure. [Figure 4A] FIG. 11 is a schematic diagram of a text sequence generation method according to a fifth embodiment of the present disclosure. [Figure 4B] FIG. 11 is a schematic diagram of a text sequence generation method according to a fifth embodiment of the present disclosure. [Figure 4C] FIG. 11 is a schematic diagram of a text sequence generation method according to a fifth embodiment of the present disclosure. [Diagram 5] FIG. 13 is a structural schematic diagram of a text sequence generating device according to Example 6 of the present disclosure; [Figure 6] FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] The following will describe the embodiments of the present disclosure in more detail with reference to the accompanying drawings. In the accompanying drawings, some embodiments of the present disclosure are shown, but it should be understood that the present disclosure can be realized in various forms and should not be construed as being limited to the embodiments described herein, but on the contrary, these embodiments are provided for a more transparent and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments of the present disclosure are not used to limit the protection scope of the present disclosure, but are used only for exemplary purposes.

[0016] It should be understood that the steps recited in the method embodiments of the present disclosure may be performed in different orders and / or in parallel, and that method embodiments may include additional steps and / or omit the performance of steps that are shown, and the scope of the present disclosure is not limited in this respect.

[0017] As used herein, the term "including" and variations thereof are open-ended, i.e., "including, but not limited to." The term "based on" means "based at least in part on." The term "in one embodiment" refers to "at least one embodiment," the term "in another embodiment" refers to "at least one other embodiment," and the term "in some embodiments" refers to "at least some embodiments." Relevant definitions of other terms are provided in the description below.

[0018] It should be noted that concepts such as "first" and "second" referred to in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order or interdependence of functions performed by these devices, modules or units.

[0019] It should be understood that the modifications "a" and "multiple" referred to in this disclosure are exemplary rather than limiting, and that one of ordinary skill in the art would understand "one or more" unless the context clearly indicates otherwise.

[0020] The names of messages or information interacted between multiple devices in the embodiments of the present disclosure are used for descriptive purposes only and are not used to limit the scope of these messages or information.

[0021] Related art generally adopts automatic text conversion technology or table to text conversion technology, where: The automatic text conversion technology generally performs inter-language conversion of different languages ​​or converts a specific text format, such as converting Chinese text to English text and converting an article to an abstract, where the table-to-text conversion technology sets specific punctuation marks where necessary by setting the association relationship between each row, column and table frame based on the information table of the structured data, and obtains the table frame content with punctuation marks after deleting the table frame, which is equivalent to listing the table frame content and inserting symbols. The above two technical solutions cannot edit the text for the text content, and cannot correct the accuracy and fluency of the text content, so that when the user uses the converted text, factual errors and word order disturbances will occur.

[0022] The technical solution of the embodiment of the present disclosure provides a method for generating text sequences, which can be applied to various information editing systems. The method for generating text sequences can be applied to a text editing system, which includes one or more storage areas, where the one or more storage areas merge sequences by an algorithm, and filter different types of sequences having facts associated therewith to merge the filtered sequences to generate a new sequence. Here, the one or more storage areas of the text editing system can be implemented in various personal computers, notebook computers, intelligent mobile phones, tablet computers and portable wearable devices, servers and / or server clusters consisting of multiple servers.

[0023] Example 1 1 is a flowchart of a text sequence generating method according to a first embodiment of the present disclosure, which can be applied to various text editing scenarios to generate a new text sequence based on an existing text sequence. The method is performed by a text sequence generating device, which may be realized in a software and / or hardware manner, and specifically, may be implemented in an electronic device for text processing with memory and computing capabilities.

[0024] As shown in FIG. 1, a method for generating a text sequence is provided, which includes the following steps:

[0025] Step 110: obtain an initial text sequence and extract initial text features from the initial text sequence.

[0026] An initial text sequence is an existing text sequence, which corresponds to a source text sequence and is the material used to generate a new target text sequence. An initial text sequence may be an independent phrase containing a few or a few dozen vocabulary words, or it may be an entire article containing several independent words. Each element of the sequence corresponds to one vocabulary word.

[0027] The initial text features extracted from the initial text sequence are feature sequences that can characterize the features of each vocabulary, and the initial text features may be a vocabulary sequence or a vector of coding values ​​corresponding to the vocabulary. There are various methods for extracting the initial text features, and for example, the initial text sequence can be input into a bidirectional long short-term memory recurrent neural network to extract the initial text features.

[0028] Wherein, the initial text sequence is a vector of at least one initial text lexical coding value, and can be inputted into a bidirectional long short-term memory recurrent neural network to extract the initial text features. The bidirectional long short-term memory recurrent neural network is a method for extracting the initial text features. For example, inputting the initial text sequence into a bidirectional long short-term memory recurrent neural network may be to classify the initial text sequence using a bidirectional long short-term memory recurrent neural network, and generate associated feature parameters for each category to obtain the initial text features.

[0029] Step 120 obtains a structured text sequence associated with the facts in the initial text sequence, and extracts structured features from the structured text sequence.

[0030] A structured text sequence is an existing factual text sequence, which corresponds to a factual source text sequence and is used to compare and correct the initial text sequence. A structured text sequence is structured data, which may be a cell containing a few or a few dozen vocabulary words, or a complete table containing multiple cells. Each element of the sequence corresponds to a vocabulary word.

[0031] The structured features extracted from the structured text sequence are feature sequences capable of characterizing a fact, and the structured features may be a vocabulary sequence or a vector of coding values ​​corresponding to the vocabulary.

[0032] Here, the structured text sequence is associated with facts in the initial text sequence, i.e., the structured text sequence is associated with the fact content of the initial text sequence, which may be, for example, all fact structured vocabulary retrieved from the vocabulary in the initial text sequence, and all retrieved fact structured vocabulary is effectively associated with the initial text sequence.

[0033] Specifically, there are various methods for extracting structured features, for example, at least one fact triplet can be determined from the structured text sequence, and then the semantically stitched multiple fact triplet can be input into a fully connected neural network and extracted as structured features of the structured text sequence. Essentially, multiple fact triplet can be stitched to obtain an overall fact triplet sequence of the structured text sequence, and a fully connected neural network can be utilized to perform classification and hierarchical association to obtain the structured features.

[0034] The operation of obtaining a structured text sequence and extracting structured features from the structured text sequence may specifically include determining at least one fact triplet including a subject, a predicate and an object based on the structured text sequence, inputting the fact triplet into a fully connected neural network, and stitching a fact triplet sequence to form the structured feature.

[0035] Determine at least one fact triplet based on the structured text sequence, for example, if the structured text sequence is a table, determine the fact triplet of the table, determine the important vocabulary of the table as the first element, determine the columns of the table as the second element, and determine the content corresponding to the columns of the table as the third element, and in this manner determine multiple fact triplet of the table, stitch the subject, predicate and object of the fact triplet, and input them into a fully connected neural network to form a fact triplet sequence as the structured feature.

[0036] For example, a structured text sequence is shown in the following table: [Table 1] A fact triplet extracted therefrom is, for example, <Yao Ming, hometown, Shanghai>. Multiple fact triplets can be similarly extracted and stitched together to form the structured features of this information table.

[0037] Step 130, based on the initial text features and the structural features, fuse to generate a target text sequence.

[0038] Here, fusing and generating a target text sequence based on the initial text features and the structural features may comprise using the initial text features and the structural features to fuse the initial text sequence and the structured text sequence to generate a target text sequence.

[0039] Here, using the initial text features and the structural features to fuse the initial text sequence with the structured text sequence to generate a target text sequence may include identifying target text features based on the structural features and the initial text features, and thereby generating the target text sequence based on the target text features.

[0040] In the above text sequence generation method, the initial text sequence and the structured text sequence fusion technology are used to realize fusion of different types of text sequences in which facts are associated, thereby solving technical problems such as the situation where factual errors or omissions exist in text-to-text conversion technology and the text obtained by table-to-text conversion technology is stiff and not fluent, and improving the accuracy and fluency of text editing.

[0041] Example 2 2A is a flowchart of a method for generating a text sequence according to the second embodiment of the present disclosure. The technical solution of this embodiment is further subdivided based on the above technical solution, and specifically, mainly includes the following steps:

[0042] Step 210: obtain an initial text sequence and extract initial text features from the initial text sequence.

[0043] Step 220 obtains a structured text sequence associated with a fact in the initial text sequence, and extracts structured features from the structured text sequence.

[0044] Step 230: filtering the initial text features based on the structural features, and correcting the text content of the initial text features based on the structural features, and fusing to generate the target text sequence.

[0045] The facts reflected in the structured text sequence are generally accurate and refined, while the factual representation in the initial text sequence may be inaccurate and contain various redundant information. Therefore, the structured features can be used to filter the initial text features to correct the text content, so that the two contents can be fused to generate a target text sequence.

[0046] The process of fusing to generate a target text sequence may be realized in several ways, specifically: As shown in FIG. 2B, the first draft of the article can be used as an initial text sequence, which can be input to module A, which can extract initial text features, and processed to generate initial text features. This can be used as a representation of the first draft of the article, and the information table can be input to module B, which can be processed to generate structured features. This can be used as a representation of the information table, and then the initial text features and the structured features can be stitched in module C to form a combined vectorized feature, which can be used as article identification. This corresponds to further including: inputting the initial text features and the structured features into a fully connected neural network to perform feature stitching to generate target text features before fusing to generate a target text sequence based on the initial text features and the structured features; and then inputting the stitched target text features into module D to generate a target text sequence as a target article. Each of the above modules may be realized by a neural network as a deep learning model, so that a text conversion model can be built to convert the overall initial text sequence + structured text sequence into a target text sequence, and a large amount of triplet data samples such as "first draft of article, article, information table" can be used to train the text conversion model. The text conversion model is learned and updated by stochastic gradient descent and backpropagation.

[0047] Alternatively, as shown in FIG. 2C, the first draft of the article can be used as the initial text sequence, which can be input to module A, which can extract initial text features, and processed to generate initial text features, which can be used as a representation of the first draft of the article, and the information table can be input to module B as a structured text sequence and processed to generate structured features, which can be used as a representation of the information table, and then the initial text features and the structured features can be input to module D, respectively, to generate a target text sequence, which can be used as the target article. Each of the above modules can be realized by a neural network as a deep learning model, so that a text conversion model can be built to convert the overall initial text sequence + structured text sequence into a target text sequence, and a large amount of data samples of triplets such as "first draft of article, article, information table" can be used to train the text conversion model.

[0048] The technical solution of the embodiments of the present disclosure can edit existing text sequences, does not need to directly generate target articles from structured information tables, and can train and build a text conversion model with only a small amount of data samples, which is easier to implement, and the factual expression of the converted target articles is more accurate, and the text is more fluent and natural.

[0049] Example 3 3 is a flowchart of a text sequence generating method according to the third embodiment of the present disclosure. Based on the above embodiment, the present embodiment further introduces an implementation form of generating a target text sequence by fusing initial text features and structural features. The method includes the following steps:

[0050] Step 310: obtain an initial text sequence and extract initial text features from the initial text sequence.

[0051] Step 320 obtains a structured text sequence associated with the facts in the initial text sequence, and extracts structured features from the structured text sequence.

[0052] Step 330: set each initial text feature as a current initial text feature.

[0053] The embodiment can process the sequenced initial text features one by one, for example, an existing article actually includes multiple initial text sequences in sequence, and the initial text features of each initial text sequence can be processed one by one as the current initial text feature.

[0054] Step 340: fact-matching the current initial text feature with the structural feature, and determining an action to be taken for the current initial text feature based on a fact-matching result.

[0055] Take an article as an example, the article may contain factual explanations and other auxiliary explanations, and the target text sequence converted in this embodiment should mainly contain factual explanation text, so that the text of non-factual explanations can be filtered. The specific method of filtering may be to perform fact matching between the current initial text features and each structured feature, and use the facts in the structured features to filter the initial text features of non-factual explanations. The filtering operation is completed by determining different execution operations.

[0056] The operation of fact matching in step 340 may specifically be to input the current initial text feature and the structured feature into a long short-term memory recurrent neural network to perform fact matching, and determine an execution action for the current initial text feature according to the fact matching result, which corresponds to traversing and matching the current initial text feature with each structured feature.

[0057] Step 350, the current initial text features are processed based on the executed actions to generate the target text sequence.

[0058] Specific execution operations can be used to realize filtering of non-factual text features and correcting real-time text features, and preferably, the execution operations may include discarding, retaining and generating.

[0059] In an embodiment of the present disclosure, the following operations are optionally performed to determine an execution action and a corresponding execution method for the current initial text feature based on the fact matching result. If a structural feature exists that matches the current initial text feature, and the current initial text feature matches the text content of the matched structural feature, the execute action is pending. If a structural feature exists that matches the current initial text feature, and the current initial text feature does not match the text content of the matched structural feature, the action taken is stitching generation. If there is no structural feature that matches the current initial text feature, the action taken is to discard.

[0060] Accordingly, processing the current initial text features to generate the target text sequence based on the execution action includes: if the execution action is pending, reserving the current initial text feature as the target text feature; If the execution operation is stitching generation, stitching and generating the target text feature based on the structural feature that is matched with the current initial text feature; if the action to be performed is discard, filtering and discarding the current initial text features; generating the target text sequence based on the target text features.

[0061] The non-real-time explanatory text can be discarded by performing corresponding operations on the initial text features, or the fact explanatory text can be retained, or a more fluent target text sequence can be generated based on the structured features aligned with the initial text features, and the target text features can be generated by first performing operations, and then the target text sequence can be generated by recovering the target text features.

[0062] The technical solutions of the embodiments of the present disclosure can adopt different execution operations for each initial text sequence to screen, correct and merge the initial text sequence based on the structured text sequence, thereby generating a target text sequence that is accurate in explaining facts and natural and fluent in expression.

[0063] Example 4 Example 4 of the present disclosure provides a text sequence generation method, and this example further introduces a specific implementation form of the text sequence generation method based on the above Examples 1 to 3. The method includes: obtaining an initial text sequence and extracting initial text features from the initial text sequence; obtaining a structured text sequence associated with a fact in the initial text sequence and extracting structured features from the structured text sequence; setting each initial text feature as a current initial text feature; fact-matching the current initial text feature with the structural feature, and determining an action to be taken for the current initial text feature based on a fact-matching result; Here, the specific implementation of the algorithm for fact-matching the current initial text feature with the structured feature, determining an execution action for the current initial text feature based on the fact-matching result, and determining an execution action for the current initial text feature based on the fact-matching result is as follows:

[0064] The current fact vector is based on the following formula: (outside 1) TIFF0007553202000002.tif9127 (hereinafter, "t ~ t ", etc.) Calculate

number

number

number

number

[0065] The above formula (1) specifically represents the current initial text feature b t and the current target text feature s t Let be a query, and then we search for all structured features t j Using the attention mechanism, we use the key value (key) to find the fact vector t ~ t Calculate.

[0066] The action selection decision vector z t and the operation selection parameter W a Based on the multiplication result, the action decision probability p(action|z t ) is determined, Here, W a are parameters waiting for training, and the actions include three preset types: discard, hold, and create.

[0067] An execution action of the current initial text sequence is determined based on an action decision probability.

[0068] Based on the executed actions, the current initial text features are processed to generate the target text sequence.

[0069] That is, the text conversion model completes a traversal operation of structured features through a time-series long short-term memory recurrent neural network, and at each point in time, the model can perform one of three execution actions: withhold, discard, and generate.

[0070] For the execution operations of discard, retain and generate, discard is that the current initial text feature can be discarded and will not be incorporated into the target text feature, retain can be that the current initial text feature is retained and used as the target text feature directly, and generate is the operation that is more complicated and needs to correct the current initial text feature based on the structural feature. The details of the generate operation are as follows: Optionally, the step of stitching and generating the target text feature based on a structural feature aligned with the current initial text feature comprises: determining a new vocabulary based on the candidate vocabulary, the candidate vocabulary being a word in a vocabulary library and a word in the structured text sequence; calculating a probability of generating each of the candidate vocabulary as a new vocabulary, and determining the new vocabulary based on the probability of generating; The new vocabulary is mapped to generate a sequence vector, and the current fact vector t ~ t and stitching the resulting text features together to generate target text features.

[0071] The above technical solution specifically selects which new vocabulary to generate for generating a target text sequence based on the vocabulary of the original structured text sequence and other vocabulary in the added vocabulary library jointly, where the vocabulary library includes a large amount of available vocabulary, not limited to the vocabulary in the structured text sequence and the initial text sequence.

[0072] The vector representing the new vocabulary is the projection matrix Wp By mapping, we can generate sequence vectors as text features representing new vocabulary. This projection matrix W p are similarly used as parameters while training the model.

[0073] In the above process, the step of selectively calculating a probability of generating each of the candidate vocabulary words as a new vocabulary word by using the vocabulary words in the vocabulary library and the vocabulary words in the structured text sequence as candidate vocabulary words, and determining the new vocabulary words based on the probability of generating the new vocabulary words may include: The source probability P that the source of new vocabulary is a vocabulary library or a structured text sequence according to the following formula: gate and calculating

number

number

[0074] In the above probability calculation process, we first calculate the source probability, that is, the probability that a completely new vocabulary should be generated from a vocabulary library, or the probability that a vocabulary should be copied from a structured text sequence. The occurrence probability represents the probability that a candidate vocabulary is selected from a vocabulary library, and the copy probability represents the probability that a candidate vocabulary is selected from a structured text sequence. Finally, we calculate the total generation probability.

[0075] Example 5 The fifth embodiment of the present disclosure provides a text sequence generating method, which is based on the above embodiment and specifically introduces the sequential processing of text vocabulary by setting up a cache area.

[0076] Optionally, a plurality of cache areas can be established to store and sequence vectorized data, such as initial text sequence, initial text feature, structured text sequence, structured feature, target text feature and target text sequence. That is, the method optionally includes: storing the extracted initial text features in an initial cache area; storing the extracted structural features in a fact cache area; Accordingly, the step of fusing to generate a target text sequence based on the initial text features and the structural features includes: The method includes the step of sequentially extracting initial text features currently pending from the initial cache area and fusing them with structural features from the fact cache area to generate a target text sequence.

[0077] Specifically, three cache areas can be set up corresponding to FIG. 2B or FIG. 2C.

[0078] Initial cache area: initial text sequence and initial text features b t In the initial cache area, the initial text sequence is calculated through a bidirectional long short-term memory recurrent neural network to obtain the initial text features; Fact cache area: A set of factual triplets (subject, predicate, object), i.e. structured text sequences, and the corresponding structured features t j is used to store j, where 1 ≤ j ≤ M, and the fact cache In the area, the vector representation of the fact triplet is stitched with the vector representations of the subject, predicate and object, and then the structured features are obtained through a fully connected neural network. Edit cache area: Used to store the edit data stream, i.e., the target text sequence and the target text features s t In the edit cache area, the initial target text feature is calculated by averaging all the vectors in the initial cache area. cache After averaging all the vectors in the area, it can be obtained through another fully connected neural network. Then, the text features of each time are calculated and obtained by a long short-term memory recurrent neural network.

[0079] In the process of model calculation, the current initial text features are sequentially extracted from the initial cache area, and the current fact vector t ~ t and extract the current initial text feature vector b t Let t be the current fact vector. ~ t , i.e., the current initial text feature vector b t and the current fact vector t ~ t The actual feature content can be compared with the actual content. According to the result of comparing the actual content, the execution action is obtained, and the target text feature after performing text processing according to the execution action is further stored in an editing cache area.

[0080] Below, we will combine the attached drawings to show three executions: operation The processing process based on the cache area will now be described.

[0081] 1) Reserved (also called copy): Current initial text feature b in the initial cache area t and the current fact vector t ~ t to a long short-term memory recurrent neural network corresponding to the edited data stream, and generate new current target text features s t and moves the scan pointer of the initial cache area backward once to prepare to start processing the next initial text feature.

[0082] As shown in FIG. 4A, the initial text feature is cached in an initial cache area (Buffer), and the current initial text feature vector b t and extract the current fact vector t from the structured features. ~ t and extract the current initial text feature vector b t and the current fact vector t~ t and compare the actual feature content of the current initial text feature vector b t and the current fact vector t ~ t The actual feature content of the execution operation is consistent with that of the current initial text feature vector b t The current target text features s t Copy to.

[0083] 2) Discarding (also called deletion): As shown in FIG. 4B, the initial text features are cached in an initial cache area (Buffer), and the current initial text feature vector b t and extract the current fact vector t from the structured features. ~ t Extract the current fact vector t ~ t If it is found that there is no structural feature associated with the initial text feature, there is no paired result, and the actual execution information of the execution operation is discarded, the current initial text feature vector b t skipping and proceeding to the next time, and converting the initial text feature into the current initial text feature vector b t+1 and repeat the above operations. The current target text feature in the edited data stream is unchanged.

[0084] 3) Generation: As shown in FIG. 4C, the initial text features are cached in a cache area (Buffer), and the current initial text feature vector b is generated from the initial text features. t and extract the current fact vector t from the structured features. ~ t and extract the current initial text feature vector b t and the current fact vector t ~ tand compare the actual feature content of the current initial text feature vector b t and the current fact vector t ~ t Since the actual feature content of the execution operation is not consistent, it is necessary to obtain and calculate the stitching generation, which is the actual execution information of the execution operation, and to apply the newly generated vocabulary to the current fact vector t ~ t Then, we stitch it to the current target text feature s t Assign to.

[0085] In the above text sequence generation method, the initial text features and the structured features are extracted for the initial text sequence and the structured text sequence based on multiple neural networks, the initial text features are matched with the structured features to obtain execution actions, and a target text sequence is generated based on the execution actions, thereby solving technical problems such as the situation where factual errors or omissions exist in text-to-text conversion technology and the text obtained by table-to-text conversion technology is stiff and not fluent, and improving the accuracy and fluency of text editing.

[0086] Example 6 5 is a structural schematic diagram of a text sequence generating apparatus according to the sixth embodiment of the present disclosure. The apparatus includes: an initial text feature extraction module 510, a structured feature extraction module 520, and a fusion module 530.

[0087] Here, the initial text feature extraction module 510 is used to extract initial text features of an initial text sequence, the structured feature extraction module 520 is used to extract structured features of a structured text sequence, and the fusion module 530 is used to fuse the initial text features and the structured features to generate a target text sequence based on the initial text features and the structured features.

[0088] In the embodiments of the present disclosure, a method for generating a text sequence is combined with a text sequence and a structured text sequence to improve the fluency of a target text sequence generated by the text sequence, and the structured text sequence improves the factual accuracy of the target text sequence, thereby solving technical problems such as the existence of factual errors or omissions in text-to-text conversion technology and the text obtained by structured data-to-text conversion technology being stiff and not fluent, thereby improving the accuracy and fluency of text editing.

[0089] Optionally, the initial text feature extraction module 510 includes a feature extraction unit: The feature extraction unit is used to take an initial text sequence and input it into a bidirectional long short-term memory recurrent neural network to extract the initial text features.

[0090] In addition, the structured feature extraction module 520 includes a fact triplet determination unit; A fact triplet determination unit is used for determining at least one fact triplet including a subject, a predicate and an object based on the structured text sequence, and inputting the fact triplet into a fully connected neural network to stitch together a fact triplet sequence to form the structured feature.

[0091] In addition, the fusion module 530 includes a filtering unit and a correction unit; a filtering unit is used for filtering the initial text features based on the structural features and fusing them to generate a target text sequence; A correction unit is used for correcting the text content of the initial text features based on the structural features and fusing them to generate a target text sequence.

[0092] Furthermore, the filtering unit and the correcting unit include a current sub-unit, an execution action determining unit, and a target sequence generating unit; The current subunit is used to set each initial text feature as a current initial text feature, an execution action determination unit is used for fact-matching the current initial text feature with the structural feature, and determining an execution action for the current initial text feature according to a fact-matching result; A target sequence generation unit is used for processing the current initial text features based on the execution action to generate the target text sequence.

[0093] Furthermore, the execution action determination unit specifically determines whether or not there is a structured feature that matches the current initial text feature, and the current initial text feature matches the text content of the matched structured feature, and the execution action is pending. Decide thing, If there is a structured feature that matches the current initial text feature, and the current initial text feature does not match the text content of the matched structured feature, the action to be performed is stitching generation. Decide thing, If there is no structural feature that matches the current initial text feature, then the action taken is to discard. Decide Or, The current initial text feature and the structured feature are input to a long short-term memory recurrent neural network for fact matching, and are used to determine an execution action for the current initial text feature based on a fact matching result.

[0094] Furthermore, the target sequence generation unit is specifically used for retaining the current initial text features as the target text features when the execution operation is retaining, stitching and generating the target text features based on structured features matched with the current initial text features when the execution operation is stitching generation, and filtering and discarding the current initial text features and generating the target text sequence based on the target text features when the execution operation is discarding.

[0095] Optionally, the execution action determination unit specifically determines the current fact vector t according to the following formula: ~ t Calculate

number

[0096] Further, the target sequence generating unit includes a stitching generating subunit; The stitching generation subunit calculates a generation probability of each candidate vocabulary as a new vocabulary based on the generation probability, maps the new vocabulary to generate a sequence vector, and generates a current fact vector t. ~t and then stitched together to generate target text features.

[0097] In addition, the stitching generation subunit, specifically, calculates a source probability P gate Calculate P gate =sigmoid(ω T g z t +a g ) Here, ω T g and a g are the parameters to be trained, sigmoid( ) is the activation function, The probability of occurrence of the candidate vocabulary in the vocabulary library p is calculated according to the following formula: gen (y t |z t ) and p gen (y t |z t )=softmax(W y z t ) Here, W y are the parameters waiting to be trained, and y t is the new vocabulary to be generated, softmax( ) is the cost function of the regression algorithm, The copy probability p of the candidate vocabulary in the structured text sequence is calculated according to the following formula: copy of p copy =(o j |z t ) ∝ exp(v c tanh(W c ·[z t ;t j ])) where v c and W c are the parameters waiting to be trained, and o j is a fact triplet of the candidate vocabulary, The probability of generating new vocabulary based on the source probability, occurrence probability, and copy probability is calculated as

number

[0098] Moreover, the apparatus further includes at least one cache area, adapted to store the extracted initial text features in an initial cache area and to store the extracted structural features in a fact cache area. Accordingly, fusing to generate a target text sequence based on the initial text features and the structural features includes: sequentially extracting the currently pending initial text features from the initial cache area, and fusing them with the structural features in the fact cache area to generate a target text sequence.

[0099] Furthermore, the device Special The method further includes a feature stitching module, A feature stitching module is used to input the initial text features and the structural features into a fully connected neural network to perform feature stitching.

[0100] The text sequence generating device provided in the above embodiment can execute the text sequence generating method according to any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.

[0101] Reference is now made to FIG. 6, which shows a structural schematic diagram of an electronic device 600 suitable for implementing embodiments of the present disclosure.

[0102] 6, the electronic device 600 may include a processing unit (e.g., a central processor, a graphics processor, etc.) 601, which can execute various appropriate operations and processes based on a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are stored. The processing unit 601, the ROM 602, and the RAM 603 are interconnected by a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0103] Typically, devices such as input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyro, etc., output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc., storage devices 608 including, for example, a magnetic tape, hard disk, etc., and communication devices 609 can be connected to the I / O interface 605. The communication devices 609 can allow the electronic device 600 to communicate wirelessly or wired with other devices to exchange data. In FIG. 6, the electronic device 600 is shown having various devices, but it should be understood that it is not required to implement or include all the devices shown. More or fewer devices can alternatively be implemented or included.

[0104] In particular, the processes described with reference to the flowcharts above according to the embodiments of the present disclosure can be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded from a network by the communication device 609, installed, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, it executes the steps in the method of the embodiments of the present disclosure and realizes the above-mentioned limited functions.

[0105] An embodiment of the present disclosure further provides a computer program product, the computer program product including: a computer program, the computer program being stored in a readable storage medium, one or more processors of an electronic device being able to read the computer program from the readable storage medium, and the one or more processors being able to execute the computer program to cause the electronic device to execute the method according to any one of the above embodiments.

[0106] An embodiment of the present disclosure further provides a computer program, which is stored in a readable storage medium, and one or more processors of an electronic device can read the computer program from the readable storage medium, and the one or more processors execute the computer program to cause the electronic device to implement the technical solution according to any one of the above embodiments.

[0107] It should be noted that the computer-readable medium of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of both. The 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 of the above. More specific examples of the computer-readable storage medium may include, but are not limited to, an electrical connection having one or more conductors, a portable computer magnetic disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact magnetic disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device. However, in this disclosure, a computer-readable signal medium may be included in baseband or may be a propagated data signal that is part of a carrier and carries computer-readable program code. Such a propagated data signal may take a number of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which may transmit, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code included in the computer-readable medium may be transmitted over any suitable medium, including, but not limited to, electrical wire, optical cable, RF (radio frequency), or the like, or any suitable combination of the above.

[0108] In some embodiments, the clients and servers may communicate using any now known or later developed network protocol, such as HyperText Transfer Protocol (HTTP), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the internet), and end-to-end networks (e.g., ad hoc end-to-end networks), and any now known or later developed networks.

[0109] The computer-readable medium may be included in the electronic device, or may be separate from the electronic device.

[0110] The computer-readable medium stores one or more programs, and when the one or more programs are executed by the electronic device, the electronic device obtains at least two Internet Protocol addresses and sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, where the node evaluation device selects and returns an Internet Protocol address from the at least two Internet Protocol addresses, and receives the Internet Protocol address returned by the node evaluation device, where the obtained Internet Protocol address indicates an edge node in a content distribution network.

[0111] Alternatively, the computer-readable medium has one or more programs stored thereon, and when the one or more programs are executed by the electronic device, the electronic device receives a node evaluation request including at least two Internet Protocol addresses, selects an Internet Protocol address from the at least two Internet Protocol addresses, and returns the selected Internet Protocol address, where the received Internet Protocol address indicates an edge node in a content delivery network.

[0112] Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages ​​or combinations thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and also including general procedural programming languages ​​such as "C" or similar. The program code can be executed entirely on the user computer, partially on the user computer, as one separate software package, partially on the user computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user computer by any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet Service Provider).

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the system architecture, functions and operations that can be realized according to the system, method and computer program product of various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, program segment or part of code, which includes one or more executable instructions for implementing the defined logical function. It should be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than the order noted in the accompanying drawings. For example, two successively shown blocks may actually be executed essentially in parallel, and they may be executed in the reverse order depending on the functions involved. It should be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be realized based on a system of dedicated hardware that executes the defined functions or operations, or may be realized by a combination of dedicated hardware and computer instructions.

[0114] The units described and related to the embodiments of the present disclosure may be implemented in a software manner or a hardware manner, where the name of a unit does not constitute a limitation on the unit itself in some cases, for example, the first obtaining unit may be further described as "a unit for obtaining two Internet Protocol addresses".

[0115] The functions described herein may be performed, at least in part, by one or more hardware logic components, such as, but not limited to, exemplary types of hardware logic components that may be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0116] In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, device or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any suitable combination of the above contents. More specific examples of machine-readable storage media include one or more wire-based electrical connections, portable computer desks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above contents.

[0117] According to one or more embodiments of the present disclosure, a method for generating a text sequence is provided, the method comprising: obtaining an initial text sequence and extracting initial text features from the initial text sequence; obtaining a structured text sequence associated with a fact in the initial text sequence and extracting structured features from the structured text sequence; and fusing the initial text features and the structural features to generate a target text sequence.

[0118] According to one or more embodiments of the present disclosure, in the above method, the step of fusing the initial text features and the structural features to generate a target text sequence includes: The method includes filtering the initial text features based on the structural features, and correcting text content of the initial text features based on the structural features to fuse them together to generate the target text sequence.

[0119] According to one or more embodiments of the present disclosure, in the above method, the step of filtering the initial text features based on the structural features, and correcting the text content of the initial text features based on the structural features to fuse to generate the target text sequence includes: setting each initial text feature as a current initial text feature; fact-matching the current initial text feature with the structural feature, and determining an action to be taken for the current initial text feature based on a fact-matching result; and processing the current initial text features based on the executed actions to generate the target text sequence.

[0120] According to one or more embodiments of the present disclosure, in the above method, the step of determining an action to be taken on the current initial text feature based on a fact matching result includes: If there is a structured feature that matches the current initial text feature, and the current initial text feature matches the text content of the matched structured feature, the execute action is pending. Decide Steps and If there is a structured feature that matches the current initial text feature, and the current initial text feature does not match the text content of the matched structured feature, the action to be performed is stitching generation. Decide Steps and If there is no structural feature that matches the current initial text feature, then the action taken is to discard. Decide and Accordingly, processing the current initial text features to generate the target text sequence based on the execution action includes: if the execution action is pending, reserving the current initial text feature as the target text feature; If the execution operation is stitching generation, stitching and generating the target text feature based on the structural feature that is matched with the current initial text feature; if the action to be performed is discard, filtering and discarding the current initial text features; generating the target text sequence based on the target text features.

[0121] According to one or more embodiments of the present disclosure, in the above method, the step of fact-matching the current initial text feature with the structured feature and determining an execution action for the current initial text feature based on a fact-matching result includes: The method includes inputting the current initial text feature and the structural feature into a long short-term memory recurrent neural network for fact matching, and determining an action to be taken for the current initial text feature based on a fact matching result.

[0122] According to one or more embodiments of the present disclosure, in the above method, the step of obtaining an initial text sequence and extracting initial text features from the initial text sequence includes: The method includes taking an initial text sequence and inputting it into a bidirectional long short-term memory recurrent neural network to extract features of the initial text.

[0123] According to one or more embodiments of the present disclosure, in the above method, the steps of obtaining a structured text sequence and extracting structured features from the structured text sequence include: determining at least one fact triplet including a subject, a predicate, and an object based on the structured text sequence; inputting the fact triplets into a fully connected neural network to stitch together a fact triplet sequence to form the structured feature.

[0124] According to one or more embodiments of the present disclosure, in the above method, the step of fact-matching the current initial text feature with the structured feature and determining an execution action for the current initial text feature based on a fact-matching result includes: The current fact vector t is calculated based on the following formula: ~ t and calculating

number

[0125] According to one or more embodiments of the present disclosure, in the above method, the step of stitching and generating the target text feature based on the structured feature aligned with the current initial text feature includes: determining a new vocabulary based on the candidate vocabulary, the candidate vocabulary being a word in a vocabulary library and a word in the structured text sequence; calculating a probability of generating each of the candidate vocabulary as a new vocabulary, and determining the new vocabulary based on the probability of generating; The new vocabulary is mapped to generate a sequence vector, and the current fact vector t ~ t and stitching the resulting text features together to generate target text features.

[0126] According to one or more embodiments of the present disclosure, in the above method, the step of calculating a generation probability of each candidate vocabulary as a new vocabulary, using the vocabulary in a vocabulary library and the vocabulary in the structured text sequence as candidate vocabulary, and determining the new vocabulary based on the generation probability includes a source probability P gate and calculating P gate =sigmoid(ω T g z t +a g ) (where ω T g and a g are the parameters to be trained, and sigmoid( ) is the activation function. The probability of occurrence of the candidate vocabulary in the vocabulary library p is calculated according to the following formula: gen (y t |z t ) and p gen (y t |z t )=softmax(W y z t ) (Where, y are the parameters waiting to be trained, and y t is the new vocabulary to be generated, and softmax( ) is the cost function of the regression algorithm. The copy probability p of the candidate vocabulary in the structured text sequence is calculated according to the following formula: copy of p copy =(o j |z t ) ∝ exp(v c tanh(W c ·[z t ;t j ])) and calculating (where v c and W c are the parameters waiting to be trained, and oj is a fact triplet of the candidate vocabulary) The probability of generating new vocabulary based on the source probability, occurrence probability, and copy probability is calculated as

number

[0127] Based on one or more embodiments of the present disclosure, storing the extracted initial text features in an initial cache area; storing the extracted structural features in a fact cache area; Accordingly, the step of fusing to generate a target text sequence based on the initial text features and the structural features includes: The method includes the step of sequentially extracting initial text features currently pending from the initial cache area and fusing them with structural features from the fact cache area to generate a target text sequence.

[0128] According to one or more embodiments of the present disclosure, in the above method, before the step of fusing the initial text features and the structural features to generate a target text sequence, The method further includes inputting the initial text features and the structured features into a fully connected neural network to perform feature stitching.

[0129] According to one or more embodiments of the present disclosure, there is provided a device for generating a text sequence, the device comprising: an initial text feature extraction module for extracting initial text features of the initial text sequence; a structured feature extraction module for extracting structured features from the structured text sequence; and a fusion module for fusion to generate a target text sequence based on the initial text features and the structural features.

[0130] According to one or more embodiments of the present disclosure, the electronic device in the method includes: one or more processors; and a memory for storing one or more programs; The one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method for generating a text sequence as described in any one of the disclosed embodiments.

[0131] Based on one or more embodiments of the present disclosure, the computer-readable storage medium in the above method stores a computer program, which, when executed by a processor, realizes the method for generating a text sequence described in any one of the embodiments of the disclosure.

[0132] The above description is merely a description of the preferred embodiments and the technical principles of the present disclosure. Those skilled in the art should understand that the disclosure scope of the present disclosure is not limited to the technical solutions based on the specific combination of the above technical features, but should also include other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept disclosed above. For example, the above features and the technical features having similar functions (but not limited to) disclosed in the present disclosure are substituted with each other to form a technical solution.

[0133] It should be noted that although each operation is depicted in a particular sequence, it should not be understood that these operations are required to be performed in the particular sequence or order shown. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although the above discussion includes certain specific implementation details, these should not be construed as limitations on the scope of the disclosure. Any features that are described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may be implemented in multiple embodiments alone or in any suitable subcombination.

[0134] Although the present subject matter has been described employing language specific to structural features and / or methodological operations, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or operations described above. Rather, the specific features and operations described above are merely example forms of implementing the claims.

Claims

1. A method for generating a text sequence executed by a text sequence generation device, comprising: obtaining an initial text sequence, which is an entire article containing a number of independent words; and extracting from the initial text sequence initial text features, which are vectors of coding values ​​corresponding to each word in the initial text sequence; obtaining a structured text sequence, which is all fact structured vocabulary retrieved from each vocabulary in the initial text sequence associated with facts in the initial text sequence, and extracting from the structured text sequence structured features, which are vectors of coding values ​​corresponding to each vocabulary in the structured text sequence; generating a target text sequence based on the initial text features and the structural features; The step of generating a target text sequence based on the initial text features and the structural features comprises: filtering the initial text features based on the structural features, and correcting text content of the filtered initial text features based on the structural features to generate the target text sequence; The steps of filtering the initial text features based on the structural features and correcting the text content of the filtered initial text features based on the structural features to generate the target text sequence include: each of the initial text features extracted from the initial text sequence as a current initial text feature; fact-matching the current initial text feature with the structural feature, and determining an action to be taken for the current initial text feature based on a fact-matching result; processing the current initial text features based on the executed actions to generate the target text sequence; determining an action to be taken for the current initial text feature based on a fact matching result, determining that an action to be performed is pending if a structured feature exists that matches the current initial text feature and the current initial text feature matches the text content of the matched structured feature; determining that the action to be performed is a join creation if a structured feature exists that matches the current initial text feature and the current initial text feature does not match the text content of the matched structured feature; if there is no structural feature that matches the current initial text feature, determining that the action to be taken is discard; Accordingly, processing the current initial text features to generate the target text sequence based on the executed actions includes: if the execution action is pending, reserving the current initial text feature as a target text feature; if the execution operation is join generation, then joining the current initial text feature and the structured feature that is matched with the current initial text feature to generate the target text feature; if the action to be performed is discard, filtering and discarding the current initial text features; generating the target text sequence based on the target text features.

13. A method for generating a text sequence, comprising:

2. The step of fact-matching the current initial text feature with the structural feature and determining an action to be taken for the current initial text feature based on a fact-matching result, inputting the current initial text feature and the structured feature into a long short-term memory recurrent neural network for fact matching; and determining an execution action for the current initial text feature based on a fact matching result.

2. The method of claim 1 .

3. The step of obtaining an initial text sequence and extracting initial text features from the initial text sequence comprises: taking an initial text sequence and inputting it into a bidirectional long short-term memory recurrent neural network to extract the initial text features; 2. The method of claim 1 .

4. The step of obtaining a structured text sequence and extracting structured features from the structured text sequence comprises: determining at least one fact triplet including a subject, a predicate, and an object based on the structured text sequence; inputting the fact triplet into a fully connected neural network to stitch together a fact triplet sequence to form the structured feature; 2. The method of claim 1 .

5. The step of fact-matching the current initial text feature with the structural feature and determining an action to be taken for the current initial text feature based on a fact-matching result, The current fact vector is based on the following formula: (Outside 1) 【number】 and calculating [0010] Here, α t,j is determined according to the following formula: [0025] Here, W α and (Outside 2) 【number】 are the parameters waiting to be trained, and b t is the current initial text feature, and s t is the current target text feature, the subscript t is the order of the text feature, and t j is a structuring feature, 1≦j≦M, M is the number of structuring features, exp( ) is the exponential function, tanh( ) is the hyperbolic tangent function, Here, t j is determined according to the following formula: [0030] Here, W t and t are the parameters waiting to be trained, (Outer 3) 【number】 are the semantic term vectors of the subject, predicate and object of the structured feature, where [;] indicates vector connection; b t , s t and (outer 4) 【number】 is input to the fully connected network, and the action selection decision vector z is calculated according to the following formula: t and [0045] Here, W z and z are the parameters waiting to be trained, The action selection decision vector z t and the operation selection parameter W a Based on the multiplication result, the action decision probability p(action|z t ) determining an execution action for the current initial text sequence based on an action decision probability; 2. The method of claim 1 .

6. The step of combining and generating the current initial text feature and the aligned structured feature as the target text feature comprises: determining a new vocabulary based on the candidate vocabulary, the candidate vocabulary being a word in a vocabulary library and a word in the structured text sequence; calculating a probability of generating each of the candidate vocabulary as a new vocabulary, and determining the new vocabulary based on the probability of generating; Mapping the new vocabulary to generate sequence vectors and current fact vectors (outer 5) and combining the resulting target text features with the 2. The method of claim 1 .

7. The step of calculating a probability of generating each of the candidate vocabulary words as a new vocabulary word based on the generation probability by using the vocabulary words in the vocabulary library and the vocabulary words in the structured text sequence as candidate vocabulary words and determining the new vocabulary word based on the generation probability includes: The source probability P that the source of the new vocabulary is a vocabulary library or a structured text sequence according to the following formula: gate and calculating [0050] Where: (outer 6) 【number】 and g are the parameters to be trained, sigmoid() is the activation function, The probability of occurrence of the candidate vocabulary in the vocabulary library p is calculated according to the following formula: gen (y t |z t ) and p gen () t |z t (s)ftmax( y ・z t ) Here, W y are the parameters waiting to be trained, and y t is the new vocabulary waiting to be generated, softmax( ) is the cost function of the regression algorithm, The copy probability p of the candidate vocabulary in the structured text sequence is calculated according to the following formula: copy of p copy =(o j |z t )∝exp(v c ・tanh(W c ・[z t ;t j ])) and calculating Here, v c And W c are the parameters waiting to be trained, and j is a fact triplet of the candidate vocabulary, The probability of generating a new vocabulary is calculated based on the source probability, the occurrence probability, and the copy probability. [006] and calculating determining new vocabulary words from each candidate vocabulary word based on said generation probability; 7. The method of claim 6.

8. storing the extracted initial text features in an initial cache area; storing the extracted structural features in a fact cache area; Accordingly, the step of generating a target text sequence based on the initial text features and the structural features comprises: extracting initial text features currently pending from said initial cache area in sequence to generate structural features of said fact cache area and a target text sequence; 8. The method according to claim 1, wherein the first and second electrodes are arranged in a first direction.

9. prior to the step of generating a target text sequence based on the initial text features and the structural features, and inputting the initial text features and the structured features into a fully connected neural network to perform feature combination.

9. The method of claim 8.

10. An apparatus for generating a text sequence, comprising: one or more processors; and a memory for storing one or more programs; The one or more programs, when executed by the one or more processors, cause the one or more processors to: extracting initial text features of an initial text sequence, the initial text sequence being a whole article containing a number of independent words, the initial text features being a vector of coding values ​​corresponding to each word in the initial text sequence; extracting structured features of a structured text sequence, which is a vector of coding values ​​corresponding to each vocabulary in the structured text sequence, of all the fact structured vocabulary words retrieved from each vocabulary in the initial text sequence; generating a target text sequence based on the initial text features and the structural features; The one or more processors further include: filtering the initial text features based on the structural features and correcting text content of the filtered initial text features based on the structural features to generate the target text sequence; The steps of filtering the initial text features based on the structural features and correcting the text content of the filtered initial text features based on the structural features to generate the target text sequence include: each of the initial text features extracted from the initial text sequence as a current initial text feature; fact-matching the current initial text feature with the structural feature, and determining an action to be taken for the current initial text feature based on a fact-matching result; processing the current initial text features based on the executed actions to generate the target text sequence; determining an action to be taken for the current initial text feature based on a fact matching result, determining that an action to be performed is pending if a structured feature exists that matches the current initial text feature and the current initial text feature matches the text content of the matched structured feature; determining that the action to be performed is a join creation if a structured feature exists that matches the current initial text feature and the current initial text feature does not match the text content of the matched structured feature; if there is no structural feature that matches the current initial text feature, determining that the action to be taken is discard; Accordingly, processing the current initial text features to generate the target text sequence based on the executed actions includes: if the execution action is pending, reserving the current initial text feature as a target text feature; if the execution operation is join generation, then joining the current initial text feature and the structured feature that is matched with the current initial text feature to generate the target text feature; if the action to be performed is discard, filtering and discarding the current initial text features; generating the target text sequence based on the target text features.

11. A computer-readable storage medium having a computer program stored thereon, the computer program being characterized in that, when executed by a processor, the method for generating a text sequence according to any one of claims 1 to 9 is realized.

12. A computer program product which, when executed by a processor, implements the method for generating a text sequence according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Document proofreading device

    JP1999167576A

  • Error correction using fact repositories

    US20110060584A1