METHOD OF TRAINING INFORMATION GENERATION MODEL, METHOD OF GENERATING INFORMATION, AND DEVICE

The present disclosure provides a method of training an information generation model, a method of generating an information, an electronic device, and a storage medium. A specific implementation solution of the method of training the information generation model includes: splitting a description information for a target object in an information pair into at least one description word, so as to obtain a description word sequence, wherein the information pair further includes a first recommendation information; inputting the description word sequence into a dialog generation model to obtain a probability vector sequence for the target object, wherein each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words; and training the dialog generation model according to the probability vector sequence and the first recommendation information, so as to obtain the information generation model.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application claims the priority of Chinese Patent Application No. 202210159291.3, filed on Feb. 21, 2022, the entire contents of which are hereby incorporated by reference.

TECHNICAL FIELD

The present disclosure relates to a field of artificial intelligence, in particular to fields of natural language processing and deep learning technologies. More specifically, the present disclosure relates to a method of training an information generation model, a method of generating an information, an electronic device, and a storage medium.

BACKGROUND

With a development of a computer technology and a network technology, a method of generating an information through a natural language processing technology has become popular. In order to facilitate a promotion of the information, it is necessary to consider a consistency and a non-repetition of the information.

SUMMARY

The present disclosure aims to provide a method of training an information generation model, a method of generating an information, an electronic device, and a storage medium that may improve a diversity of a generated information.

According to an aspect of the present disclosure, a method of training an information generation model is provided, including: splitting a description information for a target object in an information pair into at least one description word, so as to obtain a description word sequence, wherein the information pair further includes a first recommendation information; inputting the description word sequence into a dialog generation model to obtain a probability vector sequence for the target object, wherein each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words; and training the dialog generation model according to the probability vector sequence and the first recommendation information, so as to obtain the information generation model.

According to another aspect of the present disclosure, a method of generating an information is provided, including: splitting a description information for an object to be recommended into at least one description word, so as to obtain a description word sequence; inputting the description word sequence into an information generation model to obtain a probability vector sequence for the object to be recommended, wherein each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words; and determining a recommendation information for the object to be recommended, according to the probability vector sequence, wherein the information generation model is trained using the method of training the information generation model provided by the present disclosure.

According to another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, cause the at least one processor to implement the method of training the information generation model and/or the method of generating the information provided by the present disclosure.

According to another aspect of the present disclosure, a non-transitory computer-readable storage medium having computer instructions therein is provided, and the computer instructions are configured to cause a computer to implement the method of training the information generation model and/or the method of generating the information provided by the present disclosure.

DETAILED DESCRIPTION OF EMBODIMENTS

Exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings, which include various details of embodiments of the present disclosure to facilitate understanding and should be considered as merely exemplary. Therefore, those of ordinary skilled in the art should realize that various changes and modifications may be made to embodiments described herein without departing from the scope and spirit of the present disclosure. Likewise, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

The present disclosure provides a method of training an information generation model, which includes a splitting stage, a sequence obtaining stage, and a training stage. In the splitting stage, a description information for a target object in an information pair is split into at least one description word, so as to obtain a description word sequence. The information pair further includes a first recommendation information. In the sequence obtaining stage, the description word sequence is input into a dialog generation model to obtain a probability vector sequence for the target object. Each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words. In the training stage, the dialog generation model is trained according to the probability vector sequence and the first recommendation information, so as to obtain the information generation model.

An application scenario of the method and the apparatus provided in the present disclosure will be described below with reference toFIG.1.

FIG.1shows a schematic diagram of an application scenario of a method and an apparatus of training an information generation model and a method and an apparatus of generating an information according to embodiments of the present disclosure.

As shown inFIG.1, an application scenario100of such embodiments may include an electronic device110, which may be various electronic devices with processing functions, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, servers, and so on.

According to embodiments of the present disclosure, the electronic device110may provide, for example, a human-computer interaction interface to obtain a description information120through a user operation. The description information120may be, for example, for an item to be promoted. The electronic device110may generate, for example, a recommendation information130for the item to be promoted, according to the obtained description information120.

Exemplarily, the electronic device110may extract a keyword or a key segment from the description information120, for example, by using a text summary extraction technology, and arrange and combine the extracted keyword or key segment, so as to obtain the recommendation information130.

Exemplarily, the electronic device may also adopt an end-to-end information generation model. The description information120may be input into the information generation model, and the recommendation information130may be output from the information generation model. The end-to-end information generation model may be trained using collected advertising corpus. The information generation model may adopt a recurrent neural network (RNN), specifically, a bi-directional recurrent neural network (BiRNN), a gated recurrent unit (GRU), and a long short-term memory (LSTM). Alternatively, the information generation model may also adopt a Transformer model or the like.

