Text generation method, medium, device and electronic device

By obtaining user feature data and generating personalized summary text, the problem of low opening rate caused by text generation methods in the prior art is solved, and user interest and text opening rate are improved.

CN113642296BActive Publication Date: 2025-04-11HANGZHOU NETEASE ZHIQI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110998530.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-27
Publication Date
2025-04-11
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

In the prior art, when generating a summary or title of a text, a fixed and unified approach results in a lower opening rate of the text.

Method used

By obtaining user characteristic data, generating user text, and combining preset text, a personalized summary text for the user, including at least one of a summary and a title.

Benefits of technology

It increases users' interest in preset text, improves the opening rate of preset text, and meets the personalized needs of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642296B_ABST
    Figure CN113642296B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a text generation method, medium, device and electronic device. The method includes: obtaining user feature data, the user feature data is used to indicate the features of the corresponding user; generating user text according to the user feature data; generating a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text includes at least one of an abstract and a title. The user feature data can indicate the features of the corresponding user, so the same preset text generates personalized summary texts for the features of each user under different user feature data, thereby increasing the user's interest in the preset text and improving the opening rate of the preset text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of Internet technology, and more specifically, the embodiments of the present disclosure relate to a text generation method, medium, device and electronic device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In daily life, users are exposed to a large amount of text, which may include marketing copy, news articles and other different types of text.

[0004] Users usually read texts through terminal devices such as mobile phones. Since many texts are long and the display interface of the terminal device is limited, a summary or title of the text is first generated and then displayed to the user on the terminal device in the form of a summary or title. When the user is interested in the summary or title, he can further click to view the full text. Therefore, the summary or title of the text has a great influence on whether the user clicks to view the text.

[0005] At present, when the related technology generates the summary or title of a text, the summary or title of a single text is fixed and unified, resulting in a low opening rate of the text. Summary of the invention

[0006] The embodiments of the present disclosure provide a text generation method, medium, device and electronic device to solve the problem that the opening rate of a text is affected by the title or abstract.

[0007] In a first aspect, an embodiment of the present disclosure provides a text generation method, comprising:

[0008] Acquiring user characteristic data, where the user characteristic data is used to indicate characteristics of a corresponding user;

[0009] Generate user text according to the user feature data;

[0010] A summary text of the preset text for the user is generated according to the preset text and the user text, wherein the summary text includes at least one of an abstract and a title.

[0011] In a possible implementation manner, the number of the user characteristic data is multiple; and the generating the user text according to the user characteristic data includes:

[0012] For any user characteristic data, generate a corresponding subtext according to the user characteristic data;

[0013] The sub-texts corresponding to the user characteristic data are merged to generate the user text.

[0014] In a possible implementation manner, generating a summary text of the preset text for the user according to the preset text and the user text includes:

[0015] Obtaining a first text vector corresponding to the user text;

[0016] Obtaining a second text vector corresponding to the preset text;

[0017] Merging the first text vector and the second text vector to generate a third text vector;

[0018] The summary text is generated according to the third text vector.

[0019] In a possible implementation manner, the second text vector includes a second text sub-vector corresponding to each character in the preset text; and obtaining the second text vector corresponding to the preset text includes:

[0020] Obtaining a weight value of at least one word in the preset text;

[0021] The second text vector is obtained according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

[0022] In a possible implementation, generating the summary text according to the third text vector includes:

[0023] Generate the first word in the summary text according to the third text vector;

[0024] According to the third text vector and the first k-1 words in the summary text, determining the kth word in the summary text in the target word library to obtain the summary text;

[0025] Among them, the k is 2, 3, ..., n in sequence, wherein the n is the number of words included in the summary text, n is a positive integer, the target vocabulary is a preset vocabulary, or the target vocabulary includes the preset vocabulary and words in the preset text.

[0026] In a possible implementation, the target vocabulary includes a preset vocabulary and words in the preset text; and determining the kth word in the summary text in the target vocabulary according to the third text vector and the first k-1 words in the summary text includes:

[0027] Obtaining probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters;

[0028] The word with the highest probability among the multiple words is determined as the k-th word.

[0029] In a possible implementation, acquiring the probabilities of multiple words in the target vocabulary according to the third text vector and the first k-1 words includes:

[0030] Obtaining an indication probability according to the third text vector and the first k-1 words;

[0031] Obtaining the probabilities of the characters in the preset word library and the weight value of at least one character in the preset text;

[0032] The probabilities of the multiple characters in the target vocabulary are obtained according to the indicated probability, the probabilities of the characters in the preset vocabulary and the weight value of at least one character in the preset text.

[0033] In a possible implementation manner, generating a summary text of the preset text for the user according to the preset text and the user text includes:

[0034] Inputting the preset text and the user text into a preset model to obtain the summary text output by the preset model;

[0035] The preset model is obtained by training with multiple groups of training samples, and each group of training samples includes sample preset text, sample user text and sample summary text.

[0036] In a second aspect, an embodiment of the present disclosure provides a text generation device, including:

[0037] An acquisition module, used to acquire user characteristic data, wherein the user characteristic data is used to indicate characteristics of a corresponding user;

[0038] A processing module, used for generating user text according to the user characteristic data;

[0039] The text generation module is used to generate a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text includes at least one of an abstract and a title.

[0040] In a possible implementation manner, the number of the user characteristic data is multiple; and the processing module is specifically used to:

[0041] For any user characteristic data, generate a corresponding subtext according to the user characteristic data;

[0042] The sub-texts corresponding to the user characteristic data are merged to generate the user text.

[0043] In a possible implementation, the text generation module is specifically used to:

[0044] Obtaining a first text vector corresponding to the user text;

[0045] Obtaining a second text vector corresponding to the preset text;

[0046] Merging the first text vector and the second text vector to generate a third text vector;

[0047] The summary text is generated according to the third text vector.

[0048] In a possible implementation manner, the second text vector includes a second text sub-vector corresponding to each word in the preset text; and the text generation module is specifically configured to:

[0049] Obtaining a weight value of at least one word in the preset text;

[0050] The second text vector is obtained according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

[0051] In a possible implementation, the text generation module is specifically used to:

[0052] Generate the first word in the summary text according to the third text vector;

[0053] According to the third text vector and the first k-1 words in the summary text, determining the kth word in the summary text in the target word library to obtain the summary text;

[0054] Among them, the k is 2, 3, ..., n in sequence, wherein the n is the number of words included in the summary text, n is a positive integer, the target vocabulary is a preset vocabulary, or the target vocabulary includes the preset vocabulary and words in the preset text.

[0055] In a possible implementation, the target word library includes a preset word library and characters in the preset text; and the text generation module is specifically used to:

[0056] Obtaining probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters;

[0057] The word with the highest probability among the multiple words is determined as the k-th word.

[0058] In a possible implementation, the text generation module is specifically used to:

[0059] Obtaining an indication probability according to the third text vector and the first k-1 words;

[0060] Obtaining the probabilities of the characters in the preset word library and the weight value of at least one character in the preset text;

[0061] The probabilities of the multiple characters in the target vocabulary are obtained according to the indicated probability, the probabilities of the characters in the preset vocabulary and the weight value of at least one character in the preset text.

[0062] In a possible implementation, the text generation module is specifically used to:

[0063] Inputting the preset text and the user text into a preset model to obtain the summary text output by the preset model;

[0064] The preset model is obtained by training with multiple groups of training samples, and each group of training samples includes sample preset text, sample user text and sample summary text.

[0065] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0066] The memory stores computer-executable instructions;

[0067] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the text generation method as described in any one of the first aspects.

[0068] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the text generation method as described in any one of the first aspects is implemented.

[0069] The text generation method, medium, device and electronic device provided by the embodiments of the present disclosure first obtain user feature data, and generate user text according to the user feature data, and then generate a summary text of the preset text for the user according to the preset text and the user text. Since the user feature data can indicate the characteristics of the corresponding user, the corresponding user text can also indicate the characteristics of the corresponding user, so the summary text generated by the same preset text under different user texts is also different, which is a personalized summary text generated for the characteristics of each user, thereby increasing the user's interest in the preset text and increasing the opening rate of the preset text. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0071] Figure 1 A schematic diagram of text delivery provided by an embodiment of the present disclosure;

[0072] Figure 2 A schematic diagram for generating summary text;

[0073] Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0074] Figure 4 A schematic diagram of generating a personalized summary text provided by an embodiment of the present disclosure;

[0075] Figure 5 A flowchart of a text generation method provided by an embodiment of the present disclosure;

[0076] Figure 6 A schematic diagram of an encoder-decoder framework;

[0077] Figure 7 A schematic diagram of generating a first text vector provided by an embodiment of the present disclosure;

[0078] Figure 8 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 1 ;

[0079] Fig. 9 A schematic diagram of an attention-based encoder-decoder framework;

[0080] Fig.10 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 2 ;

[0081] Fig.11 A schematic diagram of a pointer generation network provided in an embodiment of the present disclosure;

[0082] Fig.12 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 3 ;

[0083] Fig.13 A schematic diagram of a personalized summary text provided by an embodiment of the present disclosure;

[0084] Fig.14 A schematic diagram of the structure of a text generation device provided in an embodiment of the present disclosure;

[0085] Fig.15 A schematic diagram of a program product provided by an embodiment of the present disclosure;

[0086] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

[0087] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0088] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0089] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0090] According to an embodiment of the present disclosure, a text generation method, medium, device and electronic device are proposed.

[0091] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0092] Text is a common way to carry information. All kinds of information in various industries can be carried and transmitted in the form of text. For example, in the news industry, news information can be transmitted in the form of news texts, in the marketing industry, marketing content can be transmitted in the form of marketing copywriting, and in the technology industry, scientific and technological knowledge can be transmitted in the form of popular science articles, etc.

[0093] Take marketing copywriting as an example. Marketing copywriting is a common way of content marketing. It mainly involves writing an article to introduce the content that needs to be marketed. After the marketing copywriting is generated, it needs to be released to some channels for users to click and read. Different from the mass marketing method of spending resources on advertising in media channels, content marketing mainly adopts the "consumers come to you" model, that is, spending resources on generating attractive content and using the free channels of the Internet to spread the content. After the audience reads the marketing copywriting, they become interested in the product and actively come to find the product, thereby achieving the transmission of marketing content.

[0094] After the text is generated, it needs to be delivered so that it can be displayed to the user. Figure 1 A schematic diagram of text delivery provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, when delivering text, due to the limitation of the page size of terminal devices such as mobile phones, a title or summary of the text is usually generated and then delivered.

[0095] For example, Figure 1 In the example, a corresponding title “The most cost-effective mobile phone in 2021” is generated for a certain text on the interface 11. When the user is interested in the title, the user can click to open the text and view the detailed content of the text, such as Figure 1 As shown in the figure, after the user clicks the title, interface 11 switches to interface 12, which introduces three mobile phones produced in 2021, including various parameters such as the processor, pixels, and screen of the mobile phones.

[0096] exist Figure 1 In the example, since users can see a large number of posts every day, they usually do not click on all the texts to view them, but selectively click on them based on the title or summary of each text. Therefore, the title or summary of the text is very important for users to click on it.

[0097] At present, the title or abstract of a text is mainly generated through natural language processing. Natural language processing is a theory or method used to study the effective communication between people and computers using natural language. It is mainly used in various aspects such as machine translation, opinion extraction, text classification, question answering, and speech recognition. In the embodiments of the present disclosure, it mainly involves the generation of a summary text, which may include the generation of an abstract or a title.

