Advertisement copy generation method and device, equipment, medium and product
By adopting a joint model architecture for unsupervised training of generators and discriminators, the problem of poor efficiency and effectiveness in advertising copy generation in existing technologies is solved, achieving efficient generation of high-quality advertising copy while reducing training costs and dependence on sample size.
Patent Information
- Application Number
- CN202210621648.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-06-01
AI Technical Summary
Existing neural network models are inefficient and ineffective in generating advertising copy, resulting in poor performance of the generated copy, especially when created by non-native speakers.
A joint model architecture of a generator and a constraint generator is adopted to train the generator through sample titles. The generator generates advertising copy through unsupervised training and uses a discriminator for subsequent training and fine-tuning. The generator does not need to rely on the annotation information of the sample titles during training, and the discriminator freezes the weights for discrimination after training.
The generator can efficiently generate high-quality advertising copy, reducing training costs and dependence on sample size, and improving data utilization. The generator does not require manual annotation during training, which improves generation efficiency and effectiveness.
Smart Images

Figure CN114997920B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of e-commerce information, in particular to an advertisement script generation method and a corresponding device, computer equipment, computer readable storage medium, and computer program product. BACKGROUND
[0002] An e-commerce platform is usually configured with an advertisement launching page for a store user to launch an advertisement corresponding to a listed product in the store to an advertisement system, so as to achieve the purpose of online traffic and promote the transaction volume of the product.
[0003] The advertisement script corresponding to the advertisement needs a certain degree of professionalism, especially when the store user needs to create an advertisement script in a non-native language, which is usually more laborious. In order to simplify the creation of the advertisement script, an auxiliary creation means is often used to provide corresponding services for users to call.
[0004] One of the traditional auxiliary creation means is to use a neural network model to construct an advertisement script. The user provides an input parameter constrained by the neural network model, and the neural network model generates a corresponding advertisement script according to the obtained input parameter according to its learned ability. In practice, the preparation efficiency and preparation effect of the known neural network model have not achieved good performance, resulting in poor performance of the generated advertisement script.
[0005] Therefore, how to improve the auxiliary creation effect of the advertisement script needs to be further explored. SUMMARY
[0006] The present application aims to solve the above problems and provide an advertisement script generation method and a corresponding device, computer equipment, computer readable storage medium, computer program product,
[0007] To achieve the purposes of the present application, the following technical solutions are adopted:
[0008] In one aspect, an advertisement script generation method is provided to achieve one of the purposes of the present application. The method inputs a product title into a generator to generate a corresponding advertisement script. The training process of the generator includes:
[0009] The first model architecture is iteratively trained to convergence using a sample title. The first model architecture includes the generator and a constrainter. The generator is used to predict an advertisement script corresponding to the sample title, and the constrainter is used to predict a result title corresponding to the advertisement script.
[0010] The discriminator is iteratively trained to convergence using a sample script. The sample script includes a negative sample generated by the generator and a positive sample pre-collected. The discriminator is used to predict whether the sample script is a positive sample or a negative sample.
[0011] The second model architecture is iteratively trained to a convergent state using sample titles, the second model architecture including the generator and the discriminator, wherein the weights of the discriminator are frozen.
[0012] In another aspect, an advertisement script generation device is provided for inputting a product title to a generator to generate a corresponding advertisement script, and a matching providing training device is provided, the training device including: a first training module for iteratively training a first model architecture to a convergent state using sample titles, the first model architecture including the generator and a constrainter, the generator being configured to predict an advertisement script corresponding to the sample title, and the constrainter being configured to predict a result title corresponding to the advertisement script; a second training module for iteratively training a discriminator to a convergent state using sample scripts, the sample scripts including negative samples generated by the generator and positive samples pre-collected, the discriminator being configured to predict whether a sample script is a positive sample or a negative sample; and a third training module for iteratively training a second model architecture to a convergent state using sample titles, the second model architecture including the generator and the discriminator, wherein the weights of the discriminator are frozen.
[0013] In yet another aspect, a computer device is provided for adapting to one of the purposes of the present application, and includes a central processing unit and a memory, the central processing unit being configured to invoke a computer program stored in the memory to execute the steps of the advertisement script generation method described in the present application.
[0014] In yet another aspect, a computer readable storage medium is provided for storing a computer program implemented according to the advertisement script generation method described in the present application in the form of computer readable instructions, the computer program being invoked by a computer to execute the steps included in the method when the computer program is run.
[0015] In yet another aspect, a computer program product is provided for including a computer program / instruction, the computer program / instruction being executed by a processor to implement the steps of the advertisement script generation method described in any one of the embodiments of the present application.
[0016] Compared with the prior art, the present application has many advantages, at least including the following aspects:
[0017] The generator of the present application can generate high-quality advertising copy according to the commodity title, which is derived from the efficient training of the generator. In the training process of the generator, the first stage is the generator post-constraint, the generator generates advertising copy according to the sample title, and the constraint reversely restores the advertising copy to the result title, so that the gradient update of the generator and the constraint can be implemented according to the result title and the sample title without relying on the labeled information of the sample title; the second stage is to train the discriminator to identify the ability of the advertising copy whether it meets the requirements, wherein the advertising copy generated by the generator is used as a sample text for classification decision, also without relying on artificial labeling; the third stage adopts the generator and the discriminator trained in the previous two stages for joint training, the generator is responsible for generating advertising copy according to the sample title, the discriminator is frozen weight and does not participate in the update, only responsible for discriminating whether the advertising copy generated by the generator meets the requirements, and the same reason is that as long as the sample title is a valid source of positive sample, it can also not rely on additional artificial labeling. Through the above process, the training of the generator can be completed, the generator first learns the ability to generate advertising copy in the first stage, and adjusts the weight in the third stage through the training of the discriminator to correct its generation ability, so that the generator can output high-quality advertising copy according to the given commodity title. In the whole training process, the sample title can be reused in different training stages, and the sample text can also use the product in the training process of the generator, which greatly reduces the dependence on sample size, improves the data utilization rate, and undoubtedly reduces the training cost of the generator. BRIEF DESCRIPTION OF DRAWINGS
[0018] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
[0019] Figure 1 The flowchart of a typical embodiment of the advertising copy generation method of the present application.
[0020] Figure 2 The structure diagram of the exemplary first model architecture of the present application.
[0021] Figure 3 The structure diagram of the exemplary second model architecture of the present application.
[0022] Figure 4 The flowchart of training the first model architecture in the embodiment of the present application.
[0023] Figure 5 The flowchart of training the discriminator in the embodiment of the present application.
[0024] Figure 6 The flowchart of training the second model architecture in the embodiment of the present application.
[0025] Figure 7 Workflow diagram of an exemplary generator of the present application.
[0026] Figure 8 Principle block diagram of an advertisement copy generation apparatus of the present application;
[0027] Figure 9 Structure diagram of a computer device used in the present application. DETAILED DESCRIPTION
[0028] Embodiments of the present application are described in detail below with reference to the attached drawing figures, wherein the same or like reference numerals and characters in the drawings and the description indicate the same or like elements or features.
[0029] As will be understood by those skilled in the art, the singular forms "a," "an," "said," and "the" include plural referents unless the context clearly dictates otherwise. It should be further understood that the terms "comprise," "comprises," and "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. As used herein, when an element, component, or layer is referred to as being "on," "connected to," or "coupled to" another element, component, or layer, it can be directly on, connected, or coupled to the other element, component, or layer or intervening elements, components, or layers can be present. In addition, the use of "connected" or "coupled" herein also includes wireless connections or wireless couplings. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0030] As will be understood by those skilled in the art, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
[0031] Those skilled in the art will understand that, as used herein, the terms "client," "terminal," and "terminal device" include both devices that are solely wireless signal receivers and devices that have both receiving and transmitting hardware that can communicate bi-directionally over a bi-directional communication link. Such devices can include cellular or other communication devices with single-line or multiple-line displays, or no display, Personal Communications Service (PCS) devices that can combine a voice and data function, Personal Digital Assistants (PDAs) that can include a radio frequency receiver, pagers, Internet / intranet access, Web browsers, organizers, calendars, and / or a Global Positioning System (GPS) receiver, conventional laptop and / or palmtop computers, or other devices that have a radio frequency receiver. The terms "client," "terminal," and "terminal device" as used herein can be portable, transportable, installed in a vehicle (aeronautical, maritime, and / or land), or adapted for and / or configured for local and / or distributed operation on Earth and / or any other location in space. The terms "client," "terminal," and "terminal device" as used herein can also be a communication terminal, an Internet terminal, a music / video playing terminal, such as a PDA, a Mobile Internet Device (MID), and / or a mobile phone with music / video playing function, a smart television, a set-top box, and the like.
[0032] As used herein, the terms "server," "client," "service node," and the like refer to hardware that is essentially an electronic device with the equivalent capability of a personal computer, i.e., a hardware device with the necessary components disclosed by the Von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. A computer program is stored in the memory, the central processing unit loads the program stored in the external memory into the internal memory and runs it, executes the instructions in the program, and interacts with the input and output devices, thereby completing a specific function.
[0033] It should be noted that the concept of "server" in the present application can also be extended to the case of a server cluster. According to the principle of network deployment understood by those skilled in the art, the servers should be logically divided, and in physical space, these servers can be independent of each other but can be called through an interface, or can be integrated into a physical computer or a computer cluster. Those skilled in the art should understand this variation and should not be restricted by the implementation of the network deployment of the present application.
[0034] One or more technical features of the present application, unless explicitly specified, can be deployed on a server for implementation and accessed by a client remotely calling an online service interface provided by the server, or can be directly deployed and run on a client for implementation.
[0035] The neural network model referred to or possibly referred to in the present application, unless explicitly specified, can be deployed on a remote server and remotely called by a client, or can be deployed on a client with sufficient device capability for direct calling. In some embodiments, when it is run on a client, its corresponding intelligence can be obtained through transfer learning, so as to reduce the requirement for client hardware running resources and avoid excessive occupation of client hardware running resources.
[0036] The various data involved in the present application, unless explicitly specified, can be remotely stored on a server or stored on a local terminal device, as long as it is suitable for being called by the technical solutions of the present application.
[0037] Those skilled in the art should know that the various methods of the present application, although based on the same concept and described to present commonality between them, are independently executable unless otherwise specified. Similarly, for each embodiment disclosed in the present application, it is based on the same inventive concept, so the same concept is understood to be equivalent, and although the concept is expressed differently, it is only a suitable transformation for convenience.
[0038] Unless it is explicitly stated that the various embodiments disclosed in the present application are mutually exclusive, the related technical features involved in each embodiment can be cross-combined to flexibly construct new embodiments, as long as such combination does not deviate from the spirit of the present application and can meet the needs of the prior art or solve some aspects of the deficiencies in the prior art. For this variation, those skilled in the art should know.
[0039] The advertisement script generation method of the present application can be programmed as a computer program product, deployed in a client or a server for running and implementation, for example, in the exemplary application scenario of the present application, it can be deployed and implemented in the server of an e-commerce platform, thereby the interface opened after the running of the computer program product can be accessed, and the process of the computer program product can be interacted with through the graphical user interface to execute the method.
[0040] Please refer to Figure 1 In a typical embodiment of the advertisement script generation method of the present application, the title of the product is input into the generator, and the corresponding advertisement script is generated by the generator. In order to enable the generator to have the corresponding advertisement script generation capability, the generator can be trained. In this embodiment, the training process of the generator includes the following steps:
[0041] Step S1100, the first model architecture is iteratively trained to convergence by using the sample title, the first model architecture includes the generator and the constraint, the generator is used to predict the advertisement script corresponding to the sample title, and the constraint is used to predict the result title corresponding to the advertisement script;
[0042] The purpose of this step is to implement the first stage of training for the generator. In order to implement the first stage of training, the first model architecture is built. As shown in Figure 2 The first model architecture includes the generator and the constraint, and the generator and the constraint can have the same network structure, for example, a deep learning model realized by using a CNN (convolutional neural network), an RNN (recurrent neural network) or other basic neural network model to realize the generator and the constraint.
[0043] In one embodiment, the network structure of the generator and the constraint is realized by using a mature model based on RNN such as LSTM (long short-term recurrent neural network) and BiLSTM (bidirectional long short-term recurrent neural network). In this network structure, a first LSTM basic model is used as an encoder, and a second LSTM basic model is used as a decoder. The encoder is used to encode the input first text information to realize feature extraction, and the decoder is used to predict the second text information corresponding to the first text information according to the extracted features. It can be seen that there is a corresponding conversion relationship between the input of the encoder and the output of the decoder.
[0044] In another embodiment, the encoder and the decoder in the network structure can be replaced by other mature models suitable for extracting text features and decoding and outputting according to the extracted features, for example, a model of the Transformer series.
[0045] In still another embodiment, the generator and the constrainter can have different network architectures, for example, the generator can be implemented by using a base model of the Transformer series, and the decoder can be implemented by using a BiLSTM, and the like, and those skilled in the art can flexibly replace the embodiments.
[0046] During the training of the first model architecture, the sample title as a training sample is input to the generator, and the corresponding advertisement script is predicted by the generator after the sample title is encoded and decoded. Then, the advertisement script is input to the constrainter, and the corresponding result title is predicted by the constrainter after the advertisement script is encoded and decoded. It can be seen that the generator and the constrainter are used to realize the functions of each other, and the advertisement script generated by the generator is restored to the result title by the constrainter. As long as the consistency of the result title and the sample title is compared, the reconstruction error between the sample title and the result title is minimized, and the generator and the constrainter are trained accordingly, the key semantic features of the sample title can be ensured to be contained in the advertisement script generated by the generator, and the ability of the generator to generate the corresponding script according to the input title is learned.
[0047] During the implementation of the first stage training of the first model architecture, when the entire model architecture does not converge, different sample titles can be continuously called to implement iterative training of the first model architecture until the generator and the constrainter reach the convergence state according to the loss value between the sample title and the result title, i.e., the reconstruction error, and the first stage training can be terminated.
[0048] Since the input of the generator is the sample title, the sample title can be used to calculate the loss value of the result title generated by the constrainter, and therefore, during the implementation of the iterative training of the first model architecture, unsupervised training can be realized, and additional manual labeling of the sample title is not required, thereby effectively reducing the training cost of the first stage training.
[0049] Step S1200, iteratively training the discriminator to convergence by using sample scripts, the sample scripts including negative samples generated by the generator and positive samples pre-collected, the discriminator being used to predict whether the sample script is a positive sample or a negative sample;
[0050] The purpose of this step is to prepare a discriminator suitable for judging the effectiveness of the advertisement script generated by the generator, and therefore, the second stage training is implemented.
[0051] The discriminator can be implemented by connecting a neural network model suitable for text feature extraction to a classifier. In an exemplary network architecture, the text feature extraction model can be implemented using a mature model such as TextCNN or Bert, and the classifier can be a binary classifier. The discriminator extracts deep semantic information from the text information input thereto through the text feature extraction model, and then classifies and maps the deep semantic information to a binary classification space to predict whether the input text information is a positive sample or a negative sample.
[0052] According to the above principle, two types of scripts can be prepared. The first type of script is an advertisement script generated by the generator after the first stage of training, with each of the sample titles as input. This advertisement script is generated by the generator and automatically labeled by the program, with the sample type marked as a negative sample without human intervention. The second type of script can be an advertisement script extracted from the historical advertisements of the advertisement system. After being collected by the program, it is automatically labeled, with the sample type marked as a positive sample, also without human intervention. Thus, two types of sample scripts, positive sample advertisement scripts and negative sample advertisement scripts, are obtained.
[0053] In an embodiment, the sample script as a negative sample can also be an advertisement script extracted by the generator during the first stage of training, or an advertisement script generated by the generator based on other given text information.
[0054] During the second stage of training, the discriminator is iteratively trained using the sample scripts. For each sample script, the embedding vector of the sample script is input into the text feature extraction model of the discriminator to extract its deep semantic information. Then, the deep semantic information is mapped to the classification space of the classifier in the discriminator through a fully connected layer, and the classification probabilities corresponding to the two classes in the classification space are calculated. The class with the highest classification probability is the result predicted by the discriminator, thereby determining whether the sample script used for training is a positive sample or a negative sample.
[0055] After the discriminator predicts the corresponding result for each sample script, the sample type automatically labeled in advance by the sample script is used as a supervision label to calculate the loss value of the predicted result. Then, the discriminator is updated based on the gradient of the loss value. The next sample script is called to iteratively train the discriminator until the discriminator has converged according to the loss value.
[0056] In an embodiment, the discriminator can access the generator trained in the first stage, input the sample title into the generator, and automatically generate a sample script as a negative sample by the generator, and then provide the label corresponding to the negative sample to the discriminator for instant training, so as to avoid intermediate storage and processing of the negative sample, directly generate the negative sample by the generator and provide it to the discriminator instantly, and further improve the training efficiency. As a variation, when the generator is used to generate a negative sample for the discriminator, the weight of the generator can be temporarily frozen to make the obtained negative sample uniform in quality.
[0057] After the discriminator is trained by the two types of sample scripts to convergence, it learns the ability to determine whether a given script meets the specifications, which mainly refer to the expression style, expression habit, grammar structure, content composition, readability, and the like of the advertising script. The discriminator has the ability to extract features corresponding to these specifications through the weight obtained by training, and can make a decision based on these features. As can be seen, the discriminator obtained by the second stage training can be used as a standardized adjudication agency in the future.
[0058] In step S1300, the second model architecture is iteratively trained to a converged state using the sample title, and the second model architecture includes the generator and the discriminator, wherein the weight of the discriminator is frozen.
[0059] The purpose of this step is to use the discriminator obtained by the second stage training as an adjudication agency for the advertising script generated by the generator obtained by the first stage training, to supervise the fine-tuning training process of the generator, to retrain the generator to a converged state, and to complete the final preparation of the generator. Therefore, the third stage training is performed.
[0060] To implement the third stage training, a second model architecture as shown in Figure 3 is built, which is composed of the generator trained in the first stage and the discriminator trained in the second stage. The generator takes the sample title as input, and the advertising script generated by the generator is output as the input of the discriminator, and the discriminator outputs the prediction result of the sample type to which the advertising script belongs. Since the discriminator acts as an adjudication agency in the third stage training, the weight of the discriminator is frozen in advance so that it does not participate in the gradient update in the training process, that is, only the weight of the generator in the second model architecture is updated in the third stage training to realize the fine-tuning training of the generator.
[0061] In the execution of the third stage training corresponding to the second model architecture, in an embodiment, the sample titles used in the first stage training can still be used, which are relatively standard data that can be extracted from the product information of the product database of the e-commerce platform in advance, and thus can be automatically labeled as positive samples in batches in advance to indicate that these sample titles are used as positive samples in the third stage training. Of course, in an embodiment, some text information that does not conform to the product title specification can also be collected to construct negative samples, so as to provide more training samples for the third stage training. By training the second model architecture with both positive and negative samples, the convergence speed of the second model architecture can be further improved.
[0062] In the implementation of the third stage training, after each sample title is called and input into the generator, the generator extracts the feature vector of the sample title according to its learned ability, and then generates the corresponding advertising copy according to the feature vector. The advertising copy is input into the discriminator, which extracts the deep semantic information of the advertising copy and classifies and maps it according to the deep semantic information by means of the classifier, predicts the corresponding result label, and then calculates the loss value of the result label by using the sample type of the trained sample title, which is a positive sample or a negative sample. When the model architecture is not converged according to the loss value, the second model architecture is implemented according to the loss value to realize the gradient update of the weight.
[0063] As can be easily understood, since the weight of the discriminator is in a frozen state, the weight of the discriminator is not modified during the gradient update, only the weight of the generator is modified. Therefore, the training of the second model architecture in the third stage is essentially fine-tuning training of the generator. When the model is not converged, the third stage training will continuously call the next sample title for iterative training. With the increase of the number of iterative training, the loss value obtained by each training is expected to gradually reach the preset threshold corresponding to the convergence state. When the preset threshold is reached, it can be determined that the generator has converged. After the generator reaches the convergence state, the third stage training is terminated, thereby completing the preparation of the generator, so that it can generate effective advertising copy according to the input product title.
[0064] It can be seen that in the above process of preparing the generator, the corresponding relationship information between the product title of the same product and the advertisement text in the advertisement published by the product is not required throughout, that is, no annotation information of the corresponding relationship between the title and the text is required for any training stage. By using the constraint to restore the advertisement text output by the generator to the title for unsupervised training, and then by automatically determining the positive and negative samples according to the sample title source and the sample text source, the training of the generator and the discriminator can be realized, so that the generator learns the ability to generate effective advertisement text according to the given title. In this process, the sample collection cost is low, but the training efficiency is very high.
[0065] In summary, according to the above embodiments, the generator of the present application can generate high-quality advertisement text according to the product title, which is derived from the efficient training of the generator. In the training process of the generator, the first stage is to post the constraint to the generator, and the generator generates the advertisement text according to the sample title. The constraint reverses the advertisement text to the result title, so that the generator and the constraint can be updated according to the result title and the sample title, without relying on the annotation information of the sample title. The second stage is to train the discriminator alone to identify the ability of the advertisement text to meet the requirements, wherein the advertisement text generated by the generator is used as a sample text for classification decision, also without relying on manual annotation. In the third stage, the generator and the discriminator trained in the previous two stages are jointly trained, the generator is responsible for generating the advertisement text according to the sample title, the discriminator is frozen and does not participate in the update, and only judges whether the advertisement text generated by the generator meets the requirements. Similarly, as long as the sample title is a valid positive sample, it can also not rely on additional manual annotation. Through the above process, the training of the generator can be completed. The generator first learns the ability to generate advertisement text in the first stage, and then adjusts the weight through the training of the discriminator in the third stage to correct its generation ability, so that the generator can generate high-quality advertisement text according to the given product title. In the whole training process, the sample title can be reused in different training stages, and the sample text can be used as the product of the generator training process, which greatly reduces the dependence on sample size, improves data utilization, and undoubtedly reduces the training cost of the generator.
[0066] In the embodiments extended on the basis of any of the above embodiments, please refer to Figure 4 , the step S1100, the first model architecture is iteratively trained to convergence using sample titles, comprising:
[0067] Step S1110, a single sample title in the first data set is called, and the sample title includes a product title used by a product of an online store of an e-commerce platform;
[0068] To facilitate the calling of the sample title to ensure the data calling efficiency, a first data set is prepared, which contains a sufficient number of product titles as sample titles, which can be collected from the product database of the online store of the e-commerce platform, specifically the product title in the product information of each product. For this part of the product title, it belongs to the standard use of the product title. Therefore, in an embodiment, to facilitate the third phase training calling of the present application, the sample title collected from the e-commerce platform can be automatically labeled, and the sample type is marked as a positive sample. The sample type can be used as a supervision label required for subsequent training.
[0069] In another embodiment, it is also suitable for the third phase training required by the present application, and some disordered text that does not conform to the product title specification can also be used as a sample title, and its sample type is labeled as a negative sample at the same time. It should be noted that in the first phase training of the present application, these negative samples are not required.
[0070] When performing each iteration in the first phase training, a single sample title is called from the first data set, specifically the sample title belonging to the positive sample in the present embodiment, which is used to implement one iteration training for the first model architecture.
[0071] Step S1120, input the sample title into the generator in the first model architecture, and encode and decode the sample title by the generator to obtain the decoded advertisement script;
[0072] After the called sample title is subjected to conventional text preprocessing, word segmentation and vectorization, the corresponding embedding vector is obtained, which enters the generator in the first model architecture, and the encoder in the generator extracts the features to obtain the corresponding feature vector. Then, the feature vector is further provided to the decoder in the generator, which decodes according to the feature vector to generate an advertisement script.
[0073] It is not difficult to understand that in the process of feature extraction of the sample title by the generator, the key features related to the product in the sample title can be extracted, such as product words, core words and other keywords in the product title. At the same time, it is also expected to extract style features, expression habit features, structure features, content features and readability features. These features can guide the decoding process of the decoder, so as to generate an advertisement script matching the sample title.
[0074] Step S1130, input the advertisement script into the constraint in the first model architecture, and encode and decode the advertisement script by the constraint to obtain the decoded result title;
[0075] The constraint generator takes the output of the generator as input, i.e., the advertisement text output by the generator as input of the constraint generator, and the encoder in the constraint generator extracts features of the advertisement text to obtain a feature vector, and then the decoder in the constraint generator decodes according to the feature vector to generate a result title, which is corresponding to the product title, and the corresponding relationship can be realized by supervised correction of the result title by the sample title.
[0076] As can be seen, the constraint generator and the generator can be implemented by the same network architecture, but the flow of information processed by the two is opposite, wherein the generator generates a result text according to a given title, and the constraint generator generates the given title according to the result text. Both are a game process, so the closer the result title generated by the constraint generator to the sample title, the more it indicates that the generator and the constraint generator have learned the ability to generate advertisement text.
[0077] Step S1140, calculating the loss value of the result title according to the sample title, and performing gradient update on the generator and the constraint generator according to the loss value, and continuing to call the next sample title to implement iterative training on the first model architecture when the loss value does not reach convergence.
[0078] In view of the principle of cooperative game training between the constraint generator and the generator, for the result title obtained in each iteration training, the sample title used for training can be used as a supervised label, and a cross-entropy loss function is applied to calculate the loss value of the result title relative to the sample title, so as to pursue the minimization of the loss value, and determine whether the loss value reaches a preset threshold, which can be 0 or an expression infinitely close to 0. When the loss value reaches the preset threshold, it indicates that the first model architecture has been trained to a converged state, and the first stage training can be terminated. When the loss value does not reach the preset threshold, it indicates that the first model architecture has not converged, so the generator and the constraint generator are implemented by back propagation according to the loss value, and the weights of each link of the generator and the constraint generator are updated by gradient, so as to force the generator and the constraint generator to further approach convergence, and then the next sample title in the first data set is called to implement iterative training on the first model architecture, until the output of the first model architecture is determined to be model convergence.
[0079] It is understandable that, since the generator and the constrainter form the first model architecture based on the zero-sum game theory to implement the first stage training, so that in the training process, without additional provision of artificial annotation supervision label, but directly using the sample title itself as input to calculate the loss value of the result title as output, the training of the first model architecture can be supervised, the weight correction of the generator and the constrainter is realized, and the copywriting generation ability of the generator as the training target is continuously improved until the convergence state is reached. It can be seen that the training cost of the first stage training is low, and the dependence on data volume is less, and the ability obtained by the generator can also be ensured under the control of the constrainter.
[0080] In the embodiments extended on the basis of any of the above embodiments, referring to Figure 5 , the step S1200 of iteratively training the discriminator to convergence with the sample copywriting includes:
[0081] The step S1210 of calling a single sample copywriting in the second data set, the sample copywriting including the advertisement copywriting generated by the generator as a negative sample and the advertisement copywriting pre-collected from the advertisement publishing system as a positive sample, each sample copywriting being provided with a first type label representing that it is a positive sample or a negative sample;
[0082] In order to facilitate the implementation of the second stage training, the second data set can be prepared. The second data set includes a sufficient amount of sample copywriting, which can include two types of advertisement copywriting, wherein the first type of advertisement copywriting can be collected from the historical advertisement database of the advertisement publishing system, specifically, the advertisement copywriting in the historical advertisement is collected, and this type of advertisement copywriting is stored in the second data set, and its sample type is marked as a positive sample, which is represented as a type label corresponding to a positive sample.
[0083] Since the historical advertisement copywriting published is relatively effective advertisement copywriting, it is determined as a positive sample so as to provide correct criteria for the result of the discriminator when training the discriminator with the corresponding advertisement copywriting.
[0084] In one embodiment, high-quality historical advertisements with better advertising effectiveness data can be screened from a historical advertisement database in advance, and the advertising copy of these high-quality historical advertisements can be extracted as the sample copy of the positive sample in the second data set. The advertising effectiveness data can be any one of the click-through rate (CTR), conversion rate (CVR), return on advertising spend (ROAS), etc. obtained after the historical advertisement is published. In determining high-quality historical advertisements, historical advertisements with advertising effectiveness data reaching a preset threshold are selected as high-quality historical advertisements, and the advertising copy corresponding to these high-quality historical advertisements is obtained as the positive sample in the second data set, and the corresponding first type label is added to represent that it is a positive sample. Using the advertising copy of the historical high-quality advertisement as the positive sample can guide the discriminator to improve the requirements for high-quality advertising copy, so that only when the text information input into the discriminator contains the common features of high-quality advertising copy, the discriminator can judge it as an effective advertising copy, thereby actually improving the quality requirements of the discriminator for advertising copy. Because the positive sample is the advertising copy of the high-quality historical advertisement, which has been successful in practice, therefore, the quality of the advertising copy generated by referring to such advertising copy is self-evident.
[0085] The second type of advertising copy in the second data set is set to provide negative examples to the discriminator. The cleverness is that the discriminator will supervise the advertising copy generated by the generator as a referee in the subsequent third stage training, that is, before the implementation of the third stage training, the generator has only undergone the first stage of pre-training, and its advertising copy generation ability is not mature, so the advertising copy generated by the generator before the third stage training can be used as the negative sample in the second data set, and the corresponding first type label is added to the sample type to indicate that it is a negative sample.
[0086] In one embodiment, the generator that has completed the first stage of training is recommended to regenerate the corresponding advertising copy for each sample title in the first data set, and these advertising copies are used as negative samples in the second data set. In this case, the generator has strong advertising copy generation ability because it is a finished product after the first stage of training converges, so the advertising copy obtained represents the pre-training results of the generator, and after using it to train the discriminator, it helps to improve the quality requirements of the discriminator for advertising copy, so that the discriminator only predicts advertising copy with a higher quality level as a positive sample.
[0087] In another embodiment, the advertisement copy generated by the generator in the first-stage training process for predicting the sample title can be used as a negative sample in the second data set. Obviously, this negative sample is relatively rough, but it is feasible.
[0088] In another embodiment, the negative sample is also allowed to be constructed in other ways to enrich the sample copy in the second data set. In this regard, those skilled in the art can collect or construct the negative sample in the second data set according to the quality requirements of the advertisement copy.
[0089] On the basis of the second data set, when each iteration of the discriminator needs to be trained, a sample copy is called from the second data set, which is input into the discriminator as a training sample, and the first type label corresponding to the sample copy is used as a supervision label of the discriminator.
[0090] In step S1220, the sample copy is input into the discriminator to extract deep semantic information and classify and map according to the deep semantic information to obtain a result label, which represents that the discriminator predicts the sample type of the sample copy as a positive sample or a negative sample.
[0091] After the sample copy is converted into an embedding vector through regular text preprocessing, word segmentation, and vectorization, it is input into the discriminator, and the embedding vector is feature-extracted by the text feature extraction model of the discriminator to extract the deep semantic information corresponding to the sample copy. Then, full connection is performed through the full connection layer to map to the binary classification space of the discriminator to obtain the classification probability of the corresponding class of the positive sample and the negative sample, and the result label corresponding to the classification with the maximum classification probability is obtained. Therefore, the result label is used to represent that the discriminator predicts the sample type of the sample copy as a positive sample or a negative sample.
[0092] In step S1230, the loss value of the result label is calculated according to the first type label, the gradient update of the discriminator is implemented according to the loss value, and when the loss value does not converge, the next sample copy is called to implement the iteration training of the discriminator.
[0093] The first type label pre-labeled by the sample script used for training is further used to calculate the loss value of the first type label after the discriminator predicts the corresponding result label for the sample script. In calculating the loss value, a cross-entropy loss function can be used for calculation. Then, it is judged whether the loss value reaches a preset threshold. If the preset threshold has been reached, it indicates that the discriminator has converged, and the second stage training can be terminated. If the preset threshold has not been reached, it indicates that the discriminator has not converged, and the weight parameters of the discriminator are corrected according to the loss value to realize gradient update, and then the next sample script is called from the second data set to continue to implement iterative training on the discriminator. By iterative training, the discriminator is constantly approximated to converge, and finally reaches a converged state.
[0094] It is not difficult to understand that in the second stage training, since the sample scripts in the second data set are selected for fine selection, and the advertisement scripts generated by the generator are included as negative examples, the discriminator can be trained to a converged state by using these sample scripts to train the discriminator, so that the discriminator can constantly improve its ability to identify high-quality advertisement scripts with the help of sample scripts and their first type labels, and can identify negative samples generated by the generator without third stage training, so that the generator can be supervised according to this ability in subsequent fine-tuning training, and help the generator further improve the generation ability of high-quality advertisement scripts.
[0095] In the embodiment extended on the basis of any of the above embodiments, please refer to Figure 6 The step S1300 of iteratively training the second model architecture to a converged state using the sample title comprises:
[0096] The step S13110 of calling a single sample title in the first data set, wherein the sample title carries a second type label representing whether the sample type belongs to a positive sample or a negative sample;
[0097] After the first stage and the second stage training, the generator has obtained the ability to generate scripts according to the title based on the game mechanism and the pre-training of the sample title, and the discriminator has obtained the ability to judge the quality of the given script by using the sample script generated by the generator. However, in the second stage, the advertisement script generated by the generator prepared in the first stage is regarded as a negative sample by the discriminator, so the generator needs to be further fine-tuned to enable it to generate advertisement scripts that can be identified as positive samples by the discriminator. Therefore, a second model architecture is built to fine-tune the generator in the second model architecture to improve its ability to generate high-quality and low-quality advertisement scripts.
[0098] To implement the third stage training, the first data set of the first stage training can be directly reused to implement training on the second model architecture, so as to maintain a low training data amount, and in other embodiments, a third data set can also be prepared separately, and the third data set contains a plurality of sample titles. The sample titles in the first data set or the third data set can be product titles collected from product information of a product data set of an e-commerce platform. For such sample titles, since they conform to the specifications of product titles of the e-commerce platform, a second type label can be preset in the sample type of the sample titles, and the second type label can be a binary value, which is used to represent whether the corresponding sample title is a positive sample or a negative sample. For the product titles collected from the e-commerce platform, the second type label of the product titles can be quickly set in batches to represent positive samples after being collected and added to the data set.
[0099] In one embodiment, the first data set or the third data set can also include random texts collected by other means as sample titles, and the second type label of the sample type of the random texts is set to represent negative samples. The existence of positive samples helps to positively improve the quality of the advertising copy generated by the generator, and the introduction of negative samples can further improve the training speed of the generator.
[0100] Step S1320, inputting the sample title into the generator in the second model architecture, and obtaining the decoded advertising copy by the generator coding and decoding the sample title;
[0101] The second model architecture includes the generator completed the first stage training and the discriminator completed the second stage training, wherein the generator is responsible for generating advertising copy according to the given title, and the discriminator is used for classifying and mapping the advertising copy generated by the generator to predict the result label of the advertising copy, and the result label represents whether the prediction result belongs to a positive sample or a negative sample.
[0102] When the sample title called from the first data set or the third data set is subjected to text preprocessing, word segmentation, and word embedding to obtain an embedding vector, the embedding vector is input into the generator, and the generator extracts a feature vector representing deep semantic information of the sample title according to the embedding vector, and then decodes the feature vector to obtain a predicted advertising copy.
[0103] Step S1330, inputting the advertising copy into the discriminator in the second model architecture, and obtaining the result label of the advertising copy by the discriminator classifying and mapping the advertising copy, wherein the weight of the discriminator is pre-frozen and solidified;
[0104] The advertisement copy generated by the generator is input into a discriminator in a second model architecture, deep semantic information of the advertisement copy is extracted by the discriminator, and a result label corresponding to the advertisement copy is predicted according to the deep semantic information, and the result label is used to represent whether the advertisement copy generated by the generator is a positive sample or a negative sample.
[0105] In the second model architecture, the weights of the discriminator are frozen after the second stage training converges, so that the discriminator acts as a referee in the second model architecture, and discriminates the advertisement copy generated by the generator according to the discrimination ability learned in the second stage training, thereby obtaining the result label corresponding to the sample title used for training.
[0106] In step S1340, a loss value of the result label is calculated according to the second type label, and the generator is updated according to the loss value, and the next sample title is called to implement iterative training on the second model architecture when the loss value does not converge.
[0107] As described above, the sample titles in the first data set or the third data set can be provided with the second type label, which is used to represent whether the corresponding sample title is actually a positive sample or a negative sample. The second type label is used as a supervision label of the second model architecture, so that after the discriminator predicts a result label corresponding to a sample title, the second type label pre-labeled by the sample title can be used to calculate the loss value of the result label relative to the second type label by using the cross-entropy loss function.
[0108] Then, the loss value is compared with a preset threshold value, and when the loss value reaches the preset threshold value, it indicates that the generator in the second model architecture has reached a convergent state. When the loss value does not reach the preset threshold value, it indicates that the generator in the second model architecture has not reached a convergent state, so that the second model architecture can be implemented according to the loss value. Back propagation is implemented by gradient update to correct the weight parameters of the generator in the second model architecture, so that the generator further approaches convergence, and further another sample title is called from the first data set or the third data set to continue iterative training.
[0109] In the process of back propagation of the second model architecture according to the loss value calculated according to the result label of the discriminator, since the weights of the discriminator have been frozen and do not participate in gradient update, essentially, only fine-tuning training of the generator in the second model architecture is implemented.
[0110] It can be understood that in the third stage training, the generator can be trained to a convergent state again through multiple loop iterations. Since the discriminator has been trained in the second stage and has improved the requirement for the quality of the advertisement copy, the generator will further improve its ability to generate higher quality advertisement copy under the guidance of the discriminator in the third stage training, thereby achieving the purpose of fine-tuning training.
[0111] In addition, the third stage training can reuse the sample titles in the first data set to ensure that the sample amount used in the entire training process of the generator is maintained at a minimum state, which can effectively control the training cost. In the process of training the second model architecture, it is still unnecessary to rely on the corresponding relationship information between the sample titles and the advertisement copy, but only needs to automatically label the second type label according to the sample title source by the program, so that manual labeling is not required, and the preparation cost of the training data is lower.
[0112] In the embodiments extended on the basis of any of the above embodiments, referring to Figure 7 , the generator is input with the product title, and the generator generates a corresponding advertisement copy, including:
[0113] Step S2100, performing word embedding on the product title to obtain an embedding vector thereof;
[0114] In an embodiment, the generator can be implemented by using a Transformer. The Transformer is a deep learning model based on a self-attention mechanism and is suitable for parallel computing. The Transformer includes an encoder and a decoder. When text data such as a product title or a sample title is input into the Transformer, the text data is first input into the encoder, which encodes the text. First, word embedding is performed to obtain an embedding vector. On the basis of the embedding vector, feature extraction is continued to implement feature extraction. Then, the encoded data is input into the decoder for decoding. After decoding, the translated text is obtained.
[0115] Step S2200, performing feature extraction on the embedding vector by the encoder of the generator to generate a dense feature vector;
[0116] The encoder in the generator is implemented based on a self-attention mechanism. The encoder converts the embedding vector into a query vector, a key vector, and a value vector. The query vector and the key vector are used to extract significant features in the product title. Then, the feature extraction is implemented by combining the value vector to obtain a corresponding dense feature vector. Through the feature vector, the expression style, expression habit, composition structure, composition content, readability, and other key features in the product title are represented.
[0117] Step S2300, decoding the feature vector by the decoder of the generator, generating the advertisement script word by word in sequence.
[0118] The decoder of the generator is also implemented based on the self-attention mechanism and has basically the same structure as the encoder, except that the decoder refers to the feature vector to recalculate the self-attention score when calculating the scores of multiple self-attention modules based on the feature vector, and then outputs the result to the feedforward neural network for processing and output.
[0119] The feature vector finally output by the decoder is mapped to a higher-dimensional vector through a linear fully connected layer, and each dimension in the higher-dimensional vector corresponds to a score indicating a word unit mapped to a word in the word table. The scores are converted into classification probabilities by the output layer, and the word unit with the maximum classification probability is determined as the constituent of the corresponding sequence position of the advertisement script according to the classification probability corresponding to each dimension. The word unit can be a single word or a multi-word word. For Chinese, it can be a single Chinese character, and for Latin languages such as English, it can be a single word.
[0120] As can be seen, the generator constructed based on the encoder and the decoder can effectively convert one text information into another text information, which in this application is specifically manifested as converting a product title into an advertisement script. After the generator is trained to a convergent state and learns this conversion capability, it can serve the automatic creation of advertisement scripts and generate effective and high-quality advertisement scripts according to the product title given by the user.
[0121] In an embodiment extended on the basis of any of the above embodiments, before inputting the product title into the generator and generating the corresponding advertisement script by the generator, the following steps are included:
[0122] Step S3100, obtaining the script generation instruction submitted by the terminal device and determining the target product specified by the script generation instruction;
[0123] When an online store of an e-commerce platform needs to publish an advertisement, it hopes to automatically generate a script by the generator implemented in this application, so it can call the service interface implemented in this application, trigger the script generation instruction required for script generation by the management user of the online store in its terminal device, include the target product to be published in the advertisement script generation instruction, and then send it to the service interface. The service interface is then called for execution, which first determines the target product specified in the script generation instruction.
[0124] The service interface can be deployed in the advertisement system provided by the e-commerce platform and is open to the management users of each online store for calling.
[0125] Step S3200, querying the product database to obtain the product title of the target product.
[0126] After obtaining the target product, the service interface specifically obtains the unique feature information of the target product. Based on the unique feature information, it queries the product database of the online store to find the target product corresponding to the unique feature information. Then, it calls the product title in the product information of the target product, which can be used to input the generator of this application to generate advertising copy.
[0127] It is easy to understand that the generator in this application can be deployed in an advertising system to provide online stores on e-commerce platforms with a service that automatically generates advertising copy, thereby enriching the service capabilities of e-commerce platforms, optimizing the advertising publishing business logic, and improving user experience.
[0128] In embodiments extended from any of the above embodiments, after inputting a product title into the generator and generating corresponding advertising copy, the process includes:
[0129] Step S4100: Push the advertising copy to the terminal device that provides the product title for display;
[0130] Once the generator trained to convergence using this application obtains the advertising copy corresponding to the product title, the advertising copy can be pushed to the terminal device that submitted the product title for display.
[0131] In this embodiment, the user accesses an advertising publishing page on the terminal device, imports the target product for which the advertisement will be published on the advertising publishing page, and the advertising publishing page automatically displays the product title of the target product in the corresponding position. At the same time, a copy generation request is triggered, which includes the product title and is submitted to the server. The server then calls the generator to input the product title, and the generator generates the advertising copy corresponding to the product title, which is then returned to the terminal device and displayed on the advertising publishing page.
[0132] Users can continue to edit the ad copy displayed on the ad publishing page. The ad copy is the original version when it is not edited, and it is marked as the revised version after being encoded. When the user confirms that he / she wants to publish the ad, he / she can trigger the submit control to submit the ad publishing instruction to the server. The ad publishing instruction includes the ad copy. If the ad copy has not been edited, the original version of the ad copy is still sent. If the ad copy has been edited, the revised version replaces the original version.
[0133] Step S4200: In response to the advertising publishing instruction submitted by the terminal device containing the original version or a revised version of the advertising copy, the advertisement is submitted to the advertising system for publication.
[0134] The server can obtain the advertisement script carried in the advertisement publishing instruction submitted by the terminal device in response to the terminal device, which can be the original version or the revised version, depending on whether the user in the terminal device modifies it. Based on the obtained advertisement script, the corresponding advertisement of the target commodity can be constructed, and the advertisement can be submitted to the advertisement system matched with the e-commerce platform. The advertisement system can publish the advertisement according to its inherent advertisement publishing business logic. After the advertisement is published to any terminal device, the audience can read the advertisement script from the terminal device, and then directly access the corresponding product detail page of the target commodity through the advertisement.
[0135] It can be seen that the above embodiment further realizes the publication of the advertisement script of the generator of the present application to the advertisement system, completes the business loop of the advertisement script generated by the generator, and perfects the service function of the advertisement system matched with the e-commerce platform. Since the user publishing the advertisement does not need to create the advertisement script himself, the advertisement publishing efficiency is greatly improved, especially for users who are not proficient in the language required by the advertisement. In this way, the advertisement script generation and publication can greatly improve the advertisement publishing efficiency, which is efficient for both users and platforms.
[0136] An advertisement script generation device is provided to adapt to one of the purposes of the present application, which is a functional embodiment of the advertisement script generation method of the present application. The device is used to input a product title to the generator to generate a corresponding advertisement script. A training device is provided to match, please refer to Figure 8 The training device includes: a first training module configured to iteratively train a first model architecture to convergence using a sample title, the first model architecture including the generator and the constrainter, the generator being configured to predict an advertisement script corresponding to the sample title, and the constrainter being configured to predict a result title corresponding to the advertisement script; a second training module configured to iteratively train a discriminator to convergence using a sample script, the sample script including a negative sample generated by the generator and a positive sample pre-collected, the discriminator being configured to predict whether the sample script is a positive sample or a negative sample; and a third training module configured to iteratively train a second model architecture to a convergence state using a sample title, the second model architecture including the generator and the discriminator, wherein the weight of the discriminator is frozen.
[0137] In the extended embodiment based on any of the above embodiments, the first training module comprises: a sample calling unit configured to call a single sample title in the first data set, the sample title comprising a product title of a product adopted by an online store of an e-commerce platform; a generation execution unit configured to input the sample title into a generator in the first model architecture, and obtain a decoded advertisement script by coding and decoding the sample title by the generator; a constraint execution unit configured to input the advertisement script into a constraint in the first model architecture, and obtain a decoded result title by coding and decoding the advertisement script by the constraint; and an iterative decision unit configured to calculate a loss value of the result title according to the sample title, implement gradient update on the generator and the constraint according to the loss value, and continue to call a next sample title to implement iterative training on the first model architecture when the loss value does not reach convergence.
[0138] In the extended embodiment based on any of the above embodiments, the second training module comprises: a sample calling unit configured to call a single sample script in the second data set, the sample script comprising an advertisement script generated by the generator as a negative sample and an advertisement script pre-collected from an advertisement publishing system as a positive sample, and each sample script being provided with a first type label representing that the sample script is the positive sample or the negative sample; a classification discrimination unit configured to input the sample script into the discriminator to extract deep semantic information and classify and map according to the deep semantic information, and obtain a result label representing that the discriminator classifies the sample type of the sample script as the positive sample or the negative sample; and an iterative decision unit configured to calculate a loss value of the result label according to the first type label, implement gradient update on the discriminator according to the loss value, and continue to call a next sample script to implement iterative training on the discriminator when the loss value does not reach convergence.
[0139] In the extended embodiment based on any of the above embodiments, the third training module comprises: a sample calling unit configured to call a single sample title in the first data set, the sample title carrying a second type label representing that a sample type of the sample title is the positive sample or the negative sample; a generation execution unit configured to input the sample title into a generator in the second model architecture, and obtain a decoded advertisement script by coding and decoding the sample title by the generator; a classification discrimination unit configured to input the advertisement script into a discriminator in the second model architecture, and obtain a result label of the advertisement script by classifying and mapping the advertisement script by the discriminator, and weights of the discriminator being pre-frozen and solidified; and an iterative decision unit configured to calculate a loss value of the result label according to the second type label, implement gradient update on the generator according to the loss value, and continue to call a next sample title to implement iterative training on the second model architecture when the loss value does not reach convergence.
[0140] In an embodiment expanded on the basis of any of the preceding embodiments, the generator comprises: an embedding processing unit configured to perform word embedding on the product title to obtain an embedding vector thereof; an encoding processing unit configured to perform feature extraction on the embedding vector by an encoder of the generator to generate a dense feature vector; and a decoding processing unit configured to decode the feature vector by a decoder of the generator to generate the advertising copy character by character in sequence.
[0141] In an embodiment expanded on the basis of any of the preceding embodiments, the advertising copy generation apparatus comprises: a target determination module configured to obtain a copy generation instruction submitted by a terminal device and determine a target product specified by the copy generation instruction; and a title determination module configured to query a product database to obtain a product title of the target product.
[0142] In an embodiment expanded on the basis of any of the preceding embodiments, the advertising copy generation apparatus comprises: a copy pushing module configured to push the advertising copy to a terminal device providing the product title for display; and an advertisement publishing module configured to, in response to an advertisement publishing instruction submitted by the terminal device and containing an original version of the advertising copy or a revised version thereof, submit the advertising copy to an advertisement system for publishing.
[0143] To solve the above technical problems, the embodiments of the present application further provide a computer device. As shown in Figure 9 The computer device includes a processor, a computer readable storage medium, a memory and a network interface connected through a system bus. The computer readable storage medium of the computer device stores an operating system, a database and computer readable instructions. The database can store a control information sequence. The computer readable instructions, when executed by the processor, can enable the processor to implement a product search category identification method. The processor of the computer device is configured to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device can store computer readable instructions. The computer readable instructions, when executed by the processor, can enable the processor to execute the advertising copy generation method of the present application. The network interface of the computer device is configured to connect and communicate with a terminal. Those skilled in the art can understand that the structure shown in Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In the present embodiment, the processor is configured to execute Figure 8The specific functions of each module and its sub-modules in the above embodiment, the memory stores the program code and various data required to execute the above modules or sub-modules. The network interface is used for data transmission between the user terminal or the server. The memory in the above embodiment stores the program code and data required to execute all modules / sub-modules of the advertisement script generation device of the present application, and the server can call the program code and data of the server to execute the functions of all sub-modules.
[0145] The present application also provides a storage medium storing computer readable instructions, which are executed by one or more processors to make the one or more processors execute the steps of the advertisement script generation method of any embodiment of the present application.
[0146] The present application also provides a computer program product, including computer programs / instructions, which are executed by one or more processors to implement the steps of the method described in any embodiment of the present application.
[0147] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The program can include the processes of the above-mentioned embodiments of the method when executed. The storage medium can be a computer readable storage medium such as a magnetic disc, an optical disc, a read-only memory (ROM), or a random access memory (RAM).
[0148] In summary, the present application implements multi-stage training on the generator, so that the generator first learns the ability to generate advertisement scripts in the first stage, and then adjusts its generation ability through the participation of the discriminator in the third stage. Therefore, the generator can output high-quality advertisement scripts according to the given product title. During the entire training process, the sample title can be reused in different training stages, and the sample script can be the product of the generator during the training process, which greatly reduces the dependence on the sample size, improves the data utilization rate, and undoubtedly reduces the training cost of the generator. Finally, the application of the generator in the advertising field can improve the auxiliary creation efficiency of the advertisement script.
[0149] Those skilled in the art can understand that the steps, measures and schemes in the various operations, methods and processes discussed in the present application can be alternated, changed, combined or deleted. Further, other steps, measures and schemes in the various operations, methods and processes discussed in the present application can also be alternated, changed, rearranged, decomposed, combined or deleted. Further, the steps, measures and schemes in the various operations, methods and processes in the prior art can also be alternated, changed, rearranged, decomposed, combined or deleted.
[0150] The above only describes some embodiments of the present application. It should be pointed out that those skilled in the art can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A method for generating advertising copy, characterized in that, The user inputs the product title into the generator, which then generates the corresponding advertising copy, including: Word embedding is performed on the product title to obtain its embedding vector; The encoder of the generator extracts features from the embedded vector to generate a dense feature vector; The generator's decoder decodes the feature vector and generates advertising copy word by word in sequence; The training process of the generator includes: The first model architecture is iteratively trained to convergence using sample titles. The first model architecture includes a generator and a constraint unit. The generator is used to predict the advertising copy corresponding to the sample title, and the constraint unit is used to predict the result title corresponding to the advertising copy. The step of iteratively training the first model architecture to convergence using sample titles further includes: calculating the loss value of the result title based on the sample title, performing gradient updates on the generator and constraint unit based on the loss value, and continuing to iteratively train the first model architecture using the next sample title if the loss value has not reached convergence. The discriminator is iteratively trained to convergence using sample texts, which include negative samples generated by the generator and pre-collected positive samples. The discriminator is used to predict whether the sample texts are positive or negative. The second model architecture is iteratively trained to a convergent state using sample titles. The second model architecture includes the generator and the discriminator, wherein the weights of the discriminator are frozen.
2. The advertising copy generation method according to claim 1, characterized in that, The first model architecture was iteratively trained to convergence using sample titles, including: Retrieve a single sample title from the first dataset, the sample title including the product titles used by online stores on e-commerce platforms; The sample title is input into the generator in the first model architecture, and the generator encodes and decodes the sample title to obtain the decoded advertising copy. The advertising copy is input into the constraint in the first model architecture, and the constraint encodes and decodes the advertising copy to obtain the decoded title.
3. The advertising copy generation method according to claim 1, characterized in that, The discriminator is iteratively trained to convergence using sample texts, including: Call a single sample copy from the second dataset, the sample copy including advertising copy generated by the generator as a negative sample and advertising copy pre-collected from the advertising publishing system as a positive sample, each sample copy is set with a first type label corresponding to its positive or negative sample. The sample text is input into the discriminator to extract deep semantic information and is classified and mapped according to the deep semantic information to obtain a result label. The result label indicates whether the discriminator classifies the sample text as a positive sample or a negative sample. The loss value of the result label is calculated based on the first type of label. The discriminator is then updated using gradients based on the loss value. If the loss value does not converge, the next sample is called to iteratively train the discriminator.
4. The advertising copy generation method according to claim 1, characterized in that, The second model architecture is iteratively trained to convergence using sample titles, including: Retrieve a single sample title from the first dataset, the sample title carrying a second type label indicating whether its sample type belongs to a positive sample or a negative sample; The sample title is input into the generator in the second model architecture, and the generator encodes and decodes the sample title to obtain the decoded advertising copy. The advertising copy is input into the discriminator in the second model architecture. The discriminator classifies and maps the advertising copy to obtain its result label. The weights of the discriminator are pre-frozen and fixed. The loss value of the result label is calculated based on the second type of label, and the generator is updated according to the gradient based on the loss value. If the loss value does not converge, the next sample title is called to perform iterative training on the second model architecture.
5. The advertising copy generation method according to claim 1, characterized in that, Before the generator generates the corresponding advertising copy by inputting the product title, the process includes: Obtain the copy generation instruction submitted by the terminal device and determine the target product specified by the copy generation instruction; Query the product database to obtain the product title of the target product.
6. The advertising copy generation method according to claim 1, characterized in that, After inputting the product title into the generator, the generator will generate the corresponding advertising copy, including: The advertising copy will be pushed to the terminal device that provides the product title for display; In response to an advertising publication instruction submitted by the terminal device containing the original version or a revised version of the advertising copy, the advertisement is submitted to the advertising system for publication.
7. An advertising copy generation device, characterized in that, It is used to input product titles into a generator, which then generates corresponding advertising copy. The generator provides a matching training device and includes: an embedding processing unit for embedding words into the product title to obtain its embedding vector; an encoding processing unit for extracting features from the embedding vector using the generator's encoder to generate a dense feature vector; and a decoding processing unit for decoding the feature vector using the generator's decoder to generate the advertising copy word by word sequentially. The training device includes: The first training module is used to iteratively train a first model architecture until convergence using sample titles. The first model architecture includes a generator and a constraint unit. The generator is used to predict the advertising copy corresponding to the sample title, and the constraint unit is used to predict the result title corresponding to the advertising copy. The first training module further includes an iterative decision unit, which is used to calculate the loss value of the result title based on the sample title, perform gradient updates on the generator and constraint unit based on the loss value, and continue to iteratively train the first model architecture using the next sample title if the loss value has not converged. The second training module is used to iteratively train the discriminator to convergence using sample texts. The sample texts include negative samples generated by the generator and pre-collected positive samples. The discriminator is used to predict whether the sample texts are positive or negative. The third training module is used to iteratively train the second model architecture to a convergent state using sample titles. The second model architecture includes the generator and the discriminator, wherein the weights of the discriminator are frozen.
8. The advertising copy generation device according to claim 7, characterized in that, The first training module includes: The sample retrieval unit is used to retrieve a single sample title from the first dataset, the sample title including the product titles used by online stores on e-commerce platforms; The generation execution unit is used to input the sample title into the generator in the first model architecture, and the generator encodes and decodes the sample title to obtain the decoded advertising copy. The constraint execution unit is used to input the advertising copy into the constraint in the first model architecture, and the constraint encodes and decodes the advertising copy to obtain the decoded result title.
9. A computer device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 6, which, when invoked by a computer, executes the steps included in the corresponding method.
Citation Information
Patent Citations
Garment commodity advertisement copywriting generation method based on generative adversarial network
CN112000769A