According to embodiments of the present disclosure, as shown inFIG.1, the application scenario100may further include a server150. The server150may train the information generation model according to the corpus, and transmit a trained information generation model140to the electronic device110in response to an acquisition request sent by the electronic device110, so that the electronic device110may generate, by using the information generation model140, a recommendation information for the item to be promoted. It may be understood that the electronic device110may transmit the obtained description information120to the server150, and the server150may generate the recommendation information for the item to be promoted by using the information generation model140.

It may be understood that the electronic device110may be communicatively connected to the server150through a network, which may be a wired or wireless communication link. The server150may be a server providing various services, such as a background management server (for example only) that may provide a support for the human-computer interaction interface running on the electronic device110. The server150may also be a server of a distributed system or a server combined with a block-chain.

It should be noted that the method of generating the information provided in the present disclosure may be performed by the electronic device110or by the server150. Accordingly, the apparatus of generating the information provided in the present disclosure may be provided in the electronic device110or in the server150. The method of training the information generation model provided in the present disclosure may be performed by the server150. Accordingly, the apparatus of training the information generation model provided in the present disclosure may be provided in the server150.

It should be understood that the number and type of the electronic device110and the server150shown inFIG.1are merely schematic. According to implementation needs, any number and type of electronic devices110and servers150may be provided.

The method of training the information generation model provided in the present disclosure will be described below in detail with reference toFIG.2toFIG.5in combination withFIG.1.

FIG.2shows a flowchart of a method of training an information generation model according to embodiments of the present disclosure.

As shown inFIG.2, a method200of training an information generation model in such embodiments may include operation S210to operation S230.

In operation S210, a description information for a target object in an information pair is split into at least one description word, so as to obtain a description word sequence.

According to embodiments of the present disclosure, the information pair may include the description information and a recommendation information. For example, the description information and the recommendation information may be for a same target object, then the information pair may be used as a positive sample. For example, the description information and the recommendation information may be for different target objects, then the information pair may be used as a negative sample. For example, a plurality of information pairs may be provided, and the plurality of information pairs may include both positive samples and negative samples. The target object may be, for example, any promoted item such as clothing, food or furniture.

According to embodiments of the present disclosure, the description information may be split using a tokenization tool, so as to obtain the description word sequence. The tokenization tool may be a Jieba tokenization tool, a Jiagu tokenization tool, or an NLPIR tokenization tool, which is not limited in the present disclosure. For example, if the description information is “children's down jacket”, a word sequence including a word “children” and words “down jacket” may be obtained by tokenization, and the word sequence is the description word sequence.

It may be understood that the first recommendation information may be a recommendation information for a promoted target object, or a recommendation information set manually, etc. The first recommendation information may specifically be a recommendation advertisement for a promoted target object, which is not limited in the present disclosure.

In operation S220, the description word sequence is input into a dialog generation model to obtain a probability vector sequence for the target object.

According to embodiments of the present disclosure, the dialog generation model may include, for example, an encoding network and a decoding network. The encoding network and the decoding network may be selected from a convolutional neural network (CNN), RNN, or a self-attention network. RNN may include BiRNN, GRU or LSTM. In such embodiments, the description word sequence may be directly input into the dialog generation model, and the dialog generation model may output the probability vector sequence. Alternatively, in such embodiments, an embedded representation may be firstly performed on each word in the description word sequence, so as to obtain a word feature vector representing each word. The word feature vector may be used as a token representing the word, and then a token sequence may be obtained by performing the embedded representation on the description word sequence. The probability vector sequence may be obtained by inputting the token sequence into the dialog generation model. It should be noted that each probability vector in the probability vector sequence is output in sequence, and a plurality of tokens in the token sequence may be input into the dialog generation model at the same time.

In an embodiment, the dialogue generation model may include a pre-trained dialogue generation model with a discrete latent variable, so that a “one-to-many” relationship in a dialogue may be effectively modeled, and a diversity of a generated recommendation information may be improved. The pre-trained dialogue generation model with the discrete latent variable may be a “PLATO” series model, such as a PLATO-2 model, which is not limited in the present disclosure.

According to embodiments of the present disclosure, the probability vector sequence obtained may include a plurality of probability vectors, and each probability vector may include probability values for a plurality of predetermined words. Each probability vector may be a token representing a recommendation word, and the plurality of predetermined words may be words included in a predefined dictionary.

In operation S230, the dialogue generation model is trained according to the probability vector sequence and the first recommendation information, so as to obtain the information generation model.

