Advertisement text generation method and device, equipment, medium and product
By introducing topic tags and keyword sequences into the advertising text generation model and combining them with a topic classifier to evaluate the matching degree, the problem of the advertising text generation model being difficult to control the topic is solved, and the generated advertising text is more in line with marketing needs, thus improving the quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BUSINESS LINE COMMERCIAL PTE LTD
- Filing Date
- 2022-08-17
- Publication Date
- 2026-04-24
AI Technical Summary
Existing advertising text generation models struggle to control the theme of the generated text, resulting in poor-quality advertising copy that fails to meet the needs of product marketing.
By taking topic tags and keyword sequences as input, an autoregressive prediction is performed using an advertising text generation model, and the matching degree of the advertising text is evaluated by a topic classifier to filter out advertising texts that match the topic tags.
It enables control over the theme of advertising text, resulting in text that better meets the needs of the marketing side, thus improving the quality and relevance of advertising text.
Smart Images

Figure CN115293817B_ABST
Abstract
Description
Technical Field
[0001] This application relates to advertising text generation technology, and more particularly to an advertising text generation method and corresponding apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] In e-commerce, advertising is a crucial way to attract potential customers and drive purchases. One of the key elements presented to users during advertising is the advertising copy. In practice, creating effective advertising copy requires a thorough understanding of the product and target market, as well as familiarity with advertising copywriting guidelines. Based on this understanding, one must extract the product's selling points, employ appropriate expression techniques, and craft copy that resonates with the market and maximizes commercial success. This clearly demonstrates the significant time and effort required for advertising copy creation. Furthermore, writing advertising copy demands a high level of expertise, which merchants often lack, further complicating the process.
[0003] To address these issues, deep learning-based neural network models are often used to automatically generate relevant advertising text for merchants and users. Currently, advertising text generation models are commonly used to generate advertising text. These models primarily take one or more pieces of information, such as product titles, details page text, and product images, as input, and use encoder-decoder models or language model structures to generate copy. While this can produce fluent copy that more or less introduces the product's features, it is difficult to control the theme of the generated text, and therefore the quality of the generated advertising copy cannot be controlled.
[0004] In reality, advertising text, as the text of service marketing activities, needs to fully explore potential customers' focus on the product. The text content must align with the product's information and characteristics, highlighting its core selling points. Only such advertising text can maximize traffic generation and conversion, ultimately achieving marketing objectives. Therefore, when generating advertising text, in addition to considering the product's own characteristics and selling points, it is also necessary to incorporate the product's marketing focus, concentrating on one or more key pieces of information to generate advertising text that interprets different focuses. Thus, whether the advertising text generation process can provide controllability to adjust the generated advertising text to meet different needs has become a core problem that current advertising text generation technology needs to overcome. Summary of the Invention
[0005] The purpose of this application is to solve the above-mentioned problems by providing a method for generating advertising text and corresponding apparatus, computer equipment, computer-readable storage medium, and computer program product.
[0006] To suit the various purposes of this application, the following technical solution is adopted:
[0007] In one aspect, to suit one of the purposes of this application, a method for generating advertising text is provided, comprising:
[0008] Obtain at least one topic tag for textual information describing the target product and for controlling the topic features of the advertising text;
[0009] The keywords corresponding to each of the aforementioned topic tags are determined by querying a preset thesaurus, and a keyword sequence covering each of the aforementioned topic tags is constructed. The keywords are used to describe the selling points of the product, and the selling points conform to the thematic characteristics of the topic tag to which the keyword belongs.
[0010] An advertising text generation model is used, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word in at least one advertising text through time-step autoregression.
[0011] The matching degree of each predicted advertising text to the topic tag is determined as the ranking score of the corresponding advertising text, and a portion of the advertising texts are filtered out.
[0012] On the other hand, to suit one of the purposes of this application, an advertising text generation apparatus is provided, comprising:
[0013] The input acquisition module is configured to acquire at least one topic tag for acquiring text information describing the target product and for controlling the topic features of the advertising text.
[0014] The input construction module is set to query and determine the keywords corresponding to each of the aforementioned topic tags from a preset topic thesaurus, and construct a keyword sequence covering the corresponding keywords of each of the aforementioned topic tags. The keywords are used to describe the selling points of the product, and the selling points conform to the theme characteristics of the topic tag to which the keyword belongs.
[0015] The inference and prediction module is configured to use an advertising text generation model, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word in at least one advertising text through autoregression step by step.
[0016] The ad selection module is configured to determine the matching degree of each predicted ad text to the topic tag as the corresponding ad text ranking score, and filter out a portion of the ad text.
[0017] In another aspect, a computer device provided for one of the purposes of this application includes a central processing unit and a memory, the central processing unit being used to invoke and run a computer program stored in the memory to perform the steps of the advertising text generation method described in this application.
[0018] In another aspect, a computer-readable storage medium is provided to suit another purpose of this application, which stores, in the form of computer-readable instructions, a computer program implemented according to the described advertising text generation method, which, when invoked by a computer, performs the steps included in the method.
[0019] In another aspect, a computer program product provided for another purpose of this application includes a computer program / instructions that, when executed by a processor, implement the steps of the advertising text generation method described in any embodiment of this application.
[0020] Compared with existing technologies, this application has several technological advantages, including but not limited to:
[0021] First, when generating advertising text, a keyword sequence is determined by providing topic tags, where keywords are words describing the corresponding selling points. This controls the topic features that the generated advertising text must conform to. Then, by constructing sentence pairs together with the product's text information, the keyword sequence is used as input to the advertising text model. The model predicts the advertising text, and the obtained advertising text is necessarily generated under the semantic guidance of the keyword sequence corresponding to the topic tags. Therefore, the obtained advertising text can effectively correspond to different topics.
[0022] Secondly, since the subject tags in this application are input elements that can be flexibly defined, the theme style of the generated advertising text can be controlled by adjusting the subject tags. Therefore, it is expected to effectively express the characteristics of the product in a way that better meets the needs of the marketing side.
[0023] Furthermore, when finalizing the advertising text, this application further evaluates the matching degree of the predicted advertising text to the topic tags specified in the input, and then selects the final advertising text based on the matching degree, thereby achieving a fine selection of the advertising text generated by the advertising text generation model. This ensures the overall quality of the final advertising text and makes it more in line with the expectations corresponding to the original input. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0025] Figure 1 This is a schematic diagram of the network architecture of an exemplary advertising text generation model in this application;
[0026] Figure 2 This is a flowchart illustrating one embodiment of the advertising text generation method of this application.
[0027] Figure 3This is a schematic diagram illustrating the process of the advertising text generation model predicting advertising text in the embodiments of this application.
[0028] Figure 4 This is a flowchart illustrating the autoregressive process of the decoder in an embodiment of this application.
[0029] Figure 5 This is a schematic diagram illustrating the process of filtering advertising text using a topic classifier in an embodiment of this application.
[0030] Figure 6 This is a schematic diagram illustrating the process of training the advertising text generation model in an embodiment of this application.
[0031] Figure 7 This is a schematic diagram illustrating the process of constructing a dataset in an embodiment of this application.
[0032] Figure 8 This is a schematic diagram illustrating the process of constructing a thesaurus in an embodiment of this application.
[0033] Figure 9 This is a schematic block diagram of the advertising text generation device of this application;
[0034] Figure 10 This is a schematic diagram of the structure of a computer device used in this application. Detailed Implementation
[0035] Unless otherwise specified, the neural network models referenced or potentially referenced in this application may be deployed on a remote server and invoked remotely on the client, or deployed on a client with the capability to invoke directly. In some embodiments, when running on the client, the corresponding intelligence may be acquired through transfer learning in order to reduce the requirements on the client's hardware resources and avoid excessive consumption of the client's hardware resources.
[0036] Unless otherwise expressly stated, the various embodiments disclosed in this application can be combined in a cross-cutting manner to flexibly construct new embodiments, as long as such combination does not depart from the inventive spirit of this application and can meet the needs of the prior art or solve a certain deficiency in the prior art. Those skilled in the art should be aware of such modifications.
[0037] Please see Figure 1In the network architecture of the advertising text generation model exemplarily provided in this application, the advertising text generation model includes an encoder, a decoder, a vocabulary classifier, and a topic classifier. The encoder receives input from the encoded vector obtained by serializing the text information of the product and the keyword sequence of the topic tag that plays a controlling role, extracts the deep semantic information therein, obtains the encoded vector sequence, and inputs it into the decoder. The decoder performs autoregressive decoding using the encoded vector sequence as prefix information. Through the vocabulary classifier, it predicts the text vector corresponding to each prefix information step by step, and then updates the prefix information with the feature encoding of the word determined according to the text vector to continue predicting the text vector of the next time step, thus realizing autoregressive decoding. The vocabulary classifier can map the hidden vectors decoded by the decoder to the reference vocabulary referenced by the advertising text generation model to obtain a probability distribution mapped to each word in the reference vocabulary as a text vector. The topic classifier is used to classify and map the text feature sequence corresponding to the advertising text finally generated by the decoder to determine the matching degree of each advertising text mapped to the topic tag, so as to optimize the advertising text.
[0038] The encoder described is suitable for vector representation and multi-layer semantic space transformation learning of input text, and can be selected from a variety of known models, including but not limited to RNN, BiLSTM, BiGRU, RoBERTa, ALBert, ERNIE, BERT-WWM, etc.
[0039] The decoder described herein is adapted to learn and adjust the state information of the hidden layer at the current time step by utilizing the preceding encoded vector sequence and the state information of the last hidden layer of the encoder, through multiple layers of self-attention and cross-self-attention mechanisms. Selectable autoregressive pre-trained models include, but are not limited to, GPT2, XLNet, DistilGPT2, etc., and can also employ classic models such as RNN, LSTM, and GRU.
[0040] In one embodiment, a Transformer model may be used, providing both an encoder and a decoder as an option for the advertising text generation model.
[0041] The vocabulary classifier can be constructed using the Softmax function, which is connected after the last hidden layer of the decoder. It predicts the word corresponding to the current time step, calculates the probability distribution of the corresponding hidden layer vector mapped to each word in the entire reference vocabulary, and uses it as a text vector.
[0042] The topic classifier can set a Sigmoid function for each known topic tag to calculate the classification probability mapped to that topic tag. When the decoder outputs the end symbol, the average value of the tensor corresponding to the last hidden layer of the decoder or the tensor corresponding to the preset classifier (e.g., [CLS]) is input into the topic classifier to predict the classification probability mapped to each topic tag. This can be used to calculate the overall loss value by referring to the topic tags of the input keyword sequence to determine the matching degree between the generated advertising text and the topic tags specified at the time of input.
[0043] The above exemplary advertising text generation models, after being pre-trained to a convergent state, can be used to implement the technical solutions of this application, including the methods, apparatus, devices, media, products, etc. of this application. The specific implementation methods of each technical solution will be disclosed below.
[0044] The advertising text generation method of this application can be programmed into a computer program product and deployed on a client or server. For example, in an exemplary application scenario of this application, it can be deployed on the server of an e-commerce platform.
[0045] Please see Figure 2 In one embodiment of the advertising text generation method of this application, the following steps are included:
[0046] Step S1100: Obtain at least one topic tag for describing the target product and for controlling the topic features of the advertising text;
[0047] In practical use, advertisers on e-commerce platforms can provide textual information describing the target product, as well as topic tags defining the thematic features of the desired generated advertising text. Then, keywords are selected for each topic tag to form a keyword sequence. The textual information and the keyword sequence are used together as input to the advertising text generation model of this application to guide the advertising text generation model to generate advertising text that satisfies the thematic features corresponding to the topic tags.
[0048] The text information may include any one or more of the following: product title, details text, attribute data, category tags, etc. The determined text information can undergo preprocessing to remove stop words, punctuation marks, etc., to ensure it is clean text before use. In one embodiment, the product title can be used as the text information of the target product. Since the product title is usually a concise description of the product's characteristics, it can save time in collecting useful information from a large amount of product information.
[0049] The aforementioned topic tags are indexes of keywords for the same type of selling point information. By pre-constructing a topic thesaurus, the mapping relationship between topic tags and their corresponding keywords for selling point information is stored in the topic thesaurus, and the corresponding keywords can be obtained subsequently based on the topic tags. The number of topic tags can be one that already exists in the topic thesaurus or any number of them.
[0050] To adapt to the input requirements of the advertising text generation model, in one embodiment, the keyword sequence can be placed at the beginning and the text information at the end, with a separator, such as [SEP], inserted between them. The separator helps the model distinguish the relationship between the first and second parts for semantic understanding. The separator can be a custom symbol, as long as it does not repeat words already existing in the reference vocabulary used by the advertising text generation model, and does not repeat special characters such as text start characters, end characters, category characters, and fill characters used in the advertising text generation model.
[0051] In one embodiment, a page for specifying target products and hashtags can be displayed on the terminal device, where advertiser users specify the product title of the target product and select listed hashtags, and then click to confirm and submit, thereby obtaining the necessary information to construct the input.
[0052] Step S1200: Query and determine the keywords corresponding to each of the aforementioned topic tags from the preset topic thesaurus, and construct a keyword sequence covering the corresponding topics tags. The keywords are used to describe the selling points of the product, and the selling points conform to the topic characteristics of the topic tag to which the keyword belongs.
[0053] A pre-built thesaurus can be used to establish the mapping relationship between topic tags and their various possible keywords, so that the topic tags can serve as an index for keywords that match the corresponding topic characteristics.
[0054] The keywords mentioned primarily refer to words that describe the selling points of a product, serving to describe the product's selling points. For example, selling points for an adult bicycle include: gears, speed, brakes, auxiliary systems, foldable, range, suitable terrain, battery, motor, etc. A hashtag can be created for each selling point keyword. Taking the hashtag corresponding to "gears" as an example, by expanding on similar words, this hashtag can map to multiple keywords, such as: gears, adjustable gears, derailleur, etc.
[0055] Since all keywords under the same topic tag in the thesaurus describe the same selling point, the same topic tag actually corresponds to the same topic characteristic, and the keywords under it must also conform to the topic characteristic corresponding to that topic tag. Therefore, the topic tags can be used to specify the theme style.
[0056] In one embodiment, when an advertiser provides a single topic tag, the thesaurus can be queried to obtain all the keywords mapped to that topic tag, forming a keyword sequence, which is then used as input to construct the advertising text generation model in conjunction with the text information of the target product.
[0057] In another embodiment, when an advertiser specifies multiple topic tags, they can query the thesaurus and select one or more keywords corresponding to each specified topic tag, constructing these keywords into a keyword sequence for use in constructing input. This ensures that the keywords in the keyword sequence cover all specified topic tags.
[0058] Step S1300: Using an advertising text generation model, with the sentence pairs formed by the keyword sequence and the text information as input, predict each word in at least one advertising text through time-step autoregression.
[0059] To adapt to the input format requirements of the advertising text generation model, sentence pairs can be constructed as follows: "Keyword Sequence [SEP] Text Information". After obtaining the sentence pairs, word embedding can be performed on the sentence pairs according to the reference vocabulary to determine the encoding features of each word in the sentence pairs in the reference vocabulary and obtain the corresponding encoding vectors.
[0060] Then, under the encoder of the advertising text generation model, deep semantic information is extracted from the encoded vector to obtain a corresponding encoded vector sequence. This encoded vector sequence is used as prefix information and input into the decoder of the advertising text generation model for decoding. The decoder, based on its own autoregressive mechanism, decodes step by step according to the encoded vector sequence. During the decoding process, the results obtained from the hidden layer are mapped to the vocabulary classifier through a fully connected layer to obtain the corresponding text vector. This text vector represents the classification probability of each word in the reference vocabulary. After selecting the word corresponding to the current time step based on the classification probability in the text vector, the encoded feature of this word in the reference vocabulary is appended to the prefix information, and the prediction of the next text vector continues until the end symbol is encountered. Thus, the entire process determines each word in the advertising text step by step, obtaining the corresponding text feature sequence, which contains tokens of multiple words. Based on these tokens, the specific text in the reference vocabulary can be determined, thereby converting the text feature sequence into advertising text.
[0061] It should be noted that, by adapting to different word selection algorithms, multiple text feature sequences corresponding to multiple advertising texts can be obtained for the same sentence pair, thus resulting in multiple advertising texts. The aforementioned word selection algorithm, based on given parameters, acts on the text vector corresponding to each time step, and optimizes and determines one or more words based on the classification probabilities of each category in the text vector. The word selection algorithm may include, but is not limited to, various algorithms such as Top_K algorithm, cluster search algorithm, and greedy search algorithm.
[0062] Therefore, it is easy to understand that, based on a single sentence pair, one or more advertising texts can be generated using the advertising text generation model of this application. By optimizing these advertising texts, results that meet the user's expectations can be obtained.
[0063] Step S1400: Determine the matching degree of each predicted advertising text to the topic tag as the ranking score of the corresponding advertising text, and filter out a portion of the advertising text.
[0064] like Figure 1 As shown, the advertising text generation model of this application, in addition to determining the lexical units of the advertising text through a vocabulary classifier, also uses a topic classifier to evaluate the extent to which the generated advertising text matches various topic tags in the topic vocabulary. Accordingly, the text feature sequences of each advertising text predicted by the advertising text generation model in the previous step are input into each of the aforementioned topic classifiers. Each topic classifier corresponds to a topic tag setting in the topic vocabulary. The classification probabilities corresponding to the positive and negative correlations between each text feature sequence and the corresponding topic tag are calculated by each topic classifier, thereby obtaining the classification results corresponding to each topic tag.
[0065] In one embodiment, the mean pooling result of the tensor corresponding to the last hidden layer of the decoder, or the tensor corresponding to a preset classifier, can be directly used as the input to each topic classifier to obtain the classification result. Since the last hidden layer of the decoder is the result of integrating information from all time steps in the serialization decoding process, and the classifier is a symbol that specifies a particular task, classifying the corresponding tensor is actually classifying the corresponding text feature sequence.
[0066] To evaluate the matching degree between the predicted ad texts and the topic tags specified by the user input, one embodiment can determine the overall loss value based on the classification results of each topic classifier. Specifically, for each topic tag specified by the user, the classification loss of each topic classifier can be calculated separately. Then, these classification losses are summarized into a single overall loss value. Thus, the overall loss value of each ad text inversely represents the matching degree between the original input topic tags and the actual mapped topic tags of the ad text. The lower the overall loss value, the better the match between the input topic tags and the prediction result; the higher the overall loss value, the worse the match between the input topic tags and the prediction result. Therefore, each ad text determined by the ad text generation model can obtain its corresponding matching degree.
[0067] Based on the matching degree, the advertising texts predicted by the advertising text generation model are optimized. For example, advertising texts with a matching degree lower than a preset threshold or advertising texts with the lowest matching degree are selected to achieve the filtering of advertising texts. Finally, the filtered advertising texts can be output as qualified advertising texts and provided to users for selection, thus completing the advertising generation service process.
[0068] As can be seen from the above embodiments, this application includes multiple technical advantages, including but not limited to:
[0069] First, when generating advertising text, a keyword sequence is determined by providing topic tags, where keywords are words describing the corresponding selling points. This controls the topic features that the generated advertising text must conform to. Then, by constructing sentence pairs together with the product's text information, the keyword sequence is used as input to the advertising text model. The model predicts the advertising text, and the obtained advertising text is necessarily generated under the semantic guidance of the keyword sequence corresponding to the topic tags. Therefore, the obtained advertising text can effectively correspond to different topics.
[0070] Secondly, since the subject tags in this application are input elements that can be flexibly defined, the theme style of the generated advertising text can be controlled by adjusting the subject tags. Therefore, it is expected to effectively express the characteristics of the product in a way that better meets the needs of the marketing side.
[0071] Furthermore, when finalizing the advertising text, this application further evaluates the matching degree of the predicted advertising text to the topic tags specified in the input, and then selects the final advertising text based on the matching degree, thereby achieving a fine selection of the advertising text generated by the advertising text generation model. This ensures the overall quality of the final advertising text and makes it more in line with the expectations corresponding to the original input.
[0072] Based on any embodiment of this application, please refer to Figure 3 An advertising text generation model is used, taking the keyword sequence and the sentence pairs formed by the text information as input, and predicting each word in at least one advertising text through autoregression step by step, including:
[0073] Step S1310: Encode the sentence pairs formed by the keyword sequence and the text information according to the reference vocabulary referenced by the advertising text generation model to obtain the encoding vector;
[0074] To adapt to the input requirements of the advertising text generation model, the sentence pairs need to be encoded. For this purpose, referring to the reference lexicon, each keyword in the keyword sequence of the sentence pair, as well as each word segment of the text information in the sentence pair, can be converted into the encoding features of the corresponding word units in the reference lexicon. These encoding features are then constructed into corresponding encoding vectors, which are input into the advertising text generation model for inference. In some embodiments, the positional encoding of each word unit can be further combined with the encoding features of the word units to enrich the reference information of the encoding vectors.
[0075] Step S1320: The encoder of the advertising text generation model extracts the deep semantic information of the encoded vector to obtain the corresponding encoded vector sequence;
[0076] As mentioned earlier, the encoder in the advertising text generation model is mainly based on RNN. Therefore, it is suitable for extracting deep semantic information by referring to the contextual information of the input encoded vector, realizing a deep semantic representation of the input encoded vector, and obtaining an encoded vector sequence. A self-attention mechanism can also be applied to the encoder to make key features more prominent, making the obtained encoded vector sequence more helpful for subsequent decoding.
[0077] Step S1330: Input the decoder of the advertising text generation model with the encoded vector sequence as prefix information, and autoregressively decode the text vectors of each time step, wherein each text vector represents the probability distribution of each word in the reference vocabulary.
[0078] The decoder in the advertising text generation model takes the prefix information formed by the encoded vector sequence as initial input. Based on the self-attention mechanism, it performs serial decoding, decoding step by step. The decoding results are then classified and mapped by a vocabulary classifier to obtain the probability distribution of each word in the reference vocabulary, forming a text vector. Based on the classification probability in the text vector, the word corresponding to the current time step can be selected. The encoded features of this word in the reference vocabulary are then appended to the prefix information to achieve autoregression. Then, the decoding continues in the next time step based on the updated prefix information until the end symbol is encountered.
[0079] Step S1340: In the autoregressive decoding process, for each time step, the corresponding word is determined by querying the reference vocabulary based on the generated text vector, and the encoding feature of the word is appended to the prefix information corresponding to the text vector to generate the text vector of the next time step.
[0080] Specifically, during the autoregressive decoding process of the decoder, at each time step, the reference vocabulary can be queried based on the text vector obtained by the vocabulary classifier to determine one or more lexical units.
[0081] In one embodiment, taking the determination of a single word as an example, this word is usually the word with the highest probability in the text vector. The encoded features of this word are appended to the prefix information corresponding to the current time step to obtain updated prefix information. This information can then be passed to the decoder for decoding in the next time step to generate the text vector for the next time step. This process continues until a terminator is encountered, completing the prediction of all text vectors, thus completing the prediction of each word in the advertising text. The words obtained step by step in each time step can form a corresponding text feature sequence according to the chronological relationship of the time steps. Each text feature sequence can be converted into a corresponding advertising text by determining the words in the reference vocabulary based on the encoded features within it.
[0082] In another embodiment, for the text vector corresponding to each time step, multiple lexical units can be selected by combining a preset word selection algorithm. Each lexical unit is then appended to the prefix information of the current time step, which can differentiate into multiple updated prefix information. Subsequently, the lexical units corresponding to the next time step can be inferred based on each updated prefix information. Furthermore, the lexical units selected from that time step or the total amount of prefix information can be controlled in each time step, thereby achieving multi-step gradual differentiation and finally obtaining the text feature sequence corresponding to multiple advertising texts, and thus determining multiple advertising texts.
[0083] As can be understood from the above embodiments, with the help of the advertising text generation model of this application, one or more advertising texts can be predicted as needed based on the same sentence pair, facilitating the selection of the best within a set. Because the advertising text generation model has serialization processing capabilities and can predict the corresponding text feature sequence with reference to the context, it has strong semantic understanding capabilities and can obtain fluent advertising text.
[0084] Based on any embodiment of this application, please refer to Figure 4In the autoregressive decoding process, for each time step, the corresponding word is determined by querying the reference vocabulary based on the generated text vector. The encoded feature of this word is then appended to the prefix information corresponding to the text vector to generate the text vector for the next time step, including:
[0085] Step S1341: Starting from the text vector obtained in the first time step, determine the first number of words that have the highest probability of mapping the text vector to the reference vocabulary, and construct a series of text features led by the encoding features of each word.
[0086] At the first time step, the encoded vector sequence output by the encoder is used as initial prefix information input into the decoder. The decoder decodes the vector and maps it to the vocabulary classifier to obtain the corresponding text vector. Since the text vector represents the probability distribution of each word in the reference vocabulary mapped to the current time step, a first quantity is set to correspond to the text vector at each time step. From this first quantity, multiple words with the highest probability are selected as preferred words. Each preferred word is used as a leader to construct multiple corresponding text feature sequences.
[0087] Step S1342: Append each text feature sequence to the prefix information, predict the text vector of the next time step based on the prefix information, determine the first number of words with the highest probability of mapping the text vector to the reference vocabulary, and append the encoding features of each word to the corresponding text feature sequence to differentiate multiple updated text feature sequences.
[0088] For one or more preferred words generated at the current time step, their encoded features can be appended to the prefix information used to generate the text vector at the current time step, thus differentiating multiple prefix information and updating the prefix information. This allows for the generation of the text vector for the next time step based on the updated prefix information, and then word selection can continue based on the text vector according to the logic of the first time step.
[0089] As time steps progress, it is easy to understand that when a selected word element of each time step is appended to the prefix information corresponding to the current time step, it is actually equivalent to appending a text feature sequence corresponding to the current time step to the prefix information corresponding to the first time step.
[0090] A text feature sequence from a previous time step can be further differentiated into multiple text feature sequences by concatenating each of the preferred words in the current time step. It's easy to understand that as time steps progress, by determining multiple preferred words based on the first set of terms and concatenating them with the corresponding text feature sequences, multiple text feature sequences can be continuously differentiated. By the final time step, a large number of text feature sequences can be obtained. Since each text feature sequence can correspond to a single advertising text, a large number of advertising texts can actually be predicted based on a single sentence pair.
[0091] Step S1343: Based on the correspondence between the word elements and text vectors of each updated text feature sequence, determine the probability of each word element in its text vector, and calculate the sum of the probabilities of all words elements in each updated text feature sequence;
[0092] In the autoregressive decoding process, each time step is divided into multiple text feature sequences. In order to optimize each text feature sequence and appropriately compress the total amount of the final generated advertising text, the best text feature sequence can be selected from all the obtained text feature sequences at each time step.
[0093] Specifically, for each time step, the text feature sequence added after the encoded features of the preferred words determined from the text vector corresponding to that time step can be summed based on the probability of each word corresponding to its corresponding text vector. This summation yields the total probability of each text feature sequence at the current time step. This total probability effectively indicates the overall prediction accuracy of all words in the entire text feature sequence and is significant for evaluating the accuracy of the text feature sequence.
[0094] Step S1344: Select multiple updated text feature sequences according to the preset second quantity, continue to obtain text vectors for the next time step and iterate the above process until the preset conditions are met and the process terminates, and obtain the final determined updated text feature sequence for constructing the corresponding advertising text.
[0095] Given the sum of probabilities for each text feature sequence at each time step, a preset second quantity can be used to sort the text feature sequences based on the sum of probabilities. Then, a number of text feature sequences corresponding to the second quantity are selected. Subsequent iterations are performed only on these text feature sequences, continuing from step S1343, until a preset condition is met. Other unselected text feature sequences are discarded. The preset condition can refer to the end-of-line character in the encountered prefix information. Termination of iteration signifies the end of the entire inference process. The final collection of all text feature sequences obtained can then be used as the text feature sequences corresponding to the advertising text actually predicted by the advertising text generation model, and can be used to convert the corresponding advertising text.
[0096] Based on the above exemplary autoregressive process, it can be understood that this application can apply a preset word selection algorithm during the decoding process of the advertising text generation model to continuously differentiate the text feature sequences corresponding to each time step, and can optimize these text feature sequences. Typically, there is a dual optimization at the word level and the text feature sequence level, which not only focuses on the best effect at the word level, but also on the best effect at the sequence level, so as to achieve quality control of the advertising text predicted by the advertising text generation model and ensure that the advertising text generation model generates a batch of advertising texts with better overall quality.
[0097] Based on any embodiment of this application, please refer to Figure 5 The matching degree of each predicted advertising text to the topic tag is determined as the ranking score of the corresponding advertising text, and a portion of the advertising texts are filtered out, including:
[0098] Step S1410: Input the text feature sequence corresponding to each of the aforementioned advertising texts into the topic classifier corresponding to each topic tag, and determine the classification label of the topic classifier corresponding to each topic tag for each advertising text;
[0099] As mentioned earlier, for the final output information of the decoder, i.e., the final obtained text feature sequences, each text feature sequence can be mapped to the classification result corresponding to the topic label by using the topic classifier corresponding to each topic label. This yields the classification label mapped to the topic classifier. The classifier can be a binary classifier, constructed using the sigmoid function.
[0100] Step S1420: Calculate the individual loss value of the classification label of each topic classifier corresponding to each topic label in the sentence pair, and summarize all the individual loss values to quantify the matching degree of the corresponding advertising text.
[0101] The extent to which the classification labels obtained from each text feature sequence correspond to the topic labels specified in the sentence pairs used as input to the advertising text generation model is essentially a representation of the accuracy of the advertising text generation model in generating advertising text on the corresponding topics. This extent can be determined by calculating the loss value of the classification labels of the corresponding topic classifiers. Specifically, in one embodiment, the topic labels specified in the sentence pairs can be used to calculate a single loss value for the classification labels generated by each corresponding topic classifier. During this process, the classification results of topic classifiers that do not provide topic labels need not be included in the calculation. Thus, by summing and averaging the single loss values of each topic classifier corresponding to the specified topic labels, it can be quantified as the matching degree of the corresponding text feature sequence, i.e., the corresponding advertising text. It is easy to understand that the higher the matching degree, the lower the accuracy of the generated advertising text matching the specified topic labels; the lower the matching degree, the higher the accuracy of the generated advertising text matching the specified topic labels.
[0102] Step S1430: Using the matching degree as a sorting score, select a portion of the advertising texts and determine them as the advertising texts predicted by the corresponding text information.
[0103] After determining the matching degree of each text feature sequence, it can be used as a ranking score. In one embodiment, all text feature sequences predicted by the advertising text generation model are ranked, and then a predetermined number of corresponding text feature sequences are selected. The advertising text corresponding to these text feature sequences can be regarded as the predicted advertising text corresponding to the text information of the target product in the sentence pair. In another embodiment, the ranking score can be optimized by combining a preset threshold, and only text feature sequences with ranking scores lower than the preset threshold are selected to obtain their corresponding advertising text as the predicted advertising text corresponding to the text information.
[0104] As can be seen from the above embodiments, this application cleverly connects a topic classifier after the decoder. The topic classifier determines whether the generated advertising text matches the topic tags specified in the input stage. Then, the matching degree is summarized based on the individual loss values of each topic classifier. Based on the matching degree, all advertising texts are optimized to further select high-quality advertising texts. The selected advertising texts are more likely to match the topic features corresponding to the topic tags specified by the user in the input stage, thereby producing advertising texts that meet the needs specified by the marketing side.
[0105] Based on any embodiment of this application, please refer to Figure 6 The process employs an advertising text generation model, taking the keyword sequence and the sentence pairs formed by the text information as input, and before predicting each word in at least one advertising text step by step via autoregression, it includes:
[0106] Step S2100: Obtain a single training sample from the dataset. The training sample includes text information of the product and at least one topic tag. An advertising reference sample of the product is set associated with the training sample.
[0107] To train the advertising text generation model of this application, a dataset can be prepared, storing multiple data records. Each data record stores a training sample and its corresponding advertising reference sample, which can be used as a supervisory label for a vocabulary classifier. The advertising reference sample can be historical advertising text that has already achieved high-quality advertising performance data in an advertising system. The training sample includes the text information of the product corresponding to the historical advertising text and one or more topic tags abstracted and determined based on the historical advertising text. The topic tags can be determined manually or based on statistical features. For the topic classifier of this application, the topic tags can also be used to supervise the supervisory labels of the corresponding topic classifier. The text information, as mentioned above, can be any one or any combination of multiple forms of information about various products.
[0108] It can be seen that the dataset constructed in this application is quite ingenious. The topic labels in the training samples not only serve as the input to the entire advertising text generation model, but also as the supervision labels for the subsequent topic classifier, which are used to identify whether the advertising text generated by the entire model conforms to the topic features of the topic labels in the training samples.
[0109] Step S2200: Query and determine the keywords corresponding to each of the aforementioned topic tags from the preset topic thesaurus, and construct a keyword sequence covering the corresponding topics tags. The keywords are used to describe the selling points of the product, and the selling points conform to the topic characteristics of the topic tag to which the keyword belongs.
[0110] The execution of this step is the same as step S1200 of this application. Both involve referring to a pre-constructed thesaurus and determining the keyword sequence corresponding to all the topic tags in the training samples based on the topic tags. The role of the keywords has been described above and will not be repeated here.
[0111] Step S2300: Input the sentence pair formed by the keyword sequence and the text information into the trained advertising text generation model and predict each word in at least one advertising text step by step through autoregression.
[0112] After obtaining the keyword sequences and text information corresponding to the training samples, they can be input into the trained advertising text generation model according to step S1300 and its related embodiments. Time-step autoregressive decoding is then performed to predict one or more advertising texts, obtaining the text feature sequences corresponding to each advertising text. Each advertising text is composed of lexical units from the reference vocabulary used by the advertising text generation model. That is, this step is implemented by the advertising text generation model's own mechanism, and its process is the same as described in the preceding embodiments; therefore, it will not be repeated here.
[0113] Step S2400: Calculate the first loss value corresponding to the predicted advertising text based on the advertising reference sample corresponding to the training sample;
[0114] As mentioned earlier, after its entire inference process, the advertising text generation model, with the assistance of a vocabulary classifier, ultimately predicts text feature sequences. The corresponding advertising texts to these feature sequences are the predicted advertising texts. Whether the predicted advertising text meets expectations can be determined by using the advertising reference samples corresponding to the training samples as supervision labels to calculate the classification loss of the text feature sequences. This is essentially calculating the classification loss of the corresponding predicted advertising text, thus obtaining the first loss value. The first loss value characterizes whether the advertising text generation model accurately generates the corresponding advertising reference samples. It is easy to understand that by using the first loss value to correct the model's weight parameters, the model's ability to accurately generate advertising reference samples corresponding to the training samples can be improved.
[0115] Step S2500: Input the predicted advertising text into the topic classifier corresponding to each topic tag, determine the classification label of the topic classifier corresponding to each topic tag for each advertising text, and calculate the second loss value corresponding to the classification label by referring to each topic tag in the training sample.
[0116] On the other hand, to evaluate whether the predicted advertising text obtained by the advertising text generation model highly corresponds to the specified topic tags in the corresponding training samples, the text feature sequence corresponding to the predicted advertising text can be classified and mapped by each topic classifier set for each topic tag in the corresponding topic thesaurus. This yields the classification results of the text feature sequence mapped to each topic classifier. Then, using supervision labels constructed from the topic tags in the training samples, the classification loss of each topic classifier's classification results is calculated to obtain a second loss value. The second loss value can be a quantified result of summarizing the individual loss values of each topic classifier, and this can be flexibly set. It is easy to understand that the second loss value characterizes the extent to which the predicted advertising text corresponds to the specified topic tags in the training samples. By using the second loss value to correct the weight parameters of the entire model, the ability of the entire model to accurately generate predicted advertising text that conforms to the topic features of the specified topic tags in the training samples can be improved.
[0117] Step S2600: Combine the first loss value and the second loss value into a total loss value, and correct the model parameters of the advertising text generation model according to the total loss value. Iterate the above process until the advertising text generation model is determined to have reached a convergence state according to the total loss value.
[0118] To facilitate the integration of the first and second loss values, a loss function can be designed, which is exemplarily represented as follows:
[0119] loss = lm loss *lm coef +mc loss *mc coef
[0120] Among them, lm loss The first loss value is lm. coef mc is the first weighting coefficient. loss The second loss value, mc coef This is the second weighting factor, and each weighting factor can be set flexibly.
[0121] The goal of model training is to minimize the total loss value. Therefore, the training objective can be set to reach 0 or be infinitely close to 0, which determines the termination condition for training the advertising text generation model. When the training objective has not been reached based on the total loss value, the model parameters are adjusted according to the total loss value to update the gradient, and then the next training sample is obtained from the dataset to iteratively train the model. When the training objective has been reached based on the total loss value, the training of the model can be terminated. At this point, the advertising text generation model has reached convergence and can then serve the purpose of generating advertising text for this application.
[0122] When correcting the model parameters of the advertising text generation model, the corresponding model parameters can be corrected according to the decision of each training sample, or the model parameters can be updated in small batches. After accumulating the total loss values of multiple training samples, the model can be comprehensively corrected by combining all the total loss values.
[0123] As can be seen from the above embodiments, during the training of the advertising text generation model in this application, due to the advantage of the model's network architecture having a topic classifier, through training, the model not only has the ability to generate advertising text, but also can control the topic style of the advertising text generated by the model by providing topic tags, making the advertising text generated by the model more likely to meet expectations and ensuring that it can generate qualified advertising text according to the specified topic tags.
[0124] Based on any embodiment of this application, please refer to Figure 7 Before obtaining a single training sample from the dataset, the following steps are included:
[0125] Step S3100: Obtain text information and advertising text corresponding to multiple products, segment each advertising text into words, and obtain the word segmentation set corresponding to each advertising text;
[0126] To construct the dataset required for training this application, historical data can be retrieved from the advertising database of the advertising system. The advertising database stores advertising information corresponding to each historically published advertisement, including product feature identifiers and corresponding advertising text. The product feature identifiers can be used to further obtain the corresponding product text information. This text information conforms to the pre-defined specifications required for the input of the advertising text generation model. As mentioned earlier, it can be product titles, detail text, attribute data, category tags, etc. In this embodiment, we can use the product title as an example for illustrative understanding.
[0127] To meet the needs of model training, the system can handle multiple historical advertisements, acquiring massive amounts of text information and advertising text corresponding to various products. For the advertising text, to facilitate the identification of topic tags, it can be segmented into words, obtaining its corresponding word set. Thus, the system obtains text information corresponding to multiple products, their advertising texts, and the corresponding word sets for the advertising texts.
[0128] Step S3200: Based on the word segmentation set of each advertisement text, determine one or more topic tags that correspond to the maximum number of identical keywords in the topic thesaurus;
[0129] In the thesaurus described above, each topic tag is mapped to multiple keywords. Therefore, as long as the keywords in the word segmentation set of an advertisement text can be matched with the corresponding topic tags according to the thesaurus, theoretically, this topic tag can be regarded as the topic tag corresponding to the advertisement text.
[0130] In one embodiment, firstly, the number of keywords in the thesaurus mapped to each topic tag in the thesaurus of each ad text's word segmentation set is counted. That is, the number of keyword sets corresponding to each topic tag in the thesaurus of each word segmentation set is determined. In other words, the number of words in a word segmentation set that are the same as the keywords in each topic tag is counted. Such a number can be determined for each topic tag for each word segmentation set. Then, according to a preset optimization rule, usually set to a maximum of two topic tags, the two topic tags with the highest number are selected as the topic tags actually corresponding to the word segmentation set. This represents the topic tags that actually correspond to the descriptive theme style of the ad text according to the mapping relationship between topic tags and keywords in the thesaurus of the thesaurus.
[0131] Step S3300: Construct a data record in the dataset for each advertisement text, wherein the text information corresponding to the advertisement text and all its corresponding topic tags are constructed as training samples in the data record, and the advertisement text is used as an advertisement reference sample in the data record corresponding to the training sample.
[0132] Once the corresponding topic tags for each product's advertising text have been determined, they can be stored in the dataset to construct the corresponding data records. Specifically, the text information corresponding to the advertising text and the topic tags obtained from tagging the advertising text can be set as training samples, while the advertising text associations can be set as advertising reference samples corresponding to the training samples, thus completing the construction of the data records.
[0133] As mentioned earlier, the advertising reference samples corresponding to the training samples can be used to supervise the quality of the advertising text predicted by the advertising text generation model, while the topic tags of the training samples can be used to supervise the extent to which the advertising text predicted by the advertising text generation model conforms to the quality corresponding to the target topic style. The combination of the two can be used to carry out the overall training of the advertising text generation model and improve the overall training efficiency of the model.
[0134] Based on the above embodiments, it is easy to understand that the training samples in the dataset required for training the advertising text generation model of this application can be obtained from the historical advertisements of the advertising system when determining the associated advertising reference samples. When determining the topic tags of the training samples, the subject thesaurus preset by this application can be referenced, and the statistical features obtained by the word segmentation set of the advertising reference samples relative to the subject thesaurus can be obtained. It can be seen that no manual factors need to be introduced throughout the process, the annotation cost is extremely low, and it helps to improve the training efficiency of the advertising text generation model.
[0135] Based on any embodiment of this application, please refer to Figure 8 Before obtaining a single training sample from the dataset, the following steps are included:
[0136] Step S4100: Obtain advertising texts corresponding to multiple products, and statistically select keywords in the advertising texts that carry the selling point information of the corresponding products;
[0137] The thesaurus of this application can be pre-constructed. To this end, advertising texts of multiple products corresponding to historical advertisements can be obtained from the advertising system. By statistically analyzing a large number of advertising texts, the keywords required for the thesaurus can be determined.
[0138] In one embodiment, the advertising text corresponding to all acquired products is first segmented into words, resulting in various word sets. Then, word frequency statistics are performed on each word in all word sets, counting the frequency of each word appearing across all word sets. Generally, a higher word frequency indicates that the corresponding word is used more frequently to describe the product's selling points, and thus has a greater chance of becoming a keyword in the thesaurus. Based on this principle, after determining the word frequency corresponding to each word, a subset of these words can be selected as keywords for the thesaurus based on a preset threshold.
[0139] Step S4200: Extract a set of keywords with similar semantics from the product text information set based on the keywords. The product text information set contains text information corresponding to multiple products.
[0140] The number of keywords obtained from multiple advertising texts based on word frequency statistics is relatively small. In order to make the keywords describing each topic tag in the thesaurus sufficiently rich, the vocabulary can be expanded based on the keywords determined from multiple advertising texts. To this end, the keywords determined from multiple advertising texts can be used to find a set of similar keywords in a given product text information set. Each set of keywords can be regarded as the sum of keywords describing the same selling point information and can correspond to a topic tag.
[0141] The product text information set can be extracted from the product information database of online stores on e-commerce platforms. The selection of corresponding text information can be any one or any combination of product titles, details text, attribute data, category tags, etc., so that it contains corresponding text information for multiple products.
[0142] To facilitate vocabulary expansion, each piece of text in the product text information set can be segmented into words first. Then, based on the semantic similarity between each segment and each keyword extracted from the advertising text, similar keywords are determined. Usually, the similar keywords also contain the corresponding keywords extracted from the advertising text with a high probability. Thus, all these keywords constitute a corresponding keyword set. Theoretically, each keyword in each keyword set is semantically similar and is used to describe the same selling point information.
[0143] Step S4300: Construct a thesaurus, which stores the various keyword sets and labels each keyword set with a corresponding topic tag.
[0144] Once multiple keyword sets are identified, the thesaurus can be constructed, and each keyword set can be assigned an index identifier as a topic tag. Each topic tag becomes a topic feature describing the same or similar selling points, serving as a reference. Subsequently, based on the given topic tags, the corresponding keywords can be determined from the thesaurus.
[0145] As can be easily understood from the above embodiments, in the process of constructing the thesaurus, this application first determines multiple basic keywords by referring to the word frequency statistics of the advertising text of historical advertisements, and then expands each basic keyword by referring to the text information obtained from the product information database to obtain the keyword set corresponding to the multiple basic keywords. Then, each keyword set is automatically tagged. The whole process does not require the introduction of manual factors and has high efficiency. It can be seen that the entire technical solution of this application can be implemented automatically, with low implementation cost and good results.
[0146] Please see Figure 9To meet one of the purposes of this application, an advertising text generation apparatus is provided, which is a functional embodiment of the advertising text generation method of this application. The apparatus includes an input acquisition module 1100, an input construction module 1200, an inference prediction module 1300, and an advertising selection module 1400. The input acquisition module 1100 is configured to acquire text information describing a target product and at least one topic tag for controlling the theme features of the advertising text. The input construction module 1200 is configured to query and determine the keywords corresponding to each topic tag from a preset thesaurus, constructing a keyword sequence covering the corresponding topic tags. The keywords are used to describe the selling points of the product, and the selling points conform to the theme features of the topic tag to which the keyword belongs. The inference prediction module 1300 is configured to use an advertising text generation model, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word element in at least one advertising text through time-step autoregression. The advertising selection module 1400 is configured to determine the matching degree of each predicted advertising text mapped to the topic tag as the ranking score of the corresponding advertising text, and filter out a portion of the advertising text.
[0147] Based on any embodiment of this application, the inference prediction module 1300 includes: a sentence pair encoding unit, configured to encode the sentence pairs formed by the keyword sequence and the text information according to the reference vocabulary referenced by the advertising text generation model, to obtain an encoding vector; a model encoding unit, configured to extract the deep semantic information of the encoding vector using the encoder of the advertising text generation model, to obtain a corresponding encoding vector sequence; a model decoding unit, configured to input the encoding vector sequence as prefix information into the decoder of the advertising text generation model, and autoregressively decode the text vectors of each time step, wherein each text vector represents the probability distribution of each word mapped to each word in the reference vocabulary; and a regression processing unit, configured to, during the autoregressive decoding process, query the reference vocabulary to determine the corresponding word for each time step based on the text vector generated therefrom, and append the encoding feature of the word to the prefix information corresponding to the text vector to generate the text vector of the next time step.
[0148] Based on any embodiment of this application, the regression processing module includes: an initial processing subunit, configured to start from the text vector obtained in the first time step, determine a first number of words with the highest probability mapped to the reference vocabulary, and construct text feature sequences with the encoding features of each word as the guide; a regression iteration subunit, configured to append the prefix information to each text feature sequence, predict the text vector of the next time step based on the prefix information, determine the first number of words with the highest probability mapped to the reference vocabulary, and append the encoding features of each word to the corresponding text feature sequence to differentiate into multiple updated text feature sequences; a concatenation and selection subunit, configured to determine the probability of each word in its text vector based on the correspondence between the words in each updated text feature sequence and the text vector, and calculate the sum of the probabilities of all words in each updated text feature sequence; and an iteration control subunit, configured to select multiple updated text feature sequences according to a preset second number, continue to obtain text vectors for the next time step, iterate the above process until a preset condition is met, and obtain the finally determined updated text feature sequence for constructing the corresponding advertising text.
[0149] Based on any embodiment of this application, the advertising selection module 1400 includes: a tag classification unit, configured to input the text feature sequence corresponding to each advertising text into the topic classifier corresponding to each topic tag, and determine the classification tag of the topic classifier corresponding to each topic tag for each advertising text; a loss calculation unit, configured to calculate the individual loss value of the classification tag of each topic classifier corresponding to each topic tag in the sentence pair, and summarize and quantify all individual loss values into the matching degree of the corresponding advertising text; and an advertising filtering unit, configured to use the matching degree as a sorting score to filter out a portion of the advertising texts and determine them as the advertising texts predicted corresponding to the text information.
[0150] Based on any embodiment of this application, prior to the inference prediction module 1300, it includes: a sample retrieval module, configured to acquire a single training sample from the dataset, the training sample including text information of the product and at least one topic tag, and an advertising reference sample of the product associated with the training sample; an input construction module 1200, configured to query and determine the keywords corresponding to each topic tag from a preset topic thesaurus, construct a keyword sequence covering the keywords corresponding to each topic tag, the keywords being used to describe the selling points of the product, the selling points conforming to the topic characteristics of the topic tag to which the keyword belongs; and an inference prediction module 1300, configured to input the sentence pair formed by the keyword sequence and the text information into the trained advertising text generation model to predict the product's advertising text generation model step by step using autoregression. The system generates a text text by taking one word from each missing word in the advertisement text and determining the predicted advertisement text based on the text vector sequence. A text-level loss calculation module is configured to calculate a first loss value corresponding to the predicted advertisement text based on the advertisement reference sample corresponding to the training sample. A label-level loss calculation module is configured to input the predicted advertisement text into the topic classifier corresponding to each topic label, determine the classification label of each topic classifier for each advertisement text, and calculate a second loss value corresponding to the classification label based on the topic labels in the training sample. An iterative decision module is configured to combine the first and second loss values into a total loss value, correct the model parameters of the advertisement text generation model based on the total loss value, and iterate the above process until the advertisement text generation model is determined to have reached a convergence state based on the total loss value.
[0151] Based on any embodiment of this application, prior to the sample calling module, the module includes: an advertising word segmentation module, configured to acquire text information corresponding to multiple products and advertising text, segment each advertising text into words, and obtain a word segmentation set corresponding to each advertising text; a topic matching module, configured to determine one or more topic tags corresponding to the maximum number of identical keywords in the topic thesaurus based on the word segmentation set of each advertising text; and a record construction module, configured to construct a data record in the dataset for each advertising text, wherein the text information corresponding to the advertising text and all its corresponding topic tags are constructed as training samples in the data record, and the advertising text is used as an advertising reference sample in the data record corresponding to the training sample.
[0152] Based on any embodiment of this application, prior to the sample calling module, it includes: a keyword selection module, configured to acquire advertising texts corresponding to multiple products, and statistically select keywords in the advertising texts that carry the selling point information of the corresponding products; a keyword expansion module, configured to extract a set of keywords with semantically similar keywords from the product text information set based on the keywords, the product text information set containing text information corresponding to multiple products; and a thesaurus construction module, configured to construct a thesaurus, wherein the various keyword sets are stored, and each keyword set is labeled with a corresponding topic tag.
[0153] To address the aforementioned technical problems, embodiments of this application also provide computer equipment. For example... Figure 10 As shown, the computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable storage medium stores an operating system, a database, and computer-readable instructions. The database may store a sequence of control information. When executed by the processor, the computer-readable instructions enable the processor to implement a product search category identification method. The processor provides computing and control capabilities to support the operation of the entire computer device. The memory stores computer-readable instructions, which, when executed by the processor, enable the processor to execute the advertising text generation method of this application. The network interface of the computer device is used for communication with a terminal. Those skilled in the art will understand that… Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0154] In this embodiment, the processor is used to execute... Figure 9 The specific functions of each module and its sub-modules are defined within the device. The memory stores the program code and various types of data required to execute these modules or sub-modules. The network interface is used for data transmission between the user terminal and the server. In this embodiment, the memory stores the program code and data required to execute all modules / sub-modules in the advertising text generation device of this application. The server can call the server's program code and data to execute the functions of all sub-modules.
[0155] This application also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the advertising text generation method of any embodiment of this application.
[0156] This application also provides a computer program product, including a computer program / instructions that, when executed by one or more processors, implement the steps of the method described in any embodiment of this application.
[0157] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0158] In summary, this application can control the theme style of the advertising text generated by the advertising text generation model through topic tags, so that it can adapt to actual marketing needs and generate effective advertising text.
Claims
1. A method for generating advertising text, characterized in that, include: Obtain at least one topic tag for textual information describing the target product and for controlling the topic features of the advertising text; The keywords corresponding to each of the aforementioned topic tags are determined by querying a preset thesaurus, and a keyword sequence covering each of the aforementioned topic tags is constructed. The keywords are used to describe the selling points of the product, and the selling points conform to the thematic characteristics of the topic tag to which the keyword belongs. An advertising text generation model is used, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word in at least one advertising text through time-step autoregression. The matching degree of each predicted advertising text to the topic tag is determined as the ranking score of the corresponding advertising text, and a portion of the advertising texts are filtered out.
2. The advertising text generation method according to claim 1, characterized in that, An advertising text generation model is used, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word in at least one advertising text through autoregression step by step, including: The keyword sequence and the sentence pair formed by the text information are encoded according to the reference vocabulary referenced by the advertising text generation model to obtain the encoding vector; The encoder of the advertising text generation model extracts the deep semantic information of the encoded vector to obtain the corresponding encoded vector sequence; The decoder of the advertising text generation model is input with the encoded vector sequence as prefix information, and the text vectors at each time step are decoded by autoregression, wherein each text vector represents the probability distribution of each word in the reference vocabulary. During the autoregressive decoding process, for each time step, the corresponding word is determined by querying the reference vocabulary based on the generated text vector. The encoded features of the word are then appended to the prefix information corresponding to the text vector to generate the text vector for the next time step.
3. The advertising text generation method according to claim 2, characterized in that, In the autoregressive decoding process, for each time step, the corresponding lexical unit is determined by querying the reference vocabulary based on the generated text vector. The encoded feature of this lexical unit is appended to the prefix information corresponding to the text vector to generate the text vector for the next time step, including: Starting with the text vector obtained at the first time step, determine the first number of words that have the highest probability of mapping the text vector to the reference vocabulary, and construct a series of text features led by the encoding features of each word. Each text feature sequence is followed by the prefix information, and the text vector of the next time step is predicted based on the prefix information. The first number of words with the highest probability of mapping the text vector to the reference vocabulary are determined, and the encoded features of each word are appended to the corresponding text feature sequence to differentiate multiple updated text feature sequences. Based on the correspondence between the words and text vectors of each updated text feature sequence, determine the probability of each word in its text vector, and calculate the sum of the probabilities of all words in each updated text feature sequence; Based on the preset second quantity, select multiple updated text feature sequences, continue to obtain text vectors for the next time step, iterate the above process until the preset conditions are met and terminate, and obtain the final determined updated text feature sequence to construct the corresponding advertising text.
4. The advertising text generation method according to claim 2, characterized in that, The matching degree of each predicted ad text to the topic tag is determined as the ranking score of the corresponding ad text, and a portion of the ad texts are filtered out, including: Input the text feature sequence corresponding to each of the aforementioned advertising texts into the topic classifier corresponding to each topic tag to determine the classification label of each topic classifier corresponding to each advertising text. Calculate the individual loss value of the classification label of each topic classifier corresponding to each topic in the sentence pair, and summarize all the individual loss values to quantify the matching degree of the corresponding advertising text. Using the matching degree as a sorting score, a portion of the advertising text is selected and determined as the advertising text predicted corresponding to the text information.
5. The advertising text generation method according to any one of claims 1 to 4, characterized in that, Before employing an advertising text generation model, which takes the keyword sequence and the sentence pairs formed by the text information as input, and performs time-step autoregression to predict at least one word element in the advertising text, the process includes: Obtain a single training sample from the dataset, the training sample including text information of the product and at least one topic tag, and associate the training sample with an advertising reference sample of the product; The keywords corresponding to each of the aforementioned topic tags are determined by querying a preset thesaurus, and a keyword sequence covering each of the aforementioned topic tags is constructed. The keywords are used to describe the selling points of the product, and the selling points conform to the thematic characteristics of the topic tag to which the keyword belongs. The advertising text generation model, trained by inputting the sentence pairs formed by the keyword sequence and the text information, predicts at least one word element in the advertising text through time-step autoregression. Calculate the first loss value corresponding to the predicted advertising text based on the advertising reference sample corresponding to the training sample; The predicted advertising text is input into the topic classifier corresponding to each topic tag to determine the classification label of each topic classifier corresponding to each advertising text. The second loss value corresponding to the classification label is calculated with reference to each topic tag in the training sample. The first and second loss values are combined into a total loss value. The model parameters of the advertising text generation model are then adjusted based on the total loss value. This process is iterated until the advertising text generation model is determined to have reached a convergence state based on the total loss value.
6. The advertising text generation method according to claim 5, characterized in that, Before obtaining a single training sample from the dataset, the following steps are included: Obtain text information and advertising text corresponding to multiple products, segment each advertising text into words, and obtain the word set corresponding to each advertising text; Based on the word segmentation set of each advertisement text, determine one or more topic tags that correspond to the maximum number of identical keywords in the thesaurus. For each advertisement text, a data record is constructed in the dataset. The text information corresponding to the advertisement text and all its corresponding topic tags are constructed as training samples in the data record. The advertisement text is used as an advertisement reference sample in the data record that corresponds to the training sample.
7. The advertising text generation method according to claim 5, characterized in that, Before obtaining a single training sample from the dataset, the following steps are included: Obtain advertising texts corresponding to multiple products, and statistically select keywords in the advertising texts that carry the selling points information of the corresponding products; Based on the keywords, a set of keywords with similar semantics is extracted from the product text information set, wherein the product text information set contains text information corresponding to multiple products; Construct a thesaurus that stores the various keyword sets, and label each keyword set with a corresponding topic tag.
8. An advertising text generation device, characterized in that, include: The input acquisition module is configured to acquire at least one topic tag for acquiring text information describing the target product and for controlling the topic features of the advertising text. The input construction module is set to query and determine the keywords corresponding to each of the aforementioned topic tags from a preset topic thesaurus, and construct a keyword sequence covering the corresponding keywords of each of the aforementioned topic tags. The keywords are used to describe the selling points of the product, and the selling points conform to the theme characteristics of the topic tag to which the keyword belongs. The inference and prediction module is configured to use an advertising text generation model, taking the sentence pairs formed by the keyword sequence and the text information as input, and predicting each word in at least one advertising text through autoregression step by step. The ad selection module is configured to determine the matching degree of each predicted ad text to the topic tag as the corresponding ad text ranking score, and filter out a portion of the ad text.
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 7.
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 7, which, when invoked by a computer, executes the steps included in the corresponding method.
Citation Information
Patent Citations
Advertisement publishing method and device
CN112184318A
Text style migration technology-based character beautifying method
CN113627162A