Text generation method and device, electronic equipment and computer readable medium

By deduplicating the decoded word information set and selecting target word information for text concatenation, the problems of low efficiency and accuracy of existing text generation models are solved, achieving more efficient and accurate text generation.

CN114118076BActive Publication Date: 2025-10-28BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110053835.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2025-10-28
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

Existing text generation models are inefficient and inaccurate during the decoding process, mainly because the lack of deduplication results in duplicate text information being included in subsequent calculations, leading to low efficiency and accuracy in generating text topics.

Method used

By determining the set of decoded word information, deduplication is performed to generate a set of candidate word information. Candidate word information that meets the target conditions is selected from these sets as target word information. Finally, the target text is generated by concatenating the text with the preset word list and the target word information.

Benefits of technology

It improves the efficiency and accuracy of text generation, reduces duplicate text through deduplication, and enhances the focus and fluency of the text topic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114118076B_ABST
    Figure CN114118076B_ABST
Patent Text Reader

Abstract

This disclosure presents embodiments of a text generation method, apparatus, electronic device, and computer-readable medium. One specific implementation of the method includes: determining a set of decoded word information based on a text to be processed, wherein the text to be processed describes a specified object; performing deduplication on the set of decoded word information to generate a set of candidate word information; selecting candidate word information that satisfies target conditions from each candidate word information set as target word information, thereby obtaining a set of target word information; for each target word information in the set of target word information, in response to determining that the target word information satisfies a convergence condition, concatenating the target word information and its corresponding historical target word information sequence based on a preset vocabulary to generate target text. This implementation improves the efficiency and accuracy of generating text topics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically to text generation methods, apparatus, electronic devices, and computer-readable media. Background Technology

[0002] With the rapid development of computer technology and deep learning technology, breakthroughs have been achieved in various research directions of natural language processing, such as machine translation and text generation (e.g., summarization). Existing text generation models often use the Beam Search algorithm in the decoding process, which greedily searches for solutions in a large solution space. This algorithm is commonly used in the decoding module of text generation models.

[0003] However, when generating text using the above method, the following technical problems often arise:

[0004] Existing bundle search methods have low efficiency and accuracy in generating text topics during the decoding process. Summary of the Invention

[0005] The summary section of this disclosure provides a brief overview of concepts that will be described in detail in the subsequent detailed description section. This summary section is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions. Some embodiments of this disclosure provide text generation methods, apparatuses, electronic devices, and computer-readable media to address one or more of the technical problems mentioned in the background section above.

[0006] In a first aspect, some embodiments of this disclosure provide a text generation method, the method comprising: determining a set of decoded word information based on a text to be processed, wherein the text to be processed is used to describe a specified object; performing deduplication processing on the set of decoded word information to generate a set of candidate word information; selecting candidate word information that satisfies a target condition from each candidate word information set in the set of candidate word information as target word information, thereby obtaining a set of target word information; and for each target word information in the set of target word information, in response to determining that the target word information satisfies a convergence condition, concatenating the target word information and the historical target word information sequence corresponding to the target word information based on a preset vocabulary to generate target text.

[0007] Optionally, based on the text to be processed, determining the set of decoded word information includes: inputting the text to be processed into a text encoder to generate an encoded hidden layer vector; and inputting the encoded hidden layer vector into a decoder to generate a set of decoded word information.

[0008] Optionally, the decoded word information in the decoded word information set includes: the decoded word and the corresponding decoded word probability value; and the above deduplication processing of the decoded word information set to generate a candidate word information set includes: for each decoded word information set in the above decoded word information set, dividing the decoded word information set into a repeated decoded word information set and a single decoded word information set according to the decoded word; selecting repeated decoded word information that meets preset conditions from the repeated decoded word information set as target repeated decoded word information; and concatenating the target repeated decoded word information and the single decoded word information set to generate the candidate word information set.

[0009] Optionally, for each decoded word information group in the above-mentioned decoded word information group set, the decoded word information group is divided into a repeating decoded word information group and a single decoded word information group according to the decoded word, including: for each decoded word information group in the above-mentioned decoded word information group set, in response to the existence of other decoded word information containing the decoded word information in the above-mentioned decoded word information group, the decoded word information and the other decoded word information are placed into the repeating decoded word information group; otherwise, the decoded word information is placed into the single decoded word information group.

[0010] Optionally, the candidate word information in the candidate word information set includes: candidate words and their corresponding probability values; and the selection of candidate word information that meets the target conditions from each candidate word information group in the candidate word information set as target word information includes: for each candidate word information group in the candidate word information set, selecting at least one candidate word information from the candidate word information group in descending order of the candidate word probability values; placing the candidate word information with the highest probability value among the at least one candidate word information into the historical target word information set, determining at least one initial target word information of the candidate word information with the highest probability value, and generating target word information corresponding to the candidate word information based on the at least one initial target word information. The initial target word information in the at least one initial target word information includes: an initial target word and the initial target word probability value corresponding to the initial target word.

[0011] Optionally, generating target word information corresponding to the candidate word information based on at least one initial target word information includes: in response to the initial target word corresponding to the initial target word with the largest initial target word probability value belonging to the historical target word information set, determining the repetition probability difference between the initial target word with the largest initial target word probability value and the corresponding historical target word information in the historical target word information set; in response to the repetition probability difference being greater than the initial target word probability value of other initial target word information corresponding to the candidate word information, setting the initial target word with the largest initial target word probability value as the target word information, and placing the target word information into the historical target word information set.

[0012] Optionally, generating target word information corresponding to the candidate word information based on at least one initial target word information includes: in response to the initial target word corresponding to the initial target word with the largest initial target word probability value belonging to the historical target word information set, determining the repetition probability difference between the initial target word with the largest initial target word probability value and the historical target word information corresponding to the historical target word information set; in response to the repetition probability difference being less than or equal to the initial target word probability value of other initial target word information corresponding to the candidate word information, setting the initial target word with the largest initial target word probability value among the other initial target word information as the target word information, and placing the target word information into the historical target word information set.