According to embodiments of the present disclosure, the first recommendation information may be split into at least one recommendation word to obtain a recommendation word sequence. Then, the embedded representation of each recommendation word in the recommendation word sequence may be obtained according to the predefined dictionary, so as to obtain the word vector representing each recommendation word. In this way, the recommendation word sequence may be converted into a word vector sequence. In such embodiments, a loss of the dialogue generation model may be determined according to a distance between each word vector in the word vector sequence and a probability vector corresponding to each word vector in the probability vector sequence. By adjusting a network parameter of the dialog generation model using a back propagation algorithm, the loss of the dialog generation model may be minimized, so that the dialog generation model meets a predetermined convergence condition. In such embodiments, the dialog generation model that meets the predetermined convergence condition may be used as the information generation model.

In an embodiment, the dialog generation model may be trained by maximizing a generation probability of the first recommendation information. For example, when at least one recommendation word is obtained, it is possible to determine a probability value P(yt|x, y<t) in a tthprobability vector in the probability vector sequence for a tthrecommendation word y in the at least one recommendation word. Assumed that a number of the recommendation word is T and a number of the probability vectors in the probability vector sequence is also T, the loss of the dialog generation model may be determined using Negative Log-Likelihood loss (NLL loss). Specifically, A loss LNLLof the dialog generation model may be calculated using Equation (1).

where S represents a set of training samples, y<trepresents an information output by the dialog generation model before outputting the tthprobability vector, and x represents an input information of the dialog generation model.

According to the method of training the information generation model in embodiments of the present disclosure, the information generation model for generating the recommendation information may be obtained by training the dialogue generation model, so that the corpus for training to obtain the information generation model may be effectively increased, the diversity and coherence of the recommendation information obtained by using the information generation model may be improved, a case that the generated recommendation information does not conform to common sense and the marketing taste is too heavy may be avoided to some extent, and an effectiveness of an object promotion may be improved. For example, the dialogue generation model used in such embodiments may be a model pre-trained using a natural dialogue corpus, so that the recommendation generation model obtained may learn rich common sense knowledge.

In an embodiment, when training the dialog generation model, the dialog generation model may be pre-trained using massive natural dialog data. The pre-training principle is similar to an implementation principle of the aforementioned method200, which will not be repeated here. In such embodiments, after the pre-training, the pre-trained dialogue generation model may be trained using question-and-answer corpus in the field of information recommendation as training data, so that the dialogue generation model may be transferred from a natural domain to a recommendation domain. Accordingly, the dialogue generation model in operation S220may be a dialogue generation model obtained by pre-training and then training with question-and-answer corpus in the field of information recommendation.

FIG.3shows a schematic diagram of a principle of a method of training an information generation model according to embodiments of the present disclosure.

According to embodiments of the present disclosure, a prompt information may be provided for the information generation model, so that the generated recommendation information may be more in line with actual needs and better reflect a highlight of the item to be promoted. The prompt information and the above-mentioned description information may be provided, for example, by a manufacturer or a seller of the target object.

Specifically, as shown inFIG.3, in an embodiment300, after a description information310and a prompt information320are obtained through the human-computer interaction interface, the description information310may be split into at least one description word by using the above-mentioned tokenization tool, so as to obtain a description word sequence311, and the prompt information320may be split into at least one prompt word to obtain a prompt word sequence321. Then, the description word sequence311and the prompt word sequence321may be input into a dialog generation model301, and the dialog generation model301outputs a probability vector sequence. For example, if the description information is “children's down jacket”, the prompt information may be “leisure warm, free shipping”. Accordingly, the prompt word sequence321may be a word sequence including a word “leisure”, a word “warm” and words “free shipping”.

According to embodiments of the present disclosure, when the probability vector sequence330is obtained, a prediction probability that a second recommendation information includes the prompt information320may be determined according to the probability vector sequence330. With the second recommendation information including the prompt information320as a training target, the dialogue generation model is trained according to the prediction probability that the second recommendation information includes the prompt information320. In this way, the probability that the generated recommendation information includes the prompt information may be increased, so that the generated recommendation information is more in line with actual needs.

In an embodiment, the second recommendation information may be determined firstly according to the probability vector sequence330. Specifically, for each probability vector, it is possible to determine a predetermined word corresponding to a maximum probability value in the probability vector, so as to obtain a prediction word. A plurality of prediction words obtained are sorted according to a position of the probability vector in the probability vector sequence330, and the plurality of prediction words are combined to form the second recommendation information. Then, the second recommendation information may be queried using each word in the prompt word sequence, so as to determine whether the word is contained in the second recommendation information or not. A proportion of the words in the prompt word sequence contained in the second recommendation information may be determined as the prediction probability that the second recommendation information includes the prompt information.

For example, if a plurality of prediction words obtained by sorting include a word “this”, a word “children”, a word “down jacket”, a word “comfortable”, a word “warm”, a word “A”, a word “region”, and a word “free shipping”, the second recommendation information may be “this children's down jacket, comfortable and warm, free shipping for region A”.