[0098] Natural language processing involves machine learning, which is the fundamental way to make computers have intelligent processing capabilities. In machine learning, deep learning is an important branch. Deep learning mainly uses multi-layer artificial neural networks to represent data and use a large number of floating-point numbers to represent a piece of data. Common deep learning frameworks include Bidirectional Encoder Representations with Transformers (BERT), Recurrent Neural Network (RNN), Gate Recurrent Unit (GRU), Long Short-Term Memory (LSTM), Bidirectional Long Short-Term Memory (BiLSTM), Convolutional Neural Network (CNN), etc.

[0099] In the above embodiment, natural language processing is briefly introduced. The following will introduce the generation of summary text corresponding to the text. Figure 2 is a schematic diagram for generating summary text, such as Figure 2 As shown, for a preset text, a standardized summary text is generated through a first algorithm solution. The standardized summary text can be the title of the preset text or the abstract of the preset text.

[0100] Figure 2 In the example of the summary text generation scheme, after the preset text is determined, the generated summary text is also determined. Therefore, when the channel is subsequently released, for a preset text, the summary text browsed by all users is the same, that is, a unified standardized summary text.

[0101] The summary text has an important influence on whether users click to browse the corresponding preset text, and different users have different preferences. By generating standardized summary text for promotion, the target audience can be small, which will lead to a low opening rate of the preset text, which is not conducive to the information transmission of the preset text.

[0102] Exemplary Methods

[0103] Combine the following Figure 3 For application scenarios, refer to Figure 3To describe the text generation method according to the exemplary embodiment of the present disclosure. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0104] Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present disclosure, such as Figure 3 As shown in the figure, a preset text is generated for marketing a pair of shoes. The preset text introduces the shoes in detail. The biggest selling point of the shoes is the fashionable style, so the style of the shoes is introduced. At the same time, the sole of the shoes has good anti-slip performance and excellent waterproof effect.

[0105] pass Figure 2 The generation scheme of the summary text of the example is Figure 3 The preset text in is processed to generate the corresponding title "Click here for the most fashionable hot-selling shoes of the year", and then the channel is released. Among them, both users A and B received the released title, which is the summary text of the preset text. User A just wants to buy a fashionable shoe, so he clicks on the title on the terminal device 31, and the terminal device 31 displays the corresponding preset text for user A to view. However, user B is a pregnant woman who wants to buy a pair of waterproof and non-slip shoes. She has no requirements for the style of the shoes. Therefore, when user B sees the title on the terminal device 32, she is not interested in the title and chooses not to click to view it.

[0106] from Figure 3 In the example, we can see that although this pair of shoes meets the requirements of being waterproof and non-slip, since this is not reflected in the title, it does not attract user B, which invisibly reduces the opening rate of the preset text and affects the dissemination of the preset text.

[0107] It should be noted that Figure 3 The application scenarios of the examples are only introduced by taking the marketing direction as an example. The application scenarios of the present disclosure are not limited to the marketing direction, and accordingly, the preset text is not limited to the marketing copy, and can also be other text types, such as scientific articles, news articles, etc.

[0108] Based on the above technical problems, an embodiment of the present disclosure provides a method for generating a personalized summary text. Figure 4 A schematic diagram of generating a personalized summary text provided by an embodiment of the present disclosure, such as Figure 4 As shown, after the preset text is obtained, a personalized summary text for different users is generated through the second algorithm solution. The personalized summary text can be the title of the preset text or the abstract of the preset text.

[0109] The same preset text generates different summary texts for different users, which can fully consider the preferences of different users, thereby covering more audiences and improving the opening rate of the preset text without changing the preset text. The solution of the present disclosure will be introduced below in conjunction with the accompanying drawings.

[0110] Figure 5 A flowchart of a text generation method provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the method may include:

[0111] S51, obtaining user characteristic data, where the user characteristic data is used to indicate characteristics of a corresponding user.

[0112] The execution subject in the embodiments of the present disclosure may be, for example, various terminal devices such as mobile phones, tablets, and computers. When a user uses a terminal device, user characteristic data is generated. For example, articles that the user has browsed on the terminal device, products that the user has purchased, various forms of communication content, etc. After authorization by the user, the terminal device can obtain the user characteristic data.

[0113] The user characteristic data is used to indicate the characteristics of the corresponding user, wherein the user characteristics may be, for example, the user's preferences, the user's pain points, etc. Optionally, since the user's recent behavior can better reflect the user's needs, the acquired user characteristic data may be user characteristic data within a preset period, such as user characteristic data within the past week.

[0114] For example, if a user likes aerospace and often searches for news or articles related to aerospace, the terminal device will obtain the news or articles about aerospace that the user has browsed. These news or articles are user feature data, indicating the user's preference.

[0115] For example, a user recently suffers from rhinitis and often searches for treatment options for rhinitis on the terminal device and buys drugs for rhinitis online. These treatment options, drug names, or instructions are all user feature data, indicating the user's pain points.

[0116] S52, generating user text according to the user characteristic data.

[0117] The user characteristic data can indicate the characteristics of the user, thereby reflecting the user's needs to a certain extent. After the user characteristic data is obtained, the user text can be generated according to the user characteristic data.

[0118] Since user feature data may be in other forms, such as pictures, voice, etc., they will all be converted into text, that is, the corresponding user text. The substantive content of user text and user feature data is the same, only the representation form is different. Therefore, user text can also indicate the characteristics of the user.

[0119] S53, generating a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text includes at least one of an abstract and a title.

[0120] The preset text is the text that will eventually generate a summary or title, and the preset text may be, for example, a marketing copy, a news article, etc. After the user text is generated, a summary text for the user is generated based on the preset text and the user text.

[0121] After the preset text is determined, the user texts for different users are different. The summary text is generated based on the preset text and the user text. When the user text is different, the generated summary text is also different, that is, the generated summary text is a personalized summary text for different users. The summary text includes at least one of the abstract and the title, and may include only the abstract, only the title, or both the abstract and the title.