[0013] Optionally, generating target word information corresponding to the candidate word information based on at least one initial target word information includes: in response to the initial target word information with the largest initial target word probability value not belonging to the historical target word information set, setting the initial target word information with the largest initial target word probability value as the target word information, and placing the target word information into the historical target word information set.

[0014] Optionally, for each target word in the aforementioned target word information set, in response to determining that the target word information satisfies the convergence condition, based on a preset vocabulary, the target word information and the corresponding historical target word information sequence are concatenated to generate target text, including: for each target word in the aforementioned target word information set, in response to determining that the target word information satisfies the preset convergence condition, the target word information and the corresponding historical target word information sequence are concatenated to generate concatenated text; words matching the concatenated text are selected from the preset vocabulary as connectives; and the connectives and the concatenated text are combined to generate target text.

[0015] Secondly, some embodiments of this disclosure provide a text generation apparatus, comprising: a determining unit configured to determine a set of decoded word information based on a text to be processed, wherein the text to be processed is used to describe a specified object; a deduplication unit configured to perform deduplication processing on the set of decoded word information to generate a set of candidate word information; a selecting unit configured to select candidate word information that satisfies a target condition from each candidate word information set in the set of candidate word information as target word information, thereby obtaining a set of target word information; and a concatenation unit configured to, for each target word information in the set of target word information, in response to determining that the target word information satisfies a convergence condition, concatenate the target word information and the historical target word information sequence corresponding to the target word information based on a preset vocabulary to generate target text.

[0016] Optionally, the determining unit is further configured to: input the text to be processed into a text encoder to generate an encoded hidden layer vector; and input the encoded hidden layer vector into a decoder to generate a decoded word information set.

[0017] Optionally, the decoded word information in the decoded word information set includes: the decoded word and the corresponding decoded word probability value; and the deduplication unit is further configured to: for each decoded word information group in the decoded word information set, divide the decoded word information group into a repeated decoded word information group and a single decoded word information group according to the decoded word; select repeated decoded word information that meets preset conditions from the repeated decoded word information group as target repeated decoded word information; and concatenate the target repeated decoded word information and the single decoded word information group to generate the candidate word information group.

[0018] Optionally, the deduplication unit is further configured to: for each decoded word information group in the above-mentioned decoded word information group set, in response to the existence of other decoded word information containing the decoded word information in the above-mentioned decoded word information group, put the decoded word information and the other decoded word information into the duplicate decoded word information group; otherwise, put the decoded word information into the single decoded word information group.

[0019] Optionally, the candidate word information in the candidate word information group set includes: candidate words and their corresponding candidate word probability values; and the selection unit is further configured to: for each candidate word information group in the candidate word information group set, select at least one candidate word information from the candidate word information group in descending order of the candidate word probability values; place the candidate word information with the highest probability value among the at least one candidate word information into the historical target word information set, determine at least one initial target word information of the candidate word information with the highest probability value, and generate target word information corresponding to the candidate word information based on the at least one initial target word information. The initial target word information in the at least one initial target word information includes: an initial target word and the initial target word probability value corresponding to the initial target word.

[0020] Optionally, the selection unit is further configured to: in response to the initial target word corresponding to the initial target word information with the largest initial target word probability value belonging to the aforementioned historical target word information set, determine the duplicate word probability difference between the initial target word information with the largest initial target word probability value and the historical target word information corresponding to the aforementioned historical target word information set; in response to the duplicate word probability difference being greater than the initial target word probability value of other initial target word information corresponding to the candidate word information, set the initial target word information with the largest initial target word probability value as the target word information, and place the target word information into the aforementioned historical target word information set.

[0021] Optionally, the selection unit is further configured to: in response to the initial target word corresponding to the initial target word information with the largest initial target word probability value belonging to the aforementioned historical target word information set, determine the duplicate word probability difference between the initial target word information with the largest initial target word probability value and the historical target word information corresponding to the aforementioned historical target word information set; in response to the duplicate word probability difference being less than or equal to the initial target word probability value of other initial target word information corresponding to the candidate word information, set the initial target word information with the largest initial target word probability value among the other initial target word information as the target word information, and place the target word information into the aforementioned historical target word information set.

[0022] Optionally, the selection unit is further configured to: in response to the initial target word information corresponding to the initial target word information with the largest initial target word probability value not belonging to the above-mentioned historical target word information set, set the initial target word information with the largest initial target word probability value as the target word information, and put the target word information into the above-mentioned historical target word information set.

[0023] Optionally, the splicing unit is further configured to: for each target word in the target word information set, in response to determining that the target word information satisfies a preset convergence condition, splice the target word information with the historical target word information sequence corresponding to the target word information to generate spliced ​​text; select a word from the preset word list that matches the spliced ​​text as a connector; and combine the connector and the spliced ​​text to generate target text.

[0024] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0025] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0026] The above embodiments of this disclosure have the following beneficial effects: the text generation method of some embodiments of this disclosure improves the efficiency and accuracy of generating text topics. Specifically, the reason for the low efficiency and low accuracy of generating text topics is that duplicate text is not deduplicated, and the duplicate information corresponding to the duplicate text is included in subsequent calculations, resulting in a large number of duplicate texts in the generated text, thus causing low efficiency and low accuracy in generating text topics. Based on this, the text method of some embodiments of this disclosure firstly determines a set of decoded word information based on the text to be processed. Thus, the generated set of decoded word information provides data support for subsequent text deduplication and generation of target text. Secondly, the aforementioned set of decoded word information is deduplicated to generate a set of candidate word information. Since each set of decoded word information often contains decoded word information with the same decoded word, deduplicating the decoded word information with the same decoded word improves the efficiency of generating text topics. Thirdly, candidate word information that meets the target conditions is selected from each candidate word information set as target word information to obtain a target word information set. A set of target words that can attract strong attention is selected from the candidate word information set. Finally, for each target word in the target word information set, in response to determining that the target word satisfies the convergence condition, the target word information and its corresponding historical target word information sequence are concatenated based on a pre-set vocabulary to generate the target text. The aforementioned pre-set vocabulary is composed of spoken vocabulary. Combining this pre-set vocabulary with the target word information set that combines high attention and fluency improves the accuracy of the generated text topic. Attached Figure Description