In an embodiment, for each prompt word in the prompt word sequence321, a probability that the second recommendation information contains the prompt word may be determined according to a probability value for the prompt word in all probability vectors in the probability vector sequence. Specifically, at least one probability value for the prompt word may be obtained according to all probability vectors. In such embodiments, an average value or a minimum value of the at least one probability value may be used as the probability that the second recommendation information contains the prompt word. For at least one prompt word included in the prompt word sequence321, at least one probability340that the second recommendation information contains the at least one prompt word may be obtained. In such embodiments, a prediction probability350that the second recommendation information contains the prompt information320may be obtained according to the at least one probability340. For example, a sum of the at least one probability340may be determined as the prediction probability350.

When the prediction probability350that the second recommendation information contains the prompt information is obtained, in such embodiments, a first loss value360of the dialog generation model301may be determined according to the first probability. The dialogue generation model301is then trained according to the first loss value360. For example, the first loss value360may be determined using a predetermined loss function. An independent variable in the predetermined loss function is the prediction probability350, a dependent variable in the predetermined loss function is the first loss value360, and the first loss value360is negatively correlated with the prediction probability350, so as to achieve a training goal that the second recommendation information includes the prompt information320.

In an embodiment, the predetermined loss function for determining the first loss value360may be expressed by Equation (2).

where kirepresents a jthprompt word in at least one prompt word, pi(kj|x, y<t) represents a probability value for the jthprompt word in an ithprobability vector in the probability vector sequence, Nis a total number of the at least one prompt word, T is a total number of the probability vectors included in the probability vector sequence, and Lkrepresents the first loss value.

By inputting the prompt information into the dialogue generation model and training the dialogue generation model according to the prediction probability that the second recommendation information includes the prompt information, embodiments of the present disclosure may achieve an effect that a word generated by the dialogue generation model is controllable to a certain extent. In this way, when the information generation model obtained by training is used to generate a recommendation information, the recommendation information may include an expected prompt information.

FIG.4shows a schematic diagram of a principle of a method of training an information generation model according to other embodiments of the present disclosure.

According to embodiments of the present disclosure, the dialog generation model may be trained according to an association relationship between the second recommendation information and the description information indicated by the probability vector sequence, so that a topic of the second recommendation information is closer to a topic described by the description information, and an accuracy of the recommendation information generated using the information generation model obtained by training may be improved to a certain extent.

In an embodiment, the second recommendation information may be determined according to the probability vector sequence by using the method described above. Then, the association relationship between the second recommendation information and the description information may be determined, and a second loss value of the dialog generation model may be determined according to the association relationship. Finally, the dialog generation model may be trained according to the second loss value.

For example, the association relationship may be represented by a semantic similarity between the second recommendation information and the description information. For example, a semantic feature of the second recommendation information and a semantic feature of the description information may be extracted using a semantic feature extraction model, and a similarity between the two semantic features may be determined as the semantic similarity. The semantic feature extraction model may adopt an LSTM model, etc., which is not limited in the present disclosure. Alternatively, the association relationship may be represented by a topic similarity between the second recommendation information and the description information. A topic of the second recommendation information and a topic of the description information may be extracted using a topic extraction model, and a similarity between the two topics may be determined as the topic similarity. The topic extraction model may adopt a Latent Dirichlet Allocation (LDA) model, etc., which is not limited in the present disclosure. Accordingly, in such embodiments, the second loss value may be determined using a predetermined loss function negatively correlated to the semantic similarity or the topic similarity.

In an embodiment, the dialogue generation model may adopt a pre-trained dialogue generation model with a discrete latent variable. As shown inFIG.4, in an embodiment400, an auxiliary task may be added to the dialog generation model, so that the dialog generation model may perform multi-task learning. Specifically, an identification bit410may be added to an input of the dialog generation model, that is, a token may be added. The identification bit410may use any random identification information. It may be understood that a function of the identification bit is similar to that of a latent variable bit input into the above-mentioned PLATO-2 model, which will not be described in detail in the present disclosure. In such embodiments, when training the dialog generation model401, a random identification information used by the identification bit410and the description word sequence420may be input into the dialog generation model401, and the dialog generation model outputs an association prediction value430corresponding to the random identification information and the probability vector sequence440. The association prediction value430may be used to indicate the association relationship between the second recommendation information and the description information.

In such embodiments, the dialog generation model may be trained with a goal of maximizing the association prediction value. That is, the second loss is negatively correlated with the association prediction value. For example, the second loss value450may be determined firstly using a predetermined loss function according to the association prediction value430, and then the dialogue generation model401may be trained with a goal of minimizing the second loss value450. Moreover, in such embodiments, a negative log-likelihood loss value460may be determined according to the probability vector sequence440by using Equation (1). A total loss value470may be determined using a weighted sum of the second loss value450and the negative log-likelihood loss value460, and the dialog to generate the model401may be trained according to the total loss value.