[0122] The text generation method provided by the embodiment of the present disclosure first obtains user feature data, generates user text according to the user feature data, and then generates a summary text of the preset text for the user according to the preset text and the user text. Since the user feature data can indicate the features of the corresponding user, and the corresponding user text can also indicate the features of the corresponding user, the summary text generated by the same preset text under different user texts is also different, which is a personalized summary text generated according to the features of each user, thereby increasing the user's interest in the preset text and improving the opening rate of the preset text.

[0123] The solution of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0124] Before generating a summary text of a preset text for a user, and after authorization by the user, user feature data must first be obtained, which is used to indicate the characteristics of the corresponding user. Among them, there are many sources of user feature data, for example, it can include the title, abstract or full text content of the article that the user has clicked or read before; for example, it can include the title, introduction, manual, advertising copy, etc. of the product or service that the user has purchased; for example, it can include the user's text communication content, such as the chat content of the communication software, email, text message, customer service software communication record, marketing automation software communication record, etc.; for example, it can include the user's voice communication content, such as outbound calls; for example, it can include the user's picture communication content, such as document audio and video copies, communication screenshots, etc.

[0125] After obtaining the user characteristic data, it is necessary to generate the corresponding user text according to the user characteristic data. Usually, there are multiple user characteristic data, and for any user characteristic data, a corresponding subtext is generated according to the user characteristic data.

[0126] Among them, if the user feature data is data in text form, such as text communication records, articles read, etc., the corresponding sub-text can be generated by directly extracting the corresponding text. If the user feature data is data in other forms, it is necessary to first convert the text into text data, and then generate the corresponding sub-text. For example, if the user feature data is voice, it is necessary to extract the text version of the content through voice recognition; if the user feature data is a picture, it is necessary to extract the text version of the content from the picture through optical character recognition (OCR) technology, and so on.

[0127] After obtaining the subtexts corresponding to each user feature data, the subtexts corresponding to each user feature data are merged to generate user text. For example, a user reads three articles with the following titles: Title 1-Algorithm Engineer Skill Tree: Recommendation Algorithm Elementary; Title 2-Column: Several Cognitive Issues about Artificial Intelligence; Title 3-An Open Source Distributed Framework That Breaks Through Parallel Bottlenecks is Here.

[0128] The above three titles are sub-texts corresponding to three user feature data. The user text is obtained by merging these three sub-texts as follows:

[0129] Algorithm Engineer Skill Tree: Recommendation Algorithm Basic <sep>Column: Some issues concerning artificial intelligence <sep>An open source distributed framework that breaks through the parallel bottleneck is here

[0130] in, <sep>As a separator, subtexts from different sources can be separated by separators. <sep>is an example of a separator, and any other separator may be used. The user text obtained by merging the sub-texts is a long sentence that can indicate the characteristics of the user.

[0131] After obtaining the user text, a summary text of the preset text for the user can be generated according to the preset text and the user text. In the embodiment of the present disclosure, the first text vector corresponding to the user text is first obtained. Before introducing the acquisition of the first text vector, the encoder-decoder framework is first introduced.

[0132] Figure 6 is a schematic diagram of an encoder-decoder framework, such as Figure 6 As shown, the encoder-decoder framework can be regarded as a translation model, which can receive an input text sequence as input. The encoder processes the input text sequence to obtain a vector embedding representation of the input text sequence, and then the decoder processes the vector embedding representation of the input text sequence to obtain an output text sequence.

[0133] The vector embedding representation of the input text sequence can be regarded as a mapping from the semantic space to the vector space. Two words with similar semantics are also close in position in the vector space. The vector embedding representation of the input text sequence can be regarded as an intermediate representation of the input text sequence, which exists in the form of a vector. The decoder can output the decoded target language based on the vector embedding representation of the input text sequence, that is, the output text sequence.

[0134] The encoder-decoder framework can be seen as a general processing model suitable for processing a text. For a text pair <input text, target text>, its goal is to give the input text, input it to the encoder, and output the target text through the encoder-decoder framework. Suppose the input text and the target text are composed of their own sequences:

[0135] Input text =<x1,x2,...,xm> , target text =<y1,y2,...,yn> .

[0136] For the encoder, the processing process is to encode the input text and convert it into an intermediate semantic representation C through a nonlinear transformation:

[0137] C=F<x1,x2,...,xm> ,

[0138] C is a vector.

[0139] For the decoder, its processing process is to generate the text to be generated at time i based on the intermediate semantic representation C of the input text and the historical information that has been generated before:

[0140] yi=g(C,y1,y2,...,yi-1).

[0141] Each yi is generated in this way in turn. It can be seen that the structure of the encoder-decoder inputs the target text word by word, and the generation of each word in the target text is related to the previously generated words.

[0142] Figure 6 The framework of the example can be used to generate a summary text of the preset text. In the specific implementation, the training sample is used to Figure 6 The framework of the example is trained so that Figure 6 The encoder-decoder framework of the example has the function of generating summary text based on preset text.

[0143] As can be seen from the above, the encoder can convert the input text into an intermediate form of vector. In the embodiment of the present disclosure, a first text vector can be generated based on the encoder. Specifically, after the user is authorized, the user feature data is obtained, and the user text can be generated based on the user feature data. After the user text is generated, the first text vector can be generated based on the user text. Figure 7 A schematic diagram of generating a first text vector provided by an embodiment of the present disclosure, such as Figure 7 As shown, after the user text is generated, the user text can be input into the user encoder to generate a first text vector. The length of the first text vector can be selected as needed, for example, [0.43434, -0.24329, 0.89342, 0.338127, ..., 0.999434], and the length of the vector is generally in the range of several hundred to several thousand.

[0144] The user encoder may be an RNN, an LSTM, or any other possible neural network framework, such as BERT, BiLSTM, GRU, CNN, etc.

[0145] After obtaining the first text vector corresponding to the user text, it is necessary to obtain the second text vector corresponding to the preset text. There are multiple ways to obtain the second text vector, which are introduced below.