[0027] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0028] Figure 1 This is a schematic diagram illustrating an application scenario of a text generation method according to some embodiments of the present disclosure;

[0029] Figure 2 This is a flowchart of some embodiments of the text generation method according to the present disclosure;

[0030] Figure 3 These are flowcharts of other embodiments of the text generation method according to this disclosure;

[0031] Figure 4 These are application scenario diagrams of other embodiments of the text generation method according to this disclosure;

[0032] Figure 5 This is a schematic diagram of the structure of some embodiments of the text generation apparatus according to the present disclosure;

[0033] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0034] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0035] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

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

[0037] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0038] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0039] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] Figure 1 This is a schematic diagram illustrating an application scenario of the text generation method according to some embodiments of this disclosure.

[0041] exist Figure 1In the application scenario, firstly, the computing device 101 can determine the decoded word information set 103 (e.g., ["washing machine": 0.03, "washing machine": 0.07, "care": 0.02, "care": 0.01, "clothes": 0.4, "clothes": 0.1, "beauty": 0.1, "beauty": 0.01, "cleaning": 0.04], ["washing machine": 0.01, "washing machine": 0.04, "care": 0.06, "care": 0.02, "clothes": 0.04, "clothes": 0.07, "beauty": 0.01, "beauty": 0.5, "cleaning": 0.01] based on the text to be processed 102 (e.g., "washing machine", "care", "clothes": 0.04, "clothes": 0.07, "beauty": 0.01, "beauty": 0.5, "cleaning": 0.01]). The aforementioned text to be processed 102 is used to describe the specified object. Then, the computing device 101 can perform deduplication processing on the above-mentioned decoded word information set 103 to generate candidate word information set 104 (e.g., ["washing machine": 0.07, "care": 0.02, "clothes": 0.4, "beauty": 0.1, "cleaning": 0.04], ["washing machine": 0.04, "care": 0.06, "clothes": 0.07, "beauty": 0.5, "cleaning": 0.01]). Afterwards, the computing device 101 can select candidate word information that meets the target conditions from each candidate word information set 104 as target word information, obtaining target word information set 105 (e.g., "clothes": 0.4, "beauty": 0.5). Finally, for each target word in the target word information set 105, in response to determining that the target word information satisfies the convergence condition, the computing device 101 can, based on a preset word list 106 (e.g., “your”, “more”, “able to”, “effectively”, etc.), concatenate the target word information and the corresponding historical target word information sequence 107 (e.g., [“washing machine”: 0.4, “cleaning”: 0.3], [“care”: 0.5, “clothes”: 0.6]) to generate target text 108, such as ([“washing machine can effectively clean clothes”, [“care for your clothes makes them more beautiful”]).

[0042] It should be noted that the aforementioned computing device 101 can be either hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed within the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.

[0043] It should be understood that Figure 1The number of computing devices shown is merely illustrative. Any number of computing devices can be used depending on implementation needs.

[0044] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of a text generation method according to the present disclosure. This text generation method includes the following steps:

[0045] Step 201: Determine the set of decoded word information based on the text to be processed.

[0046] In some embodiments, the execution body of the text generation method (e.g. Figure 1 The computing device 101 shown can determine a set of decoded word information based on the text to be processed, wherein the text to be processed can be text awaiting processing. The text to be processed can be vocabulary used to describe a specified object. The set of decoded word information can be the set of decoded word information at any time step generated by inputting the pre-processed text into a pre-trained text generation model. The pre-trained text generation model can be a Seq2Seq (Sequence to sequence) model. Alternatively, the pre-trained text generation model can be a SeqGAN (Sequence Generative Adversarial Nets with Policy Gradient) model. The decoded word information in the set of decoded word information can include: the decoded word and the corresponding decoded word probability.

[0047] As an example, the text to be processed above could be ["washing machine", "washing machine", "care", "care", "clothes", "clothes", "beauty", "beauty", "washing"]. Inputting the above text to be processed into a pre-trained text generation model, the generated set of decoded word information could be [["washing machine": 0.03, "washing machine": 0.07, "care": 0.02, "care": 0.01, "clothes": 0.4, "clothes": 0.1, "beauty": 0.1, "beauty": 0.01, "washing": 0.04], ["washing machine": 0.01, "washing machine": 0.04, "care": 0.06, "care": 0.02, "clothes": 0.04, "clothes": 0.07, "beauty": 0.01, "beauty": 0.5, "washing": 0.01]].

[0048] Step 202: Deduplication is performed on the decoded word information set to generate a candidate word information set.

[0049] In some embodiments, the execution body of the above-described text generation method performs deduplication processing on the decoded word information set to generate a candidate word information set. Specifically, based on the decoded words, for each decoded word information set in the above-described decoded word information set, the decoded word information with the same decoded word in the above-described decoded word information set is deduplicated, retaining only the decoded word information with the highest probability value among the same decoded word information, and combining the decoded word information without the same decoded word with the retained decoded word information with the highest probability value to generate a candidate word information set.

[0050] As an example, the above set of decoded word information could be [[“washing machine”: 0.03, “washing machine”: 0.07, “care”: 0.02, “care”: 0.01, “clothes”: 0.4, “clothes”: 0.1, “beautiful”: 0.1, “beautiful”: 0.01, “cleaning”: 0.04], [“washing machine”: 0.01, “washing machine”: 0.04, “care”: 0.06, “care”: 0.02, “clothes”: 0.04, “clothes”: 0.07, “beautiful”: 0.01, “beautiful”: 0.5, “cleaning”: 0.01]]. The deduplication process performed on the above decoded word information set to generate candidate word information sets can be [[“washing machine”: 0.07, “care”: 0.02, “clothes”: 0.4, “beauty”: 0.1, “cleaning”: 0.04], [“washing machine”: 0.04, “care”: 0.06, “clothes”: 0.07, “beauty”: 0.5, “cleaning”: 0.01]].

[0051] Step 203: Select candidate word information that meets the target conditions from each candidate word information group in the candidate word information group set as target word information to obtain the target word information set.

[0052] In some embodiments, the entity executing the above text generation method may select candidate word information that meets the target conditions from each candidate word information group in the candidate word information group set as target word information, thereby obtaining a target word information set. The target conditions may be that the candidate information may be the candidate word information with the highest probability value in the candidate word information group.

[0053] As an example, the above candidate word information set could be [["washing machine": 0.07, "care": 0.02, "clothes": 0.4, "beauty": 0.1, "cleaning": 0.04], ["washing machine": 0.04, "care": 0.06, "clothes": 0.07, "beauty": 0.5, "cleaning": 0.01]]. Then, selecting candidate word information that meets the target conditions from each candidate word information set in the candidate word information set as the target word information results in a target word information set that could be [["clothes": 0.4], ["beauty": 0.5]].

[0054] Step 204: For each target word in the target word information set, in response to determining that the target word information meets the convergence condition, based on the preset word list, the target word information and the corresponding historical target word information sequence are concatenated to generate the target text.

[0055] In some embodiments, the execution entity of the above text generation method may, for each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, concatenate the target word corresponding to the target word information and the historical target word sequence corresponding to the historical target word information sequence to generate concatenated text. It then determines the words in the preset lexicon that match the concatenated text, and combines the matched words with the concatenated text to generate the target text. Wherein, the convergence condition for the target word information may be that the target word information is the target word information corresponding to the last time step of a preset time step. The preset lexicon may be a lexicon composed of spoken vocabulary. The historical target word information in the historical target word information sequence may be the historical target word information generated at each time step within the preset time step corresponding to the target word information.

[0056] As an example, the target word information set mentioned above could be [[“clothes”: 0.4], [“beautiful”: 0.5]]. For each target word in the target word information set, the target word information can be determined to be the target word information corresponding to the last time step of a preset time step. The preset time step could be 3. The target word information mentioned above could be [“clothes”: 0.4]. The historical target word information sequence corresponding to the target word information mentioned above could be [[“washing machine”: 0.4], [“washing”: 0.3]]. The target word information mentioned above could be [“beautiful”: 0.5]. The historical target word information sequence corresponding to the target word information mentioned above could be [[“care”: 0.5], [“clothes”: 0.6]]. The preset word list could be [“your”, “more”, “able”, “effectively”]. Then the final target text set generated after text concatenation could be [[“washing machine can effectively wash clothes”], [“care for your clothes makes them more beautiful”]].

[0057] The above embodiments of this disclosure have the following beneficial effects: the text generation method of some embodiments of this disclosure improves the efficiency and accuracy of generating text topics. Specifically, the reason for the low efficiency and low accuracy of generating text topics is that duplicate text is not deduplicated, and the duplicate information corresponding to the duplicate text is included in subsequent calculations, resulting in a large number of duplicate texts in the generated text, thus causing low efficiency and low accuracy in generating text topics. Based on this, the text method of some embodiments of this disclosure firstly determines a set of decoded word information based on the text to be processed. Thus, the generated set of decoded word information provides data support for subsequent text deduplication and generation of target text. Secondly, the aforementioned set of decoded word information is deduplicated to generate a set of candidate word information. Since each set of decoded word information often contains decoded word information with the same decoded word, deduplicating the decoded word information with the same decoded word improves the efficiency of generating text topics. Thirdly, candidate word information that meets the target conditions is selected from each candidate word information set as target word information to obtain a target word information set. A set of target words that can attract strong attention is selected from the candidate word information set. Finally, for each target word in the target word information set, in response to determining that the target word satisfies the convergence condition, the target word information and its corresponding historical target word information sequence are concatenated based on a pre-set vocabulary to generate the target text. The aforementioned pre-set vocabulary is composed of spoken vocabulary. Combining this pre-set vocabulary with the target word information set that combines high attention and fluency improves the accuracy of the generated text topic.

[0058] Continue to refer to Figure 3 , Figure 3 A flow 300 of some other embodiments of the text generation method according to this disclosure is shown. The text generation method includes the following steps:

[0059] Step 301: Determine the set of decoded word information based on the text to be processed.

[0060] In some embodiments, the execution entity determines the set of decoded word information based on the text to be processed, which may include the following steps:

[0061] The first step is to input the text to be processed into the text encoder to generate the encoded hidden layer vector.

[0062] In some embodiments, the execution entity may input the text to be processed into a text encoder to generate an encoded hidden layer vector. The text encoder may be used to compress the text to be processed into a low-dimensional text vector. The encoded hidden layer vector may be a word vector after feature compression. The text encoder may be an encoder composed of various types of neural network models. The text encoder may be an auto-encoder. The text encoder may also be an encoder in a seq2seq (Sequence to Sequence) model.

[0063] The second step is to input the above-mentioned encoded hidden layer vector into the decoder to generate a set of decoded word information.

[0064] In some embodiments, the execution entity may input the encoded hidden layer vector into the decoder to generate a set of decoded word information. The decoder may be used to input the encoded hidden layer vector into a pre-trained neural network model for word decoding to generate a set of decoded word information. The pre-trained neural network model may be an RNN (Recurrent Neural Network) or a CNN (Convolutional Neural Network). The decoded word information in the set of decoded word information may include the decoded word and the corresponding decoded word probability.

[0065] As an example, the text to be processed above could be ["washing machine", "washing machine", "care", "care", "clothes", "clothes", "beauty", "beauty", "cleaning"]. The generated set of decoded word information could be [["washing machine": 0.03, "washing machine": 0.07, "care": 0.02, "care": 0.01, "clothes": 0.04, "clothes": 0.01, "beauty": 0.1, "beauty": 0.01, "cleaning": 0.4], ["washing machine": 0.01, "washing machine": 0.04, "care": 0.06, "care": 0.02, "clothes": 0.4, "clothes": 0.07, "beauty": 0.01, "beauty": 0.05, "cleaning": 0.04]].

[0066] Step 302: For each decoded word information group in the decoded word information group set, the decoded word information group is divided into repeated decoded word information groups and single decoded word information groups according to the decoded word.

[0067] In some embodiments, the executing entity may, for each decoded word information group in the decoded word information group set, in response to the existence of other decoded word information containing the decoded word information in the decoded word information group, place the decoded word information and the other decoded word information into a duplicate decoded word information group; otherwise, place the decoded word information into a single decoded word information group. The duplicate decoded word information in the duplicate decoded word information group may be decoded word information with the same decoded word. The single decoded word information in the single decoded word information group may be decoded word information without the same decoded word.

[0068] As an example, the decoded word information set generated above could be [[“washing machine”: 0.03, “washing machine”: 0.07, “care”: 0.02, “care”: 0.01, “clothes”: 0.04, “clothes”: 0.01, “beautiful”: 0.1, “beautiful”: 0.01, “cleaning”: 0.4], [“washing machine”: 0.01, “washing machine”: 0.04, “care”: 0.06, “care”: 0.02, “clothes”: 0.4, “clothes”: 0.07, “beautiful”: 0.01, “beautiful”: 0.05, “cleaning”: 0.04]].

[0069] For one of the decoded word information in the above decoded word information set: ["washing machine": 0.03, "washing machine": 0.07, "care": 0.02, "care": 0.01, "clothes": 0.04, "clothes": 0.01, "beautiful": 0.1, "beautiful": 0.01, "cleaning": 0.4], the corresponding repeated decoded word information group and single decoded word information group can be [["washing machine": 0.03, "washing machine": 0.07], ["care": 0.02, "care": 0.01], ["clothes": 0.04, "clothes": 0.01], ["beautiful": 0.1, "beautiful": 0.01]] and ["cleaning": 0.4].

[0070] As another example, the above-generated set of decoded word information could be [[“washing machine”: 0.03, “washing machine”: 0.07, “care”: 0.02, “care”: 0.01, “clothes”: 0.04, “clothes”: 0.01, “beautiful”: 0.1, “beautiful”: 0.01, “cleaning”: 0.4], [“washing machine”: 0.01, “washing machine”: 0.04, “care”: 0.06, “care”: 0.02, “clothes”: 0.4, “clothes”: 0.07, “beautiful”: 0.01, “beautiful”: 0.05, “cleaning”: 0.04]].

[0071] For another decoded word in the above decoded word information set: ["washing machine": 0.01, "washing machine": 0.04, "care": 0.06, "care": 0.02, "clothes": 0.4, "clothes": 0.07, "beautiful": 0.01, "beautiful": 0.05, "clean": 0.04]], the corresponding repeated decoded word information set and single decoded word information set can be [["washing machine": 0.01, "washing machine": 0.04], ["care": 0.06, "care": 0.02], ["clothes": 0.4, "clothes": 0.07], ["beautiful": 0.01, "beautiful": 0.05]] and ["clean": 0.04].

[0072] Step 303: Select repeating decoded word information that meets the preset conditions from the repeating decoded word information group as the target repeating decoded word information.

[0073] In some embodiments, the executing entity may select repeating decoded word information that meets preset conditions from the repeating decoded word information group as target repeating decoded word information. The preset conditions may be that the repeating decoded word information is the repeating decoded word information with the highest decoded word probability value in the repeating decoded word information group. For each repeating decoded word information in the repeating decoded word information group, the repeating decoded word information is sorted from high to low according to its decoded word probability value, resulting in a repeating decoded word information sequence. The repeating decoded word information with the highest decoded word probability value is then selected from the repeating decoded word information sequence.

[0074] As an example, the above repeated decoded word information group could be [[“washing machine”: 0.03, “washing machine”: 0.07], [“care”: 0.02, “care”: 0.01], [“clothes”: 0.04, “clothes”: 0.01], [“beautiful”: 0.1, “beautiful”: 0.01]]. Then the generated target repeated decoded word information could be [[“washing machine”: 0.07], [“care”: 0.02], [“clothes”: 0.04], [“beautiful”: 0.1]].

[0075] As another example, the above repeated decoded word information group could be [[“washing machine”: 0.01, “washing machine”: 0.04], [“care”: 0.06, “care”: 0.02], [“clothes”: 0.4, “clothes”: 0.07], [“beautiful”: 0.01, “beautiful”: 0.05]]. The generated target repeated decoded word information could then be [[“washing machine”: 0.04], [“care”: 0.06], [“clothes”: 0.4], [“beautiful”: 0.05]].

[0076] Step 304: Concatenate the target repeated decoded word information and the single decoded word information group to generate candidate word information group.

[0077] In some embodiments, the executing entity can concatenate the target repeated decoded word information and the single decoded word information group to generate a candidate word information group. The concatenation process can combine the target repeated decoded word information and the corresponding single decoded word information group according to the decoded word information group to generate a candidate word information group.

[0078] As an example, the target repeated decoded word information mentioned above could be [[“washing machine”: 0.07], [“care”: 0.02], [“clothes”: 0.04], [“beauty”: 0.1]]. The single decoded word information group corresponding to the target repeated decoded word information mentioned above could be [“washing”: 0.04]. Then, the candidate word information group generated by combining the two groups of information could be [[“washing machine”: 0.07], [“care”: 0.02], [“clothes”: 0.04], [“beauty”: 0.1], [“washing”: 0.4]].

[0079] As another example, the target repeated decoded word information mentioned above could be [[“washing machine”: 0.04], [“care”: 0.06], [“clothes”: 0.4], [“beautiful”: 0.05]]. The single decoded word information group corresponding to the target repeated decoded word information mentioned above could be [“washing”: 0.01]. Then, the candidate word information group generated by combining the two groups of information could be [[“washing machine”: 0.04], [“care”: 0.06], [“clothes”: 0.4], [“beautiful”: 0.05], [“washing”: 0.01]].

[0080] Step 305: For each candidate word information group in the candidate word information group set, select at least one candidate word information from the candidate word information group in descending order of candidate word probability value.

[0081] In some embodiments, the execution entity may select at least one candidate word from each candidate word information group in the candidate word information group set in descending order of candidate word probability values, wherein the candidate word information includes: candidate words and the corresponding candidate word probability values.

[0082] As an example, the above candidate word information group could be [[“washing machine”: 0.07], [“care”: 0.02], [“clothes”: 0.04], [“beauty”: 0.1], [“cleaning”: 0.4]]. Selecting at least one candidate word from the above candidate word information group in descending order of probability value could be [“beauty”: 0.1, “cleaning”: 0.4]. Another candidate word information group could be [[“washing machine”: 0.04], [“care”: 0.06], [“clothes”: 0.4], [“beauty”: 0.05], [“cleaning”: 0.01]]. Selecting at least one candidate word from the above candidate word information group in descending order of probability value could be [“care”: 0.06, “clothes”: 0.4].

[0083] Step 306: Place the candidate word with the highest probability value among the above at least one candidate word information into the historical target word information set, determine at least one initial target word information of the candidate word with the highest probability value, and generate target word information corresponding to the candidate word information based on the above at least one initial target word information.

[0084] In some embodiments, the execution entity may first, for at least one candidate word information, add the candidate word with the highest probability value to the historical target word information set. Secondly, it determines at least one initial target word based on the candidate word with the highest probability value. Finally, it generates target word information corresponding to the candidate word information based on the at least one initial target word information. The initial target word information in the at least one initial target word information includes: an initial target word and an initial target word probability value corresponding to the initial target word. The initial target word with the highest initial target word probability value is selected as the target word information from the at least one initial target word information.

[0085] As an example, the above-mentioned candidate word information could be ["beautiful": 0.1, "cleaning": 0.4]. The above-mentioned candidate word information could also be ["care": 0.06, "clothes": 0.4]. The candidate word information with the highest probability value could be ["cleaning": 0.4] or ["clothes": 0.4]. Adding the above candidate word information to the historical target word information set could be [["cleaning": 0.4], ["clothes": 0.4]]. Determine the initial target word information from the above candidate word information. The above candidate word information could be ["cleaning": 0.4]. The initial target word information corresponding to the above candidate word information could be ["clothes": 0.7, "beautiful": 0.1], and the generated target word information corresponding to the above candidate word information could be ["clothes": 0.7]. The above candidate word information could be ["clothes": 0.4], and the initial target word information corresponding to the above candidate word information could be ["clothes": 0.07, "beautiful": 0.5]. Furthermore, the target word information generated corresponding to the above candidate word information can be ["beautiful": 0.5]. Specifically, the application scenarios for generating target word information include... Figure 4 As shown.

[0086] In some optional implementations of certain embodiments, the execution entity may first, in response to the initial target word information corresponding to the initial target word information with the highest initial target word probability value belonging to the historical target word information set, determine the duplicate word probability difference between the initial target word information with the highest initial target word probability value and the corresponding historical target word information in the historical target word information set. Secondly, in response to the duplicate word probability difference being greater than the initial target word probability value of other initial target word information corresponding to the candidate word information, the execution entity may set the initial target word information with the highest initial target word probability value as the target word information and place the target word information into the historical target word information set.

[0087] As an example, the initial target word corresponding to the initial target word information with the highest initial target word probability value could be "clothes". The historical target word information set could be [["cleaning": 0.4], ["clothes": 0.4]]. The probability value of the initial target word corresponding to the initial target word information with the highest initial target word probability value could be 0.7. Then, the probability difference of repeated words between the initial target word information with the highest initial target word probability value and the corresponding historical target word information in the historical target word information set could be 0.3. The other initial target word information could be ["beautiful": 0.1]. In response to the fact that the probability difference of repeated words is greater than the initial target word probability value of the other initial target word information corresponding to the candidate word information, the initial target word information with the highest initial target word probability value ["clothes": 0.7] is set as the target word information, and the target word information is placed into the historical target word information set ["cleaning": 0.4, "clothes": 0.7]].