For example, the predetermined loss function for determining the second loss value450may adopt a cross entropy loss function, which is not limited in the present disclosure.

In an embodiment, while considering the second loss value450, the above-mentioned first loss value may also be considered. Accordingly, the input to the dialog generation model includes not only the random identification information and the description word sequence, but also the prompt word sequence. In such embodiments, the total loss value may be determined by a weighted sum of the negative log-likelihood loss value460, the second loss value450and the above-mentioned first loss value. It may be understood that a weight coefficient used in calculating the weighted sum may be set according to actual needs, which is not limited in the present disclosure.

According to such embodiments, a pre-trained dialogue generation model with a discrete latent variable is used as the dialogue generation model, and a random identification information is added to the input of the dialogue generation model, so that the dialogue generation model may perform multi-task learning. The output association prediction value corresponding to the identification bit may provide guidance to a certain extent. Specifically, when a recommendation information is generated using the information generation model obtained by training, it may provide guidance for whether the recommendation information may be adopted.

FIG.5shows a schematic diagram of a principle of a method of training an information generation model according to other embodiments of the present disclosure.

According to embodiments of the present disclosure, the dialogue generation model may also be trained with a goal that the generated recommendation information does not contain repeated words, so that the recommendation information generated by the information generation model obtained by training is more concise and smooth, which is conducive to the promotion of the target object to be recommended by the recommendation information.

In an embodiment, the second recommendation information for the target object may be determined according to the probability vector sequence using a similar method as described above. Then, it may be determined whether the plurality of obtained prediction words in the second recommendation information include repeated words. If there are repeated words, the probability vectors corresponding to the repeated words in the probability vector sequence may be determined according to a position information of the repeated words in the second recommendation information, and the probability vectors may be determined as target probability vectors. Specifically, for example, the plurality of prediction words include A, B, C, A, D in sequence, and the plurality of prediction words respectively correspond to maximum probability values included in five probability vectors in the probability vector sequence. Since a first word in the plurality of prediction words is repeated with a fourth word, a first probability vector and a fourth probability vector in the five probability vectors may be determined as the target probability vectors. Subsequently, a third loss value of the dialog generation model may be determined according to the target probability vectors. For example, the third loss value may be determined according to the maximum probability value included in any of the target probability vectors. It may be understood that the maximum probability value included in any of the probability vectors is the probability for the repeated words included in the probability vector. That is, the third loss value may also be determined according to the target probability vectors and the repeated words.

In an embodiment, the target probability vector in the probability vector sequence may also be determined according to repeated words included in the first recommendation information in the information pair. This is because a training purpose of the dialogue generation model is to make the second recommendation information consistent with the first recommendation information. The training efficiency may be improved by determining the target probability vector according to the repeated words included in the first recommendation information.

Specifically, as shown inFIG.5, in an embodiment500, when training the dialogue generation model501, while a description word sequence W_d510is input into a dialogue generation model501to obtain a probability vector sequence V_p520, the first recommendation information may be split into at least one recommendation word to obtain a recommendation word sequence W_t530. The descriptor sequence W_d510may include description word W_d1to description word W_dM, a total of M description words. The recommendation word sequence W_t530may include recommendation word W_d1to recommendation word W_dT, a total of T recommendation words. The probability vector sequence V_p520includes probability vector V_p1to probability vector V_pT, a total of T probability vectors.

When the recommendation word sequence W_t530is obtained, it may be determined whether the recommendation word sequence contains repeated words. If there are no repeated words, the third loss value is determined as 0. If there are repeated words, the probability vector corresponding to the repeated words in the probability vector sequence may be determined according to the position information of the repeated words in an actual word sequence. For example, if the recommendation word W_d1and the recommendation word W_d3in the actual word sequence are repeated words, the probability vectors corresponding to the repeated words in the probability vector sequence V_p520include the probability vector V_p1and the probability vector V_p3, that is, the target probability vectors include the probability vector V_p1and the probability vector V_p3. When the target probability vectors are determined, the third loss value of the dialog generation model may be determined according to the target probability vectors and the repeated words. For example, the third loss value may be determined according to the probability value for the repeated words included in any of the target probability vectors. For example, the probability vector corresponding to a later word in the repeated words may be determined as the target probability vector, and the third loss value may be determined according to the probability value for the repeated words included in the target probability vector.

According to embodiments of the present disclosure, the third loss value may be positively correlated with the probability value for the repeated words included in the target probability vector. By training the dialog generation model according to the third loss value, the probability value for the repeated words in the target probability vector may be minimized, and the probability of appearing repeated words may be reduced. It may be understood that when the second recommendation information contains more than one type of repeated words, a group of target probability vectors may be determined for each type of repeated words. One loss value may be determined according to each group of target probability vectors, and a sum of a plurality of determined loss values may be determined as the third loss value.