[0146] One possible implementation is to Figure 6 The decoder in the illustrated encoder-decoder framework processes the preset text to generate a second text vector corresponding to the preset text.

[0147] After the first text vector and the second text vector are generated, the first text vector and the second text vector may be merged to generate a third text vector, and a summary text may be generated according to the third text vector.

[0148] Specifically, you can Figure 6 The framework of the example Figure 7 The framework of the example is combined, that is, through Figure 7 The framework of the example obtains the first text vector by Figure 6 The encoder in the framework of the example obtains the second text vector, and then merges the first text vector and the second text vector to generate a third text vector. Figure 8 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 1 ,like Figure 8 As shown, Figure 8 The framework of the example is Figure 6 and Figure 7 Combination of frameworks of examples.

[0149] Figure 6 The framework in the example is a framework for generating a standard summary text of a preset text based on an encoder-decoder framework. In the embodiment of the present disclosure, user text is added. Figure 8 As shown, the user text is converted into a first text vector through a user encoder, the preset text is converted into a second text vector through an encoder, and then the first text vector and the second text vector are merged to generate a third text vector, wherein the merging process between the first text vector and the second text vector can be, for example, a splicing process or an addition process.

[0150] For example, the first text vector is [0.1, 0.2, 0.3], and the second text vector is [0.4, 0.5, 0.6]. If the merge process is a concatenation process, the third text vector obtained is [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]. If the merge process is an addition process, the third text vector obtained is [0.5, 0.7, 0.9]. When the merge process is an addition process, the lengths of the first text vector and the second text vector must be consistent.

[0151] The encoder-decoder generates the summary text word by word. After generating the third text vector, the first word in the summary text is generated according to the third text vector, and then the kth word in the summary text is determined in the target word library according to the third text vector and the first k-1 words in the summary text to obtain the summary text. Among them, k is 2, 3, ..., n in sequence, n is the number of words included in the summary text, n is a positive integer, and the target word library is the preset word library.

[0152] Among them, the preset vocabulary is a pre-set vocabulary, which includes several characters. The process of determining the kth character in the summary text in the preset vocabulary according to the third text vector and the first k-1 characters in the summary text includes obtaining the probabilities of multiple characters in the preset vocabulary according to the third text vector and the first k-1 characters, and then determining the character with the highest probability among the multiple characters as the kth character.

[0153] Specifically, the preset text is first input into the encoder to obtain the second text vector, and then the first text vector and the second text vector are merged to obtain the intermediate semantic representation C under the framework. The intermediate semantic representation C is Figure 8 In the example of , the third text vector is the third text vector. Then, the decoder processes the third text vector, and a word is selected from the preset word library to generate the first word in the summary text. Next, the decoder processes the third text vector and the first word, and a word is selected from the preset word library to generate the second word in the summary text; the decoder processes the third text vector and the first two words, and a word is selected from the preset word library to generate the third word in the summary text, and so on, until the summary text is generated.

[0154] Figure 8 The framework of the example is in Figure 6 The framework of the example adds the first text vector corresponding to the user feature data. Figure 6 The example introduces the encoder-decoder framework, in which the intermediate semantic representation C is generated by each word of the input text through the encoder. Each word of the input has the same influence on the generated target text, which is equivalent to the human eye seeing a snowflake noise picture without attention focus, which does not conform to the laws of human cognition.

[0155] This technical problem can be solved by introducing an attention mechanism. Fig. 9 is a schematic diagram of an attention-based encoder-decoder framework, as Fig. 9 As shown in Figure 2, the attention-based encoder-decoder framework is Figure 6 Based on the encoder-decoder framework of the example, an attention mechanism is introduced.

[0156] First, the input text can be input into the encoder, and the encoder encodes the input text to obtain an intermediate semantic representation, which includes the vector corresponding to each word of the input text. Then, based on the intermediate semantic representation and the current state of the decoder, the attention weight value of each word in the input text to the current output of the decoder can be calculated. The vector corresponding to each word in the input text and the corresponding attention weight value are weighted and summed, and then input into the decoder to obtain the target text.

[0157] The attention mechanism is mainly used to filter the input text and focus on the important information in it. The larger the attention weight value corresponding to a word in the input text, the more the decoder focuses on the vector corresponding to this word when outputting the target text. That is, the attention weight value represents the importance of the word in the input text.

[0158] In the embodiment of the present disclosure, Figure 7 The framework of the example Fig. 9 The framework of the example is combined, that is, through Figure 7 The framework of the example obtains the first text vector by Fig. 9 The encoder in the framework of the example obtains the second text vector, and then merges the first text vector and the second text vector to generate a third text vector. Fig.10 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 2 ,like Fig.10 As shown, Fig.10 The framework of the example is Figure 7 and Fig. 9 Combination of frameworks of examples.

[0159] Fig. 9 The framework of the example in is a framework for generating a standard summary text of a preset text based on an attention-based encoder-decoder framework. In the embodiment of the present disclosure, user text is added. Fig.10 As shown, the user text is converted into a first text vector through a user encoder, and the preset text is converted into a second text vector through an encoder based on an attention mechanism. The second text vector includes a second text sub-vector corresponding to each word in the preset text. The process of obtaining the second text vector first requires obtaining the weight value of at least one word in the preset text, which is the corresponding attention weight value, and then obtaining the second text vector according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

[0160] Then the first text vector and the second text vector are merged to generate a third text vector, wherein the merging process between the first text vector and the second text vector may be, for example, concatenation or addition. The merging process between the first text vector and the second text vector may be referred to in Figure 8 The relevant parts of the embodiment will not be described in detail here.

[0161] Fig.10 The framework of the example is an improved version of the encoder-decoder framework, which also generates summary text word by word. After generating the third text vector, first generate the first word in the summary text according to the third text vector, and then determine the kth word in the summary text in the target vocabulary according to the third text vector and the first k-1 words in the summary text to obtain the summary text. Among them, k is 2, 3, ..., n in turn, n is the number of words included in the summary text, n is a positive integer, and the target vocabulary is the preset vocabulary.