[0088] In some optional implementations of certain embodiments, the execution entity first determines the repetition probability difference between the initial target word information with the highest initial target word probability value and the corresponding historical target word information in the historical target word information set, in response to the initial target word information corresponding to the initial target word information with the highest initial target word probability value belonging to the historical target word information set. Secondly, in response to the repetition probability difference being less than or equal to the initial target word probability value of other initial target word information corresponding to the candidate word information, the initial target word information with the highest initial target word probability value among the other initial target word information is set as the target word information, and the target word information is placed into the historical target word information set.

[0089] In some optional implementations of some embodiments, the execution entity first responds to the fact that the initial target word information corresponding to the initial target word information with the largest initial target word probability value does not belong to the above-mentioned historical target word information set, sets the initial target word information with the largest initial target word probability value as the target word information, and puts the target word information into the above-mentioned historical target word information set.

[0090] Step 307: For each target word in the target word information set, in response to determining that the target word information meets the convergence condition, based on the preset word list, the target word information and the corresponding historical target word information sequence are concatenated to generate the target text.

[0091] In some embodiments, for each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, the execution entity concatenates the target word information and the corresponding historical target word information sequence based on a preset vocabulary to generate target text, which may include the following steps:

[0092] The first step is to concatenate the target word information with the historical target word information sequence corresponding to the target word information for each target word information in the above target word information set in response to determining that the target word information satisfies the preset convergence condition, thereby generating the concatenated text.