In an embodiment, a third loss value Lrepmay be expressed by Equation (3).

where, C represents a set of repeated words, c represents any repeated word in the set of repeated words, x represents an input information of the dialogue generation model, y<trepresents an information output by the dialog generation model before outputting a tthprobability vector (i.e., the target probability vector), and p(c|x, y<t) represents a probability value for the repeated word c included in the target probability vector.

It may be understood that in such embodiments, the dialog generation model may also be trained by using a weighted sum of the third loss value and the above-mentioned negative log-likelihood loss value obtained by Equation (1) as the total loss value.

It may be understood in such embodiments, the total loss value may be determined according to any combination of the above-mentioned negative log-likelihood loss value and the first loss value to the third loss value, and the dialog generation model may be trained according to the total loss value.

Based on the information generation model obtained by the method of training the information generation model provided by the present disclosure, the present disclosure further provides a method of generating an information, which will be described in detail below with reference toFIG.6.

FIG.6shows a flowchart of a method of generating an information according to embodiments of the present disclosure.

As shown inFIG.6, a method600of generating an information in such embodiments may include operation S610to operation S630.

In operation S610, a description information for an object to be recommended is split into at least one description word to obtain a description word sequence.

According to embodiments of the present disclosure, the object to be recommended is similar to the above-mentioned target object, and an implementation of operation S610is similar to an implementation of operation S210described above, which will not be repeated here.

In operation S620, the description word sequence is input into an information generation model to obtain a probability vector sequence for the object to be recommended.

Each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words. The information generation model is trained using the method of training the information generation model provided in the present disclosure. An implementation of operation S620is similar to an implementation of operation S220described above, which will not be repeated here.

In operation S630, a recommendation information for the object to be recommended is determined according to the probability vector sequence.

According to embodiments of the present disclosure, the operation S630may be performed by using a method similar to the method of determining the second recommendation information according to the probability vector sequence described above, which will not be repeated here.

According to embodiments of the present disclosure, the method600of generating the information may further include an operation of splitting a prompt information for the object to be recommended into at least one prompt word to obtain a prompt word sequence. Accordingly, the above-mentioned operation S620may specifically include inputting the description word sequence and the prompt word sequence into the dialog generation model to obtain the probability vector sequence. An implementation principle of such embodiments is similar to a principle of obtaining the probability vector sequence in the embodiment300described above, which will not be repeated here.

According to embodiments of the present disclosure, the dialogue generation model may include a pre-trained dialogue generation model with a discrete latent variable. The above-mentioned operation S620may specifically include inputting a random identification information and the description word sequence into the dialog generation model to obtain an association value corresponding to the random identification information and the probability vector sequence. The association value indicates an association relationship between the recommendation information and the description information. An implementation principle of such embodiments is similar to a principle of obtaining the association prediction value and the probability vector sequence in the embodiment400described above, which will not be repeated here.

It should be noted that since a model obtained by training a dialogue generation model is used in the method of generating the information provided in the present disclosure, an information with questions input into the model may be properly answered while semantically understanding the information input into the model, so that the obtained recommendation information may provide common sense knowledge, which is conducive to improving the promotion effectiveness of the object to be recommended by the recommendation information. For example, if the information input into the model includes “What's the use of skin care ingredient XXX”, the obtained recommendation information may include “skin care ingredient XXX may fill wrinkles and depressions of the face, and make the skin more moisturizing”, and so on.

Based on the method of training the information generation model provided by the present disclosure, the present disclosure further provides an apparatus of training an information generation model, which will be described below with reference toFIG.7.

FIG.7shows a structural block diagram of an apparatus of training an information generation model according to embodiments of the present disclosure.

As shown inFIG.7, an apparatus700of training an information generation model in such embodiments may include a first splitting module710, a sequence obtaining module720, and a training module730.

The first splitting module710may be used to split a description information for a target object in an information pair into at least one description word, so as to obtain a description word sequence. The information pair further includes a first recommendation information. In an embodiment, the first splitting module710may be used to perform the operation S210described above, which will not be described in detail here.

The sequence obtaining module720may be used to input the description word sequence into a dialog generation model to obtain a probability vector sequence for the target object. Each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words. In an embodiment, the sequence obtaining module720may be used to perform the operation S220described above, which will not be described in detail here.

The training module730may be used to train the dialog generation model according to the probability vector sequence and the first recommendation information, so as to obtain the information generation model. In an embodiment, the training module730may be used to perform the operation S230described above, which will not be described in detail here.