[0162] Among them, the preset vocabulary is a pre-set vocabulary, which includes several characters. The process of determining the kth character in the summary text in the preset vocabulary according to the third text vector and the first k-1 characters in the summary text includes obtaining the probabilities of multiple characters in the preset vocabulary according to the third text vector and the first k-1 characters, and then determining the character with the highest probability among the multiple characters as the kth character.

[0163] Specifically, the preset text is first input into the encoder to obtain the second text vector, and then the first text vector and the second text vector are merged to obtain the intermediate semantic representation C under the framework. The intermediate semantic representation C is Fig.10 In the example, the third text vector is obtained. Then, according to the decoder, the third text vector is processed, and a word is selected from the preset word library to generate the first word in the summary text. Next, according to the current state of the decoder, the weight value of at least one word in the preset text is obtained, and according to the weight value of the at least one word and the second text sub-vector corresponding to each word, the second text vector is updated to generate an updated third text vector. Then, according to the decoder, the updated third text vector and the first word are processed, and a word is selected from the preset word library to generate the second word in the summary text; after the second word is generated, the weight value of at least one word in the preset text is continued to be obtained according to the current state of the decoder, and the weight value of the at least one word and the second text sub-vector corresponding to each word are weighted to update the second text vector, and the third text vector is updated according to the updated second text vector, and the updated third text vector and the first two words are processed according to the decoder, and a word is selected from the preset word library to generate the third word in the summary text, and so on. Each word is generated according to the above method until the summary text is generated.

[0164] In this implementation, due to the introduction of the attention mechanism, the third text vector is updated by the weighted second text vector generated, so that it is possible to focus on important information, making the generated summary text more accurate.

[0165] Figure 6 and Fig. 9 Two natural language processing frameworks are demonstrated, but Figure 6 and Fig. 9 Both frameworks have a flaw, which is the problem of unregistered words. Figure 6 and Fig. 9 In the framework, a word library needs to be set in advance, that is, the preset word library, which includes several characters, such as the 100,000 most common Chinese characters. The characters included in the preset word library will not change after generation. After the model is built, it enters the online service state. Therefore, based on Figure 6 and Fig. 9 When generating summary text in the framework, the words in the summary text can only be selected from the preset word library. For the task of generating summary text, the input text (i.e., the preset text) is likely to contain unknown words, that is, words that do not appear in the preset word library, and these words are based on Figure 6 and Fig. 9 The framework will not appear in the summary text.

[0166] Based on this technical problem, the architecture of the pointer generation network is introduced. Fig.11 A schematic diagram of a pointer generation network provided in an embodiment of the present disclosure, such as Fig.11 As shown, in Fig. 9 Improvements have been made to the example framework.

[0167] The main improvement of the pointer generation network is that it calculates a probability value Pgen, which can be used to decide whether to generate a word from the preset word library or copy a word from the preset text. Specifically, the words that appear in the preset word library and the preset text together constitute an extended word library, which is the target word library. The pointer generation network obtains the probability distribution on the target word library through the following formula:

[0168] Pgen*probability distribution of words in the preset vocabulary + (1-Pgen)*attention of words in the preset text.

[0169] After obtaining the probability distribution on the target vocabulary, the word with the highest probability in this probability distribution is the word generated in the current step.

[0170] In the embodiment of the present disclosure, based on Fig.11 In the framework of the pointer generation network of the example, add Figure 7 The framework of the example, Fig.12 The framework of the example. Fig.12 A schematic diagram of a framework for generating summary text provided in an embodiment of the present disclosure Figure 3 ,like Fig.12 As shown, the user text is converted into a first text vector through a user encoder, and the preset text is converted into a second text vector through a pointer-based generation network. The second text vector includes a second text word vector corresponding to each word in the preset text. The process of obtaining the second text vector first requires obtaining the weight value of at least one word in the preset text, which is the corresponding attention weight value, and then obtaining the second text vector based on the weight value of at least one word in the preset text and the second text word vector corresponding to each word. In the embodiment of the present disclosure, the process of obtaining the second text vector is the same as Fig.10 The process of obtaining the second text vector of the example is similar.

[0171] The target word library includes a preset word library and words in a preset text, the preset word library is a pre-set word library, and the preset word library includes a plurality of words. The process of determining the kth word in the summary text in the target word library according to the third text vector and the first k-1 words in the summary text includes obtaining the probabilities of multiple words in the target word library according to the third text vector and the first k-1 words, and then determining the word with the highest probability among the multiple words as the kth word.

[0172] First, the first word in the summary text is generated according to the third text vector, and the indication probability Pgen is obtained according to the third text vector and the first word. Then, the probability of the words in the preset vocabulary and the weight value of at least one word in the preset text are obtained, and the probabilities of multiple words in the target vocabulary are obtained according to the indication probability Pgen, the probability of the words in the preset vocabulary and the weight value of at least one word in the preset text, and the word with the highest probability is determined as the kth word, where k is 2, 3, ..., n, respectively, where n is the number of words included in the summary text, n is a positive integer, and the target vocabulary includes the words in the preset vocabulary and the preset text. The probability distribution of the words in the target vocabulary is obtained by the following formula:

[0173] Pgen*probability distribution of words in the preset vocabulary + (1-Pgen)*attention of words in the preset text.

[0174] After obtaining the probability distribution of the target word library, the word with the highest probability in this probability distribution is the word generated in the current step. Each word is generated according to the above scheme to obtain the summary text.

[0175] Fig.12 The framework of the example can ensure that the unregistered words appear in the summary text, so that the generated summary text can be more accurate and can more accurately express the meaning of the preset text.

[0176] After obtaining the preset text and the user text, the summary text can also be obtained through model training. Specifically, the preset model is first trained according to multiple groups of training samples, wherein each group of training samples includes sample preset text, sample user text and sample summary text, the sample summary text is a summary of the sample preset text, and the sample user text is used to characterize the characteristics of the sample user. When the sample preset texts are the same, the training samples may include multiple groups of different sample user texts and sample summary texts corresponding to different sample user texts.