[0093] As an example, the target word information above could be ["clothes": 0.7]. The historical target word information sequence corresponding to the above target word information could be ["washing machine": 0.3, "washing": 0.4]. Concatenating the above target word information with the historical target word information sequence corresponding to the above target word information to generate the concatenated text could be ["washing machine washes clothes"].

[0094] The second step is to select words from the preset vocabulary that match the concatenated text as connectors.

[0095] Among them, various machine learning methods are used to select words that match the concatenated text from the above-mentioned preset vocabulary as connectors.

[0096] As an example, the above preset vocabulary could be ["your", "able to", "effectively"]. The selected conjunctions could be ["able to", "effectively"].

[0097] The third step is to combine the aforementioned conjunctions and the concatenated text to generate the target text.

[0098] As an example, combining the above conjunctions and the above concatenated text to generate the target text could be ["The washing machine can effectively clean clothes"].

[0099] from Figure 3 It can be seen that, with Figure 2 Compared to the description of some corresponding embodiments, Figure 3The information processing method in some corresponding embodiments includes a flow 300. First, based on the text to be processed, a set of decoded word information groups is determined. This generated set of decoded word information groups provides data support for subsequent text deduplication and target text generation. Second, the decoded word information group is deduplicated to generate a set of candidate word information groups. Since each decoded word information group in the aforementioned set often contains decoded word information with the same decoded word, deduplication of these decoded word information groups with the same decoded word improves the efficiency of generating the text topic. Third, candidate word information that meets the target conditions is selected from each candidate word information group in the aforementioned set of candidate word information groups as target word information, resulting in a target word information set. Even if the target word information has been decoded previously, if it can attract strong attention at the current time step, it will still be decoded as target word information. This ensures that the generated target word information is a relatively fluent predictive word in real life. Finally, for each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, the target word information and its corresponding historical target word information sequence are concatenated based on a pre-defined vocabulary list to generate the target text. This pre-defined vocabulary list is composed of spoken language words. Combining this pre-defined vocabulary list with a target word information set that possesses both high attention span and fluency not only improves the accuracy of the generated text topic but also results in a target text that combines high attention span and fluency.