According to embodiments of the present disclosure, the apparatus700may further include a second splitting module used to split a prompt information for the target object into at least one prompt word, so as to obtain a prompt word sequence. The sequence obtaining module720may be specifically used to input the description word sequence and the prompt word sequence into the dialog generation model to obtain the probability vector sequence.

According to embodiments of the present disclosure, the probability vector sequence may indicate a second recommendation information for the target object. The apparatus700may further include a probability determination module and a first loss determination module. The probability determination module is used to determine, according to the probability vector sequence, a prediction probability that the second recommendation information includes the prompt information. The first loss determination module is used to determine a first loss value of the dialog generation model according to the prediction probability. The training module730may be further used to train the dialog generation model according to the first loss value.

According to embodiments of the present disclosure, the probability determination module may include a first determination sub-module and a second determination sub-module. The first determination sub-module is used to determine, according to a probability value in the probability vector sequence for each prompt word in the prompt word sequence, a probability that the second recommendation information contains each prompt word. The second determination sub-module is used to determine, according to at least one probability that the second recommendation information contains at least one prompt word, the prediction probability that the second recommendation information includes the prompt information.

According to embodiments of the present disclosure, the probability vector sequence indicates a second recommendation information for the target object. The apparatus700may further include a second loss determination module used to determine a second loss value of the dialog generation model according to an association relationship between the second recommendation information and the description information. The training module730may be further used to train the dialog generation model according to the second loss value.

According to embodiments of the present disclosure, the dialog generation model may include a pre-trained dialog generation model with a discrete latent variable. The sequence obtaining module720may be specifically used to input a random identification information and the description word sequence into the dialog generation model to obtain the probability vector sequence and an association prediction value corresponding to the random identification information. The association prediction value indicates the association relationship between the second recommendation information and the description information.

According to embodiments of the present disclosure, the apparatus700may further include an information determination module, a first vector determination module, and a third loss determination module. The information determination module is used to determine a second recommendation information for the target object according to the probability vector sequence. The first vector determination module is used to determine, in response to repeated words being contained in the second recommendation information, a probability vector for the repeated words in the probability vector sequence as a target probability vector according to a position information of the repeated words in the second recommendation information. The third loss determination module is used to determine a third loss value of the dialog generation model according to the target probability vector and the repeated words. The training module730may be further used to train the dialog generation model according to the third loss value.

According to embodiments of the present disclosure, the apparatus700may further include a third splitting module, a second vector determination module, and a fourth loss determination module. The third splitting module is used to split the first recommendation information into at least one recommendation word, so as to obtain a recommendation word sequence. The second vector determination module is used to determine, in response to repeated words being contained in the recommendation word sequence, a probability vector for the repeated words in the probability vector sequence as a target probability vector according to a position information of the repeated words in the recommendation word sequence. The fourth loss determination module is used to determine a third loss value of the dialog generation model according to the target probability vector and the repeated words. The training module730may be further used to train the dialog generation model according to the third loss value.

According to embodiments of the present disclosure, the dialogue generation model may include a pre-trained dialogue generation model with a discrete latent variable

FIG.8shows a structural block diagram of an apparatus of generating an information according to embodiments of the present disclosure.

As shown inFIG.8, an apparatus800of generating an information in such embodiments may include a first splitting module810, a sequence obtaining module820, and an information determination module830.

The first splitting module810may be used to split a description information for an object to be recommended into at least one description word, so as to obtain a description word sequence. In an embodiment, the first splitting module810may be used to perform the operation S610described above, which will not be described in detail here.

The sequence obtaining module820may be used to input the description word sequence into an information generation model to obtain a probability vector sequence for the object to be recommended. Each probability vector in the probability vector sequence includes probability values for a plurality of predetermined words. The information generation model may be trained using the method of training the information generation model provided by the present disclosure. In an embodiment, the sequence obtaining module820may be used to perform the operation S620described above, which will not be described in detail here.

The information determination module830may be used to determine a recommendation information for the object to be recommended, according to the probability vector sequence. In an embodiment, the information determination module830may be used to perform the operation S630described above, which will not be described in detail here.

According to embodiments of the present disclosure, the apparatus800may further include a second splitting module used to split a prompt information for the object to be recommended into at least one prompt word, so as to obtain a prompt word sequence. The sequence obtaining module820is specifically used to input the description word sequence and the prompt word sequence into the dialog generation model to obtain the probability vector sequence.

According to embodiments of the present disclosure, the dialogue generation model may include a pre-trained dialogue generation model with a discrete latent variable. The sequence obtaining module820may be specifically used to input a random identification information and the description word sequence into the dialog generation model to obtain the probability vector sequence and an association value corresponding to the random identification information. The association value indicates an association relationship between the recommendation information and the description information.