[0177] Then, the sample preset text and the sample user text are input into the preset model to obtain the output summary text, and the parameters of the preset model are adjusted according to the difference between the sample summary text and the output summary text. After the training is completed, the preset model has the function of generating different summary texts based on different user texts. Then the preset text and the user text can be input into the preset model, and the preset model can input the summary text of the preset text for the user based on the preset text and the user text, and the summary text can include at least one of the abstract or the title.

[0178] The solution of the present disclosure is introduced below with reference to an example.

[0179] Fig.13 A schematic diagram of a personalized summary text provided by an embodiment of the present disclosure, such as Fig.13 As shown, a preset text is included, which introduces a pair of shoes. The biggest selling point of the shoes is that they are fashionable and have good anti-slip and waterproof properties.

[0180] When delivering the preset text, for example, there are existing users A and B. For user A, user A needs a pair of fashionable shoes recently, so he often searches for "shoe styles", "fashionable women's shoes", etc. on the terminal device 131. After authorization by user A, user feature data of user A can be obtained, and combined with the preset text, a title for user A is generated, "Click here for the most fashionable shoes of the year".

[0181] After seeing the title, user A clicks on the title to view the introduction of the shoes because it meets user A's recent needs, and then has the idea of ​​purchasing the shoes.

[0182] User B has different needs from user A. User B is a pregnant woman and needs a pair of shoes with good anti-slip performance. Therefore, she often searches for "anti-slip shoes" and "anti-slip shoes for pregnant women" on the terminal device 132. After authorization by user B, user feature data of user B can be obtained, and combined with the preset text, a title "new anti-slip shoes specially for pregnant women and other groups" is generated for user B.

[0183] After user B sees the title, because the shoe just meets user B's need for anti-slip performance, user B clicks on the title to view the introduction of the shoe and also has the idea of ​​buying the shoe.

[0184] Fig.13 In the example, user A and user B are viewing the introduction of the same shoe, but the titles they see are different. If the title user A sees is "New anti-slip shoes for pregnant women and other groups", user A will not be interested in clicking to view it; similarly, if the title user B sees is "Click here for the most fashionable and popular shoes of the year", he will also not be interested in clicking to view it. The solution of the embodiment of the present disclosure obtains user feature data of different users and generates a summary or title for the user, so as to fully grasp the user's preferences or pain points, increase the user's interest in the preset text, and increase the opening rate of the preset text.

[0185] Exemplary Devices

[0186] After introducing the method of the exemplary embodiment of the present disclosure, next, refer to Fig.14 The device of the exemplary embodiment of the present disclosure is described. The device of the exemplary embodiment of the present disclosure can implement each process in the aforementioned method embodiment and achieve the same function and effect.

[0187] Fig.14 A schematic diagram of the structure of a text generation device provided by an embodiment of the present disclosure is shown in FIG. Fig.14 As shown, including:

[0188] An acquisition module 141 is used to acquire user characteristic data, where the user characteristic data is used to indicate characteristics of a corresponding user;

[0189] A processing module 142, configured to generate a user text according to the user characteristic data;

[0190] The text generation module 143 is used to generate a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text includes at least one of an abstract and a title.

[0191] In a possible implementation manner, the number of the user characteristic data is multiple; the processing module 142 is specifically used to:

[0192] For any user characteristic data, generate a corresponding subtext according to the user characteristic data;

[0193] The sub-texts corresponding to the user characteristic data are merged to generate the user text.

[0194] In a possible implementation, the text generation module 143 is specifically used for:

[0195] Obtaining a first text vector corresponding to the user text;

[0196] Obtaining a second text vector corresponding to the preset text;

[0197] Merging the first text vector and the second text vector to generate a third text vector;

[0198] The summary text is generated according to the third text vector.

[0199] In a possible implementation manner, the second text vector includes a second text sub-vector corresponding to each word in the preset text; the text generation module 143 is specifically configured to:

[0200] Obtaining a weight value of at least one word in the preset text;

[0201] The second text vector is obtained according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

[0202] In a possible implementation, the text generation module 143 is specifically used for:

[0203] Generate the first word in the summary text according to the third text vector;

[0204] According to the third text vector and the first k-1 words in the summary text, determining the kth word in the summary text in the target word library to obtain the summary text;

[0205] Among them, the k is 2, 3, ..., n in sequence, wherein the n is the number of words included in the summary text, n is a positive integer, the target vocabulary is a preset vocabulary, or the target vocabulary includes the preset vocabulary and words in the preset text.

[0206] In a possible implementation, the target word library includes a preset word library and characters in the preset text; the text generation module 143 is specifically used to:

[0207] Obtaining probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters;

[0208] The word with the highest probability among the multiple words is determined as the k-th word.

[0209] In a possible implementation, the text generation module 143 is specifically used for:

[0210] Obtaining an indication probability according to the third text vector and the first k-1 words;

[0211] Obtaining the probabilities of the characters in the preset word library and the weight value of at least one character in the preset text;

[0212] The probabilities of the multiple characters in the target vocabulary are obtained according to the indicated probability, the probabilities of the characters in the preset vocabulary and the weight value of at least one character in the preset text.

[0213] In a possible implementation, the text generation module 143 is specifically used for:

[0214] Inputting the preset text and the user text into a preset model to obtain the summary text output by the preset model;

[0215] The preset model is obtained by training with multiple groups of training samples, and each group of training samples includes sample preset text, sample user text and sample summary text.

[0216] The text generation device provided in the embodiment of the present disclosure can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0217] Exemplary Media

[0218] After introducing the method and apparatus of the exemplary embodiments of the present disclosure, next, reference is made to Fig.15 A storage medium according to an exemplary embodiment of the present disclosure is described.