[0100] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a text generation apparatus, which are similar to... Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0101] like Figure 5 As shown, a text generation apparatus 500 in some embodiments includes: a determining unit 501 configured to determine a set of decoded word information based on a text to be processed, wherein the text to be processed is used to describe a specified object; a deduplication unit 502 configured to perform deduplication processing on the set of decoded word information to generate a set of candidate word information; a selecting unit 503 configured to select candidate word information that meets the target conditions from each candidate word information set in the set of candidate word information as target word information, thereby obtaining a set of target word information; and a concatenation unit 504 configured to, for each target word information in the set of target word information, in response to determining that the target word information meets the convergence condition, concatenate the target word information and the historical target word information sequence corresponding to the target word information based on a preset vocabulary to generate target text.

[0102] It is understandable that the units described in the device 500 are related to the reference. Figure 2 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 500 and the units contained therein, and will not be repeated here.

[0103] In some alternative implementations of embodiments, the determining unit 501 is further configured to: input the text to be processed into a text encoder to generate an encoded hidden layer vector; and input the encoded hidden layer vector into a decoder to generate a decoded word information set.

[0104] In some optional implementations of the embodiments, the decoded word information in the decoded word information group set includes: decoded words and the decoded word probability values ​​corresponding to the decoded words; and the deduplication unit 502 is further configured to: for each decoded word information group in the decoded word information group set, divide the decoded word information group into a repeated decoded word information group and a single decoded word information group according to the decoded words; select repeated decoded word information that meets preset conditions from the repeated decoded word information group as target repeated decoded word information; and concatenate the target repeated decoded word information and the single decoded word information group to generate the candidate word information group.