It should be noted that in the technical solution of the present disclosure, a collection, a storage, a use, a processing, a transmission, a provision and a disclosure of user personal information involved comply with provisions of relevant laws and regulations, and do not violate public order and good custom. In the technical solution of the present disclosure, the acquisition or collection of user personal information has been authorized or allowed by users.

According to embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.

FIG.9shows a schematic block diagram of an exemplary electronic device900for implementing the method of training the information generation model and/or the method of generating the information provided by embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as a laptop computer, a desktop computer, a workstation, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may further represent various forms of mobile devices, such as a personal digital assistant, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components as illustrated herein, and connections, relationships, and functions thereof are merely examples, and are not intended to limit the implementation of the present disclosure described and/or required herein.

As shown inFIG.9, the electronic device900includes a computing unit901which may perform various appropriate actions and processes according to a computer program stored in a read only memory (ROM)902or a computer program loaded from a storage unit908into a random access memory (RAM)903. In the RAM903, various programs and data necessary for an operation of the electronic device900may also be stored. The computing unit901, the ROM902and the RAM903are connected to each other through a bus904. An input/output (I/O) interface905is also connected to the bus904.

A plurality of components in the electronic device900are connected to the I/O interface905, including: an input unit906, such as a keyboard, or a mouse; an output unit907, such as displays or speakers of various types; a storage unit908, such as a disk, or an optical disc; and a communication unit909, such as a network card, a modem, or a wireless communication transceiver. The communication unit909allows the electronic device900to exchange information/data with other devices through a computer network such as Internet and/or various telecommunication networks.

The computing unit901may be various general-purpose and/or dedicated processing assemblies having processing and computing capabilities. Some examples of the computing unit901include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit901executes various methods and processes described above, such as the method of training the information generation model and/or the method of generating the information. For example, in some embodiments, the method of training the information generation model and/or the method of generating the information may be implemented as a computer software program which is tangibly embodied in a machine-readable medium, such as the storage unit908. In some embodiments, the computer program may be partially or entirely loaded and/or installed in the electronic device900via the ROM902and/or the communication unit909. The computer program, when loaded in the RAM903and executed by the computing unit901, may execute one or more steps in the method of training the information generation model and/or the method of generating the information. Alternatively, in other embodiments, the computing unit901may be used to perform the method of training the information generation model and/or the method of generating the information by any other suitable means (e.g., by means of firmware).

Various embodiments of the systems and technologies described herein may be implemented in a digital electronic circuit system, an integrated circuit system, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), an application specific standard product (ASSP), a system on chip (SOC), a complex programmable logic device (CPLD), a computer hardware, firmware, software, and/or combinations thereof. These various embodiments may be implemented by one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor. The programmable processor may be a dedicated or general-purpose programmable processor, which may receive data and instructions from a storage system, at least one input device and at least one output device, and may transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

Program codes for implementing the methods of the present disclosure may be written in one programming language or any combination of more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a dedicated computer or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowcharts and/or block diagrams to be implemented. The program codes may be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine as a stand-alone software package or entirely on a remote machine or server.

In order to provide interaction with the user, the systems and technologies described here may be implemented on a computer including a display device (for example, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user, and a keyboard and a pointing device (for example, a mouse or a trackball) through which the user may provide the input to the computer. Other types of devices may also be used to provide interaction with the user. For example, a feedback provided to the user may be any form of sensory feedback (for example, visual feedback, auditory feedback, or tactile feedback), and the input from the user may be received in any form (including acoustic input, voice input or tactile input).

The systems and technologies described herein may be implemented in a computing system including back-end components (for example, a data server), or a computing system including middleware components (for example, an application server), or a computing system including front-end components (for example, a user computer having a graphical user interface or web browser through which the user may interact with the implementation of the system and technology described herein), or a computing system including any combination of such back-end components, middleware components or front-end components. The components of the system may be connected to each other by digital data communication (for example, a communication network) in any form or through any medium. Examples of the communication network include a local area network (LAN), a wide area network (WAN), and the Internet.

The computer system may include a client and a server. The client and the server are generally far away from each other and usually interact through a communication network. The relationship between the client and the server is generated through computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in a cloud computing service system to solve shortcomings of difficult management and weak business scalability existing in an existing physical host and VPS (Virtual Private Server) service. The server may also be a server of a distributed system or a server combined with a block-chain.

It should be understood that steps of the processes illustrated above may be reordered, added or deleted in various manners. For example, the steps described in the present disclosure may be performed in parallel, in sequence, or in a different order, as long as a desired result for the technical solution of the present disclosure may be achieved. This is not limited in the present disclosure.

The above-mentioned specific embodiments do not constitute a limitation on the scope of protection of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions may be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be contained in the scope of protection of the present disclosure.