[0219] Fig.15 A schematic diagram of a program product provided by an embodiment of the present disclosure, referring to Fig.15 As shown, a program product 150 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.

[0220] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0221] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable signal medium may also be any readable medium other than a readable storage medium.

[0222] Program code for performing the disclosed operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN).

[0223] Exemplary Computing Devices

[0224] After introducing the method, medium and apparatus of the exemplary embodiments of the present disclosure, next, reference is made to Fig.16 An electronic device according to an exemplary embodiment of the present disclosure is described.

[0225] Fig.16 The electronic device 160 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0226] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as Fig.16 As shown, the electronic device 160 is in the form of a general electronic device. The components of the electronic device 160 may include but are not limited to: at least one processing unit 161, at least one storage unit 162, and a bus 163 connecting different system components (including the processing unit 161 and the storage unit 162).

[0227] The bus 163 includes a data bus, a control bus, and an address bus.

[0228] The storage unit 162 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1621 and / or a cache memory 1622 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 1623 .

[0229] The storage unit 162 may also include a program / utility 1625 having a set (at least one) of program modules 1624, such program modules 1624 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0230] The electronic device 160 may also communicate with one or more external devices 164 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 165. Furthermore, the electronic device 160 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 166. Fig.16 As shown, the network adapter 166 communicates with other modules of the electronic device 160 via the bus 163. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 160, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0231] It should be noted that although several units / modules or sub-units / modules of the text generation device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present disclosure, the features and functions of two or more units / modules described above may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided into multiple units / modules for embodiment.

[0232] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0233] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.< / sep> < / sep> < / sep> < / sep>

Claims

1. A text generation method, characterized in that: include: Acquiring user characteristic data, where the user characteristic data is used to indicate characteristics of a corresponding user; Generate user text according to the user feature data; Generate a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text is a title; The step of generating a summary text of the preset text for the user according to the preset text and the user text includes: Converting the user text into a first text vector by a user encoder; The preset text is converted into a second text vector by an encoder based on an attention mechanism; the second text vector includes a second text sub-vector corresponding to each word in the preset text; performing concatenation or addition processing on the first text vector and the second text vector to generate a third text vector; Generate the first word in the summary text according to the third text vector; According to the third text vector and the first k-1 words in the summary text, determining the kth word in the summary text in the target word library to obtain the summary text; The k is 2, 3, ..., n in sequence, wherein n is the number of words included in the summary text, n is a positive integer, and the target vocabulary includes the preset vocabulary and the words in the preset text.

2. The text generation method according to claim 1, characterized in that: The number of the user characteristic data is multiple; the generating the user text according to the user characteristic data includes: For any user characteristic data, generate a corresponding subtext according to the user characteristic data; The sub-texts corresponding to the user characteristic data are merged to generate the user text.

3. The text generation method according to claim 1, characterized in that: The converting the preset text into a second text vector comprises: Obtaining a weight value of at least one word in the preset text; The second text vector is obtained according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

4. The text generation method according to claim 1, characterized in that: The step of determining the kth word in the summary text in the target word library according to the third text vector and the first k-1 words in the summary text comprises: Obtaining probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters; The word with the highest probability among the multiple words is determined as the k-th word.

5. The text generation method according to claim 4, characterized in that: The step of obtaining the probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters includes: Obtaining an indication probability according to the third text vector and the first k-1 words; Obtaining the probabilities of the characters in the preset word library and the weight value of at least one character in the preset text; The probabilities of the multiple characters in the target vocabulary are obtained according to the indicated probability, the probabilities of the characters in the preset vocabulary and the weight value of at least one character in the preset text.

6. A text generation device, characterized in that: include: An acquisition module, used to acquire user characteristic data, wherein the user characteristic data is used to indicate characteristics of a corresponding user; A processing module, used for generating user text according to the user characteristic data; A text generation module, used for generating a summary text of the preset text for the user according to the preset text and the user text, wherein the summary text is a title; The text generation module is specifically used for: Converting the user text into a first text vector by a user encoder; The preset text is converted into a second text vector by an encoder based on an attention mechanism; the second text vector includes a second text sub-vector corresponding to each word in the preset text; performing concatenation or addition processing on the first text vector and the second text vector to generate a third text vector; Generate the first word in the summary text according to the third text vector; According to the third text vector and the first k-1 words in the summary text, determining the kth word in the summary text in the target word library to obtain the summary text; The k is 2, 3, ..., n in sequence, wherein n is the number of words included in the summary text, n is a positive integer, and the target vocabulary includes the preset vocabulary and the words in the preset text.

7. The text generation device according to claim 6, characterized in that: The number of the user characteristic data is multiple; the processing module is specifically used for: For any user characteristic data, generate a corresponding subtext according to the user characteristic data; The sub-texts corresponding to the user characteristic data are merged to generate the user text.

8. The text generation device according to claim 7, characterized in that: The text generation module is specifically used for: Obtaining a weight value of at least one word in the preset text; The second text vector is obtained according to the weight value of at least one word in the preset text and the second text sub-vector corresponding to each word.

9. The text generation device according to claim 6, characterized in that: The target word library includes a preset word library and characters in the preset text; the text generation module is specifically used for: Obtaining probabilities of a plurality of characters in the target vocabulary according to the third text vector and the first k-1 characters; The word with the highest probability among the multiple words is determined as the k-th word.

10. The text generation device according to claim 9, characterized in that: The text generation module is specifically used for: Obtaining an indication probability according to the third text vector and the first k-1 words; Obtaining the probabilities of the characters in the preset word library and the weight value of at least one character in the preset text; The probabilities of the multiple characters in the target vocabulary are obtained according to the indicated probability, the probabilities of the characters in the preset vocabulary and the weight value of at least one character in the preset text.

11. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text generation method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the text generation method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Text title generation method and device

    CN111078865A

  • Method for generating guided text abstract based on Transformer

    CN111897949A

  • Copywriting generation method and device, electronic equipment and storage medium

    CN112883725A