[0105] In some optional implementations of embodiments, the deduplication unit 502 is further configured to: for each decoded word information group in the above-mentioned decoded word information group set, in response to the existence of other decoded word information containing the decoded word information in the above-mentioned decoded word information group, put the decoded word information and the other decoded word information into a duplicate decoded word information group; otherwise, put the decoded word information into a single decoded word information group.

[0106] In some optional implementations of embodiments, the candidate word information in the candidate word information group set includes: candidate words and their corresponding candidate word probability values; and the selection unit 503 is further configured to: for each candidate word information group in the candidate word information group set, select at least one candidate word information from the candidate word information group in descending order of the candidate word probability values; place the candidate word information with the highest probability value among the at least one candidate word information into the historical target word information set, determine at least one initial target word information of the candidate word information with the highest probability value, and generate target word information corresponding to the candidate word information based on the at least one initial target word information. The initial target word information in the at least one initial target word information includes: an initial target word and its corresponding initial target word probability value.

[0107] In some optional implementations of embodiments, the selection unit 503 is further configured to: in response to the initial target word corresponding to the initial target word information with the largest initial target word probability value belonging to the aforementioned historical target word information set, determine the duplicate word probability difference between the initial target word information with the largest initial target word probability value and the historical target word information corresponding to the aforementioned historical target word information set; in response to the duplicate word probability difference being greater than the initial target word probability value of other initial target word information corresponding to the candidate word information, set the initial target word information with the largest initial target word probability value as the target word information, and place the target word information into the aforementioned historical target word information set.

[0108] In some optional implementations of embodiments, the selection unit 503 is further configured to: in response to the initial target word corresponding to the initial target word information with the largest initial target word probability value belonging to the aforementioned historical target word information set, determine the duplicate word probability difference between the initial target word information with the largest initial target word probability value and the historical target word information corresponding to the aforementioned historical target word information set; in response to the duplicate word probability difference being less than or equal to the initial target word probability value of other initial target word information corresponding to the candidate word information, set the initial target word information with the largest initial target word probability value among the other initial target word information as the target word information, and place the target word information into the aforementioned historical target word information set.

[0109] In some optional implementations of embodiments, the selection unit 503 is further configured to: in response to the initial target word corresponding to the initial target word information with the largest initial target word probability value not belonging to the above-mentioned historical target word information set, set the initial target word information with the largest initial target word probability value as the target word information, and put the target word information into the above-mentioned historical target word information set.

[0110] In some optional implementations of the embodiments, the splicing unit 504 is further configured to: for each target word in the target word information set, in response to determining that the target word information satisfies a preset convergence condition, splice the target word information with the historical target word information sequence corresponding to the target word information to generate spliced ​​text; select a word that matches the spliced ​​text from the preset word list as a connecting word; and combine the connecting word and the spliced ​​text to generate target text.

[0111] The following is for reference. Figure 6 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 A schematic diagram of the structure of the computing device 101)600. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0112] like Figure 6 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0113] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 6 Each box shown can represent a device or multiple devices as needed.

[0114] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined above in the methods of some embodiments of this disclosure.

[0115] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0116] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0117] The aforementioned computer-readable medium may be included in the aforementioned device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: determine a set of decoded word information based on the text to be processed, wherein the text to be processed is used to describe a specified object; perform deduplication processing on the set of decoded word information to generate a set of candidate word information; select candidate word information that satisfies the target conditions from each candidate word information set in the set of candidate word information as target word information, thereby obtaining a set of target word information; for each target word information in the set of target word information, in response to determining that the target word information satisfies the convergence condition, concatenate the target word information and the corresponding historical target word information sequence based on a preset vocabulary to generate target text.

[0118] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via 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).

[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0120] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a determining unit, a deduplication unit, a selection unit, and a concatenation unit. The names of these units do not necessarily limit the specific unit; for example, a deduplication unit may also be described as "a unit that performs deduplication processing on the aforementioned decoded word information set to generate a candidate word information set."

[0121] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0122] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A text generation method, comprising: Based on the text to be processed, a set of decoded word information is determined, including: inputting the text to be processed into a text encoder to generate an encoded hidden layer vector; inputting the encoded hidden layer vector into a decoder to generate a set of decoded word information, wherein the text to be processed is used to describe a specified object, and the decoded word information in the set of decoded word information includes: decoded words and the decoded word probability values ​​corresponding to the decoded words; The decoded word information set is deduplicated to generate a candidate word information set, wherein decoded word information that does not have the same decoded word is combined with the decoded word information with the highest probability value among the retained decoded word information to generate a candidate word information set; From each candidate word information group in the candidate word information group set, select candidate word information that meets the target conditions as target word information to obtain the target word information set; For each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, the target word information and the corresponding historical target word information sequence are concatenated based on a preset word list to generate target text.

2. The method according to claim 1, wherein, The step of deduplicating the decoded word information set to generate a candidate word information set includes: For each decoded word information group in the decoded word information group set, the decoded word information group is divided into a repeated decoded word information group and a single decoded word information group according to the decoded word; Select repeating decoded word information that meets preset conditions from the repeating decoded word information group as target repeating decoded word information; The target repeated decoded word information and the single decoded word information group are concatenated to generate the candidate word information group.

3. The method according to claim 2, wherein, For each decoded word information group in the decoded word information group set, the process of dividing the decoded word information group into repeated decoded word information groups and single decoded word information groups based on the decoded word includes: For each decoded word information group in the decoded word information group set, in response to the existence of other decoded word information containing the decoded word information in the decoded word information group, the decoded word information and the other decoded word information are placed into a duplicate decoded word information group; otherwise, the decoded word information is placed into a single decoded word information group.

4. The method according to claim 1, wherein, The candidate word information set includes: candidate words and their corresponding probability values; and The step of selecting candidate word information that meets the target conditions from each candidate word information group in the candidate word information group set as the target word information includes: For each candidate word information group in the candidate word information group set, at least one candidate word information is selected from the candidate word information group in descending order of the candidate word probability values; The candidate word with the highest probability value among the at least one candidate word information is placed into the historical target word information set, and at least one initial target word information of the candidate word with the highest probability value is determined. Target word information corresponding to the candidate word information is generated based on the at least one initial target word information. The initial target word information in the at least one initial target word information includes: an initial target word and an initial target word probability value corresponding to the initial target word.

5. The method according to claim 4, wherein, The step of generating target word information corresponding to the candidate word information based on the at least one initial target word information includes: In response to the fact that the initial target word information with the largest initial target word probability value belongs to the historical target word information set, the probability difference of repeated words between the initial target word information with the largest initial target word probability value and the corresponding historical target word information in the historical target word information set is determined. In response to the fact that the probability difference of repeated words is greater than the initial target word probability value of other initial target word information corresponding to the candidate word information, the initial target word information with the largest initial target word probability value is set as the target word information, and the target word information is placed into the historical target word information set.

6. The method according to claim 4, wherein, The step of generating target word information corresponding to the candidate word information based on the at least one initial target word information includes: In response to the fact that the initial target word information with the largest initial target word probability value belongs to the historical target word information set, the probability difference of repeated words between the initial target word information with the largest initial target word probability value and the corresponding historical target word information in the historical target word information set is determined. In response to the fact that the probability difference of repeated words is less than or equal to the initial target word probability value of other initial target word information corresponding to the candidate word information, the initial target word information with the largest initial target word probability value among the other initial target word information is set as the target word information, and the target word information is placed into the historical target word information set.

7. The method according to claim 4, wherein, The step of generating target word information corresponding to the candidate word information based on the at least one initial target word information includes: In response to the initial target word information corresponding to the initial target word information with the highest initial target word probability value not belonging to the historical target word information set, the initial target word information with the highest initial target word probability value is set as the target word information, and the target word information is put into the historical target word information set.

8. The method according to claim 1, wherein, For each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, based on a preset vocabulary, the target word information and the corresponding historical target word information sequence are concatenated to generate target text, including: For each target word in the target word information set, in response to determining that the target word information satisfies a preset convergence condition, the target word information is concatenated with the historical target word information sequence corresponding to the target word information to generate concatenated text; Select words from the preset vocabulary that match the concatenated text as connecting words; The connecting words and the concatenated text are combined to generate the target text.

9. A text generation apparatus, comprising: The determining unit is configured to determine a set of decoded word information based on the text to be processed, including: inputting the text to be processed into a text encoder to generate an encoded hidden layer vector; inputting the encoded hidden layer vector into a decoder to generate a set of decoded word information, wherein the text to be processed is used to describe a specified object, and the decoded word information in the set of decoded word information includes: decoded words and decoded word probability values ​​corresponding to the decoded words; The deduplication unit is configured to perform deduplication processing on the set of decoded word information to generate a set of candidate word information, wherein decoded word information that does not have the same decoded word is combined with the decoded word information with the highest probability value among the retained decoded word information to generate a set of candidate word information. The selection unit is configured to select candidate word information that meets the target conditions from each candidate word information group in the candidate word information group set as target word information, thereby obtaining a target word information set; The splicing unit is configured to, for each target word in the target word information set, in response to determining that the target word information satisfies the convergence condition, splice the target word information and the corresponding historical target word information sequence based on a preset vocabulary to generate target text.

10. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

11. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Text generation method and server

    CN107977196A

  • Model training and ancient poem generation method, ancient poem generation model, equipment and medium

    CN111368514A

  • Text generation method and device, electronic equipment and computer readable storage medium

    CN111626044A