A method, device and equipment for creating a marketing text
By constructing a logical triplet library and using reinforcement learning training models, the problem of insufficient logicality of selling points in marketing text generation was solved, achieving marketing text generation with strong logic and high diversity, thus improving user experience.
Patent Information
- Application Number
- CN202211003382.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-08-19
AI Technical Summary
Existing marketing text creation models lack oversight of the logical coherence between key selling points during the generation process, leading to conflicting key selling points, which affects the logic and diversity of the text and causes user fatigue.
By constructing a logical triplet library, the compatibility and exclusivity relationships between selling points are retrieved and processed. Combined with reinforcement learning training models, logically sound marketing texts are generated, avoiding the occurrence of conflicting selling points.
It improves the logic and diversity of marketing texts, reduces auditory fatigue, ensures the accuracy and diversity of generated texts, and enhances marketing effectiveness.
Smart Images

Figure CN115409025B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and particularly relates to a marketing text creation method, device and equipment. BACKGROUND
[0002] For the virtual anchor marketing of the product of the business line, analysis of the current user group found that most of the midstream and downstream anchors have single words and phrases, lack of innovation and professionalism, and are easy to cause user auditory fatigue. Therefore, a marketing text creation business is generated, which generates corresponding marketing words based on the marketing selling points of the goods, and improves the live words creation efficiency of the midstream and downstream anchors.
[0003] Generating marketing text from the marketing selling points of the goods belongs to the data-to-text scenario in the field of natural language processing (NLP), which is excellent in the e-commerce field.
[0004] For example, the AI intelligent copy generation mainly follows the What+Why copy generation logic, that is, the copy of the selling points of the goods is divided into two parts, the first half of the sentence uses the way of making a sentence with the keywords of the goods, mainly explaining what the goods or functions are, and the second half is Why, which is a reasoning description according to the first half, explaining where the above goods or functions are good. For example, based on the selling points of the goods "color: red; category: dress", the generated text is "wear a red dress and go to surprise the world". Based on this design and structure of training corpus, the generated copy has bright highlights of the goods and has a certain persuasiveness.
[0005] In addition, there is also e-commerce text creation, which mainly uses the end-to-end generation technology based on Transformer. Various forms of data are fused at the input end, such as user reviews, product titles, and product selling points. First, the product title and product selling points are encoded using Transformer, and then a dynamic posterior distillation module is used to effectively use user review information, introduce the user's focus on the product, and use this scheme to promote the generated marketing copy to be closer to the user's interest.
[0006] However, the text generated in the process of marketing text creation has logical problems, such as the examples shown in the following table:
[0007]
[0008] The common point of the existing marketing text creation scheme is end-to-end generation, which has the advantage of better utilizing massive training corpus, but the common disadvantage is the lack of logical supervision of text description. This is mainly due to the uneven distribution of product selling points in real scenarios. The actual input selling points are combinations of multiple selling points, and the proportion of some low-frequency selling point combinations in the training set will be more obviously low. Even with a large amount of corpus, it is difficult for the model to automatically learn the logic between text descriptions. SUMMARY
[0009] In view of the above, the present application aims to provide a marketing text creation method, device and equipment, which combines the logical relationship between selling point words to generate marketing text, and avoids the existence of conflicting selling point words in the same marketing text.
[0010] The technical solutions adopted by the present application are as follows:
[0011] In a first aspect, the present application provides a marketing text creation method, comprising:
[0012] receiving input selling point words;
[0013] processing the input selling point words in combination with a logical triple library to obtain output marketing text.
[0014] In one possible implementation, processing the input selling point words in combination with the logical triple library to obtain the output marketing text specifically includes:
[0015] retrieving a triple containing the current input selling point word from the logical triple library, including at least one first compatible triple and at least one first repulsive triple;
[0016] converting the current input selling point word, each first compatible triple and each first repulsive triple into first, second and third hidden layer representations, respectively;
[0017] concatenating the first hidden layer representation, all second hidden layer representations and all third hidden layer representations, and converting them into a fourth hidden layer representation;
[0018] decoding the fourth hidden layer representation to obtain the marketing text.
[0019] In one possible implementation, processing the input selling point words in combination with the logical triple library to obtain the output marketing text further includes:
[0020] retrieving a triple containing a selling point word similar to the current input selling point word, including at least one second compatible triple and at least one second repulsive triple;
[0021] transform each second compatible triple and each second repulsive triple into a fifth hidden layer representation and a sixth hidden layer representation respectively;
[0022] and
[0023] concatenate the first hidden layer representation, all the second hidden layer representations, all the third hidden layer representations, all the fifth hidden layer representations and all the sixth hidden layer representations, and transform into a seventh hidden layer representation;
[0024] decode the seventh hidden layer representation to obtain the marketing text.
[0025] In one possible implementation, obtaining the marketing text generation model comprises:
[0026] constructing logical triples among the selling point words based on the marketing text corpus to form a logical triple library;
[0027] training the marketing text generation model using the logical triple library.
[0028] In one possible implementation, constructing logical triples among the selling point words based on the marketing text corpus to form a logical triple library specifically comprises:
[0029] extracting selling point words from the marketing text corpus;
[0030] obtaining third compatible triples and third repulsive triples using the selling point words;
[0031] obtaining extended compatible triples and extended repulsive triples based on the third compatible triples and the third repulsive triples respectively using the transmission of logical chains;
[0032] taking the set of the third compatible triples, the third repulsive triples, the extended compatible triples and the extended repulsive triples as the logical triples.
[0033] In one possible implementation, obtaining the third compatible triples using the selling point words comprises:
[0034] extracting selling point words from each positive marketing text corpus to obtain a set of selling point descriptions;
[0035] combining the selling point words in the set of selling point descriptions two by two to form compatible combinations;
[0036] taking the set of compatible combinations obtained from all positive marketing text corpora as the third compatible triples.
[0037] In one possible implementation, a preset number of high-frequency combinations are obtained from the set of compatible combinations obtained from all positive marketing text corpora as the third compatible triples.
[0038] In one possible implementation, the third repulsion triplets are obtained by using the selling point words, including:
[0039] The output data with a score lower than a preset value is obtained by using the baseline model, and two-by-two combinations of selling point words with logical conflicts are obtained based on the output data as the third repulsion triplets;
[0040] The input data of the baseline model is the selling point words, the output data is the marketing text, and the baseline model does not contain constraints on the logical relationship between the selling point words.
[0041] In one possible implementation, the selling point extraction model is trained to extract the selling point words from the marketing text corpus.
[0042] In one possible implementation, the marketing text generation model is trained by using the logical triplets library, including cold start training and reinforcement learning training.
[0043] In one possible implementation, the reward value in the reinforcement learning training includes a reward value reflecting the correlation between the input selling point words, the logical triplets and the output text.
[0044] In one possible implementation, the reward value in the reinforcement learning training includes a penalty value reflecting the repetition of the selling point words.
[0045] In a second aspect, the present application provides a marketing text creation device, comprising a receiving module and a processing module.
[0046] The receiving module is configured to receive the input selling point words.
[0047] The processing module is configured to process the input selling point words in combination with the logical triplets library to obtain the output marketing text.
[0048] In one possible implementation, the processing module comprises a retrieval module, a first hidden layer conversion module, a second hidden layer conversion module and a decoding module.
[0049] The retrieval module is configured to retrieve triplets containing the current input selling point words from the logical triplets library, including at least one first compatible triplet and at least one first repulsion triplet.
[0050] The first hidden layer conversion module is configured to convert the current input selling point words, each first compatible triplet and each first repulsion triplet into first hidden layer representations, second hidden layer representations and third hidden layer representations, respectively.
[0051] The second hidden layer conversion module is configured to splice the first hidden layer representations, all the second hidden layer representations and all the third hidden layer representations, and convert them into fourth hidden layer representations.
[0052] The decoding module is configured to decode the fourth hidden layer representation to obtain the marketing text.
[0053] In one possible implementation, the apparatus further comprises a model obtaining module, the model obtaining module comprising a triple constructing module and a training module;
[0054] The triple constructing module is configured to construct logical triples between the selling point words based on the marketing text corpus to form a logical triple library.
[0055] The training module is configured to train the marketing text generation model using the logical triple library.
[0056] In one possible implementation, the triple constructing module comprises a selling point word extracting module, a triple obtaining module, an expanding module, and a triple combining module.
[0057] The selling point word extracting module is configured to extract selling point words from the marketing text corpus.
[0058] The triple obtaining module is configured to obtain third compatible triples and third repulsion triples using the selling point words.
[0059] The expanding module is configured to obtain expanded compatible triples and expanded repulsion triples based on the third compatible triples and the third repulsion triples respectively using the transmission of logical chains.
[0060] The triple combining module is configured to combine the third compatible triples, the third repulsion triples, the expanded compatible triples, and the expanded repulsion triples as the logical triples.
[0061] In one possible implementation, the training module comprises a cold start training module and a reinforcement learning training module, and the reinforcement learning training module is configured to perform reinforcement learning training on the marketing text generation model.
[0062] In a third aspect, the present application provides a marketing text creation device, comprising:
[0063] one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs comprise instructions that, when executed by the device, cause the device to perform the above-mentioned marketing text creation method.
[0064] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is run on a computer, the computer program causes the computer to perform the method in the first aspect or any possible implementation manner of the first aspect.
[0065] The concept of the present application is to provide a marketing text creation method, device and equipment, which combines the logical relationship between selling point words to generate marketing text, avoiding the existence of conflicting selling point words in the same marketing text. Further, the ternary group formed by the selling point words with compatible relationship and repulsive relationship with the input selling point words and their similar words is integrated into the marketing text generation process, on the basis of ensuring the logicality of the generated marketing text, the marketing text has higher accuracy and diversity, avoiding auditory fatigue. In addition, in the reinforcement learning training process of the marketing text generation model, the logicality and diversity of the output data are improved through the reward value of logicality and the penalty value of selling point word repetition, ensuring high-quality marketing text creation. BRIEF DESCRIPTION OF DRAWINGS
[0066] To make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described below with reference to the drawings, in which:
[0067] Figure 1 A flowchart of the marketing text creation method provided by the present application;
[0068] Figure 2 An architecture diagram of one implementation mode of the marketing text generation model provided by the present application;
[0069] Figure 3 A flowchart of one implementation mode of constructing a logical ternary group library provided by the present application;
[0070] Figure 4 A flowchart of one implementation mode of obtaining a third compatible ternary group using selling point words provided by the present application;
[0071] Figure 5 A structure diagram of one implementation mode of the marketing text creation device provided by the present application;
[0072] Figure 6 A structure diagram of one implementation mode of the ternary group construction module of the marketing text creation method provided by the present application;
[0073] Figure 7 A structure diagram of one implementation mode of the marketing text creation device provided by the present application. DETAILED DESCRIPTION
[0074] The embodiments of the present application will be described in detail below, and the examples of the embodiments are shown in the drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present application, and cannot be interpreted as a limitation of the present application.
[0075] The concept of the present application is to provide a marketing text creation method, device and equipment, which combines the logical relationship between selling point words to generate marketing text, avoiding the existence of conflicting selling point words in the same marketing text. Further, the ternary group formed by the selling point words with compatible and repulsive relationships with the input selling point words and their similar words is integrated into the marketing text generation process, ensuring that the generated marketing text has logic, and the marketing text has higher accuracy and diversity, avoiding auditory fatigue. In addition, in the reinforcement learning training process of the marketing text generation model, the logicality and diversity of the output data are improved by the reward value of logicality and the penalty value of selling point word repetition, ensuring high-quality marketing text creation.
[0076] For the foregoing core concept, the present application provides at least one embodiment of a marketing text creation method, which can include the following steps: Figure 1
[0077] S110: receiving an input selling point word. The selling point word can be an entity word representing product features, or an effect (such as elegant) corresponding to product features, or a short description text (such as a lockbone charming neck line).
[0078] S120: processing the input selling point word in combination with the logical ternary group library to obtain an output marketing text.
[0079] In one possible implementation, the above steps are implemented using a marketing text generation model, such as a sequence labeling model.
[0080] In one possible implementation, the marketing text generation model is based on the architecture of a sequence labeling model, under which the encoder and decoder are both encoded using a Transformer, as shown in Figure 2 .
[0081] In this embodiment, in one possible implementation, in combination with the marketing text generation model shown in Figure 2 , step S120 specifically includes:
[0082] S1201: retrieving a ternary group containing the current input selling point word in the logical ternary group library, including at least one first compatible ternary group and at least one first repulsive ternary group, as in the retrieval module in Figure 2 .
[0083] In one preferred implementation, after retrieving the ternary group containing the current input selling point word, the retrieval results are sorted according to similarity, and the top-k ternary groups with the highest similarity are retained as the first compatible ternary group and the first repulsive ternary group.
[0084] In a more preferred implementation, in order to facilitate the balance of repulsion triplets and compatible triplets, a preset number of half (e.g. k / 2) of compatible triplets and repulsion triplets can be reserved respectively, i.e. k / 2 compatible triplets and k / 2 repulsion triplets are reserved as the first compatible triplets and the first repulsion triplets respectively.
[0085] S1202: convert the current input selling point word, each first compatible triplet and each first repulsion triplet into a first hidden layer representation, a second hidden layer representation and a third hidden layer representation respectively.
[0086] In a possible implementation, after each first compatible triplet and each first repulsion triplet is separately encoded (such as convolution in the figure) using an independent CNN network, a hidden layer vector is generated through max-pooling (such as max-pool in the figure) as the second hidden layer representation and the third hidden layer representation. For example, the hidden layer vector representation of the i-th triplet is h i .
[0087] In another possible implementation, other convolutional neural networks can be used to encode the first compatible triplets and the second repulsion triplets.
[0088] In a possible implementation, the current input selling point word is spliced and then input into a Transformer encoder (such as Transformer encoder in the figure Figure 2 to obtain a hidden layer vector t as the first hidden layer representation.
[0089] S1203: splice the first hidden layer representation, all second hidden layer representations and all third hidden layer representations, and convert them into a fourth hidden layer representation, such as the feature fusion module in the figure Figure 2 .
[0090] In a possible implementation, after splicing all hidden layer representations, a multi-layer perceptron model MLP is used for transformation and a rectified linear unit RELU is used for activation, thereby obtaining a hidden layer representation that fuses triplet information with logical constraints as the fourth hidden layer representation.
[0091] In another possible implementation, after splicing, a model such as an artificial neural network can also be used for transformation and other activation functions can be used for activation to obtain the fourth hidden layer representation.
[0092] S1204: decode the fourth hidden layer representation (such as the decoder Decoder in the figure Figure 2 ) to obtain a marketing text.
[0093] Since the description field of part of the current input selling point words may not be consistent with the description of the logical triple library, for example, the input is "black", but there is no "black" in the logical triple library, and it stores "pure black".
[0094] Based on such a situation, in a preferred implementation, in S1201, the triple containing the similar selling point words to the current input selling point words is also retrieved, including at least one second compatible triple and at least one second repulsive triple, so that the triple containing the similar selling point word description can be retrieved. In a possible implementation, the similarity can be measured by fusing the text literal similarity (such as edit distance) in the form of word vector.
[0095] In this preferred implementation, in step S1202, each second compatible triple and each second repulsive triple is also converted into a fifth hidden layer representation and a sixth hidden layer representation, respectively. In step S1203, the first hidden layer representation, all second hidden layer representations, all third hidden layer representations, all fifth hidden layer representations and all sixth hidden layer representations are spliced and converted into a seventh hidden layer representation. In step S1204, the seventh hidden layer representation is decoded to obtain the marketing text.
[0096] It can be understood that the marketing text generation model can also use other structures of existing sequence labeling models.
[0097] In a possible implementation, obtaining the marketing text generation model comprises:
[0098] P1: constructing logical triples between selling point words based on a marketing text corpus to form a logical triple library.
[0099] The logical triple includes two different selling point words and the logical relationship between them, and the logical relationship includes compatibility and repulsion. The following table gives four examples:
[0100] Product selling point A Product selling point B Logical relationship Hanging strap Round collar Repel Hanging strap Warmth Repel Small off-shoulder Large off-shoulder Repel Micro off-shoulder Sexy Compatible
[0101] In a possible implementation, as shown in Figure 3 constructing logical triples between selling point words based on a marketing text corpus to form a logical triple library, specifically comprising:
[0102] S310: extracting selling point words from a marketing text corpus.
[0103] It should be noted that the existing marketing text generation model cannot reflect the association between the output marketing text and the input selling point, so it is necessary to manually extract and construct the association between them.
[0104] In a possible implementation, the selling point words in all marketing text corpora can be extracted by manual annotation, but the efficiency of manual annotation is low, and manual annotation of a large amount of data by multiple persons can lead to inconsistent annotation standards.
[0105] Based on the above considerations, in a preferred implementation, the selling point extraction model is used to extract selling point words from the marketing text corpus. Although the selling point extraction model also needs to be manually annotated, the amount of manual annotation is greatly reduced, which is conducive to constructing pseudo-parallel input selling point data, reducing the cost of manual annotation, and improving the parallelism of the input selling point.
[0106] In a possible implementation, the selling point extraction model is implemented by using a sequence labeling model, and all model schemes suitable for sequence labeling tasks can be used, such as a bidirectional encoder representation model BERT + conditional random field model CRF based on Transformer. For scenarios with less annotation data, a large model with strong baseline effect based on a generation model can also be used, such as a unified framework model UIE for general information extraction.
[0107] S320: Obtain third compatible triples and third repulsion triples by using the selling point words.
[0108] In a possible implementation, as shown in Figure 4 the third compatible triples are obtained by using the selling point words, including:
[0109] S410: Extract selling point words from each forward marketing text corpus to obtain a selling point description set.
[0110] It should be noted that the forward marketing text corpus can be a forward training sample of an existing marketing text generation model, or a marketing text with strong logic artificially constructed.
[0111] Specifically, the selling point words can be extracted from the forward marketing text corpus in an artificial manner.
[0112] In a possible implementation, the selling point extraction model described above is used to extract selling point words from the forward marketing text corpus.
[0113] S420: Combine the selling point words in the selling point description set two by two to form compatible combinations.
[0114] S430: Obtain the set of compatible combinations obtained from all forward marketing text corpora as the third compatible triples.
[0115] In a preferred implementation, a preset number of high-frequency combinations are obtained from the set of compatible combinations obtained from all forward marketing text corpora as the third compatible triples.
[0116] In a possible implementation, the third repulsion triplets are obtained using the selling point words, including:
[0117] First, the output data with a score lower than a preset value is obtained using the baseline model, and the score lower than the preset value indicates that the logic in the output data is poor. Based on the output data, a two-by-two combination of selling point words with logical conflicts is obtained as the third repulsion triplets.
[0118] The input data of the baseline model is the selling point words, the output data is the marketing text, and the baseline model does not contain constraints on the logical relationship between the selling point words. For example, an existing end-to-end text generation model. Common baseline models such as BERT-based sequence labeling models or autoregressive-based models such as GPT2 models use selling point words as prefix inputs.
[0119] Specifically, the third repulsion triplets are obtained based on the statistics of the samples generated by the baseline model. The pre-trained or existing selling point words are input into the baseline model, and the output data with a machine score lower than a preset value in the output data of the baseline model is selected. The selling point descriptions with logical conflicts therein are manually sorted to form the third repulsion triplets.
[0120] S330: Based on the transmission of the logic chain, the extended compatible triplets and the extended repulsion triplets are obtained based on the third compatible triplets and the third repulsion triplets, respectively. Specifically, based on the logic chain transmission principle of "the enemy of the enemy is the friend, and the enemy of the friend is the enemy", the extended triplets can be automatically generated from the third compatible triplets and the third repulsion triplets, and the extended compatible triplets and the extended repulsion triplets can be obtained through manual confirmation, thereby improving the efficiency of manual sorting.
[0121] S340: The set of the third compatible triplets, the third repulsion triplets, the extended compatible triplets, and the extended repulsion triplets are used as the logic triplets.
[0122] Unlike the common way of using a knowledge graph to encode background knowledge, the present application does not construct a knowledge graph, but directly uses triplets to represent logical knowledge relationships, which is mainly due to two considerations.
[0123] First, the construction of the knowledge graph in the vertical field often means a more strict ontology layer design, which requires higher cost of expert knowledge. In addition, the alignment between the entities of the graph is also very important, for example, the alignment of "silk" and "silk", and the alignment of "pure black" and "black". Without additional supervision information, this part of the alignment can be done through explicit rules or text literal similarity. The coverage of the former is often not enough, and the latter can be done for the model itself without separate processing. Compared with the direct use of triples, using triples to model knowledge directly and without entity alignment is an efficient and implementable way.
[0124] Second, compared with the direct use of triples, the main advantage of introducing a knowledge graph is to facilitate multi-hop reasoning. The logical relationships we have sorted out are mainly of two types: one is the logical relationship of compatibility, and the other is the logical relationship of repulsion. However, these two types of logical chains do not have absolute validity in transmission, especially the logical relationship of repulsion: for example, "V-neck" and "tube top" are logically conflicting, "tube top" and "cotton-padded jacket" are logically conflicting, and "V-neck" and "cotton-padded jacket" are also logically conflicting. "Summer" and "cotton-padded jacket" are conflicting, but "summer" and "V-neck" are compatible.
[0125] The present application directly uses triples to build logical knowledge relationships, which can well solve the above two problems.
[0126] P2: training a marketing text generation model using a logical triple library.
[0127] In one possible implementation, training a marketing text generation model using a logical triple library includes cold start training.
[0128] As shown in the cold start training process of the marketing text generation model Figure 2 and the use process thereof as shown in Figure 2 , first, the input selling point words are retrieved by the retrieval module to obtain the corresponding compatible triples and repulsive triples and are encoded and pooled. At the same time, the input selling point words are encoded by the Transformer encoder to obtain respective hidden layer representations. Then, all the hidden layer representations are spliced and converted into new hidden layer representations. Finally, the output data is obtained by decoding.
[0129] On the basis of the above, in one preferred implementation, a text generation technique based on reinforcement learning is introduced to fine-tune the marketing text model based on cold start, i.e., reinforcement learning training of the marketing text generation model. Reinforcement learning text generation techniques are a common optimization method in the field of text generation, and the algorithm used by the present application for reinforcement learning is not limited.
[0130] In one possible implementation, to improve the logicality of the generated text, the reward value in reinforcement learning training includes a reward value that reflects the relevance between the input selling points, logical triples and the output text. This is used to automatically evaluate the logicality of the generated text, so that the model generates as many phrase combinations as possible that are compatible with the input selling points and reduces the number of phrase combinations that are incompatible with them.
[0131] Specifically, for a given training iteration, the input selling points and the retrieved compatible triples are combined to form a set p, the retrieved exclusive triples are removed from the input selling points to form a set q, and the output marketing text is combined to form a set x.
[0132] For a quantity of n phrase combinations, the reward value of consistency is the relevance between the input selling points, logical triples, and the output text. n Represented as:
[0133]
[0134] Here, n is a hyperparameter. |n grams (p∩x)| represents the number of phrase combinations with n (n = 1, 2, ..., N) that match each other in sets p and x obtained using the statistical method of the bilingual translation quality assessment tool BLEU, where |n grams (q∩x)| represents the number of phrase combinations with n matching elements in sets q and x obtained using the statistical method of the bilingual translation quality assessment tool BLEU, |total n grams (x)| represents the total number of phrase combinations of size n that can be derived from set x, consistency n Indicates a combination of n phrases with a quantity of n. grams The corresponding reward value.
[0135] For example, if set x contains only one output text y: "Geometric print pattern, presenting a distinct sense of layering," this text can be divided into 13 groups of 3. grams Then |total 3 gramx (x)|=13. If set p contains individual characters or words (each character or word is a gram, for example, the selling point word "level" contains the two individual characters "level" and "time"), then the set contains 3. grams (For example, combining into 3grams "layers") contains 5 elements that correspond to the 3 in the output text y. grams If it matches, then |3 geams (p∩x)|=5.
[0136] If set x contains many output texts, then |total n grams(x) | represents the number of 3 grams (x) | represents the number of 3 grams (p∩x) | represents the number of 3 grams (x) | represents the number of 3 grams (x) | represents the number of 3
[0137] The overall reward value consistency for a certain iteration training is represented as:
[0138]
[0139] The reward of simply introducing the logical score may make the model tend to generate repeated selling point words, and in an extreme case, only repeating the selling point words may also obtain a high reward value. In view of this situation, in order to improve the diversity of the text, in a possible implementation manner, the reward value in the reinforcement learning training further includes a penalty value reflecting the repetitiveness of the selling point words, and the repeated words are punished to encourage generating as many phrase combinations as possible. For n phrase combinations, the penalty value diversity n is represented as follows:
[0140]
[0141] Wherein, |unique n grams (x) | represents the number of n grams obtained from all output texts from set x grams obtained from all output texts from set x grams If there are multiple same n grams , it is recorded as one in unique n grams (x).
[0142] The overall penalty value diversity for a certain iteration training is represented as:
[0143]
[0144] In a possible implementation manner, the final reward value reward of a certain iteration training is a value obtained by weighted sum of the above reward value and penalty value.
[0145] Corresponding to the above embodiments and preferred schemes, the application further provides an embodiment of a marketing text creation device, as shown in Figure 5 , which specifically can include a receiving module 510 and a processing module 520.
[0146] The receiving module 510 is used for receiving input selling point words.
[0147] The processing module 520 is configured to process the input selling point word in combination with the logical triple library to obtain the output marketing text.
[0148] In one possible implementation, the processing module 520 includes a retrieval module 5201, a first hidden layer conversion module 5202, a second hidden layer conversion module 5203, and a decoding module 5204.
[0149] The retrieval module 5201 is configured to retrieve, from the logical triple library, triples containing the current input selling point word, including at least one first compatible triple and at least one first repulsive triple.
[0150] The first hidden layer conversion module 5202 is configured to convert the current input selling point word, each first compatible triple, and each first repulsive triple into a first hidden layer representation, a second hidden layer representation, and a third hidden layer representation, respectively.
[0151] The second hidden layer conversion module 5203 is configured to concatenate the first hidden layer representation, all second hidden layer representations, and all third hidden layer representations, and convert them into a fourth hidden layer representation.
[0152] The decoding module 5204 is configured to decode the fourth hidden layer representation to obtain the marketing text.
[0153] In one preferred implementation, the retrieval module 5201 is further configured to retrieve, from the logical triple library, triples containing selling point words similar to the current input selling point word, including at least one second compatible triple and at least one second repulsive triple; the first hidden layer conversion module 5202 is further configured to convert each second compatible triple and each second repulsive triple into a fifth hidden layer representation and a sixth hidden layer representation, respectively; the second hidden layer conversion module 5203 is further configured to concatenate the first hidden layer representation, all second hidden layer representations, all third hidden layer representations, all fifth hidden layer representations, and all sixth hidden layer representations, and convert them into a seventh hidden layer representation; and the decoding module 5204 is further configured to decode the seventh hidden layer representation to obtain the marketing text.
[0154] In one possible implementation, the creation device further includes a model obtaining module 530, which includes a triple construction module 5301 and a training module 5302.
[0155] The triple construction module 5301 is configured to construct logical triples between selling point words based on a marketing text corpus to form a logical triple library.
[0156] The training module 5302 is configured to train a marketing text generation model using the logical triple library.
[0157] In one possible implementation, as Figure 6As shown, the triple construction module 5301 includes a selling point word extraction module 53011, a triple obtaining module 53012, an expansion module 53013, and a triple combination module 53014.
[0158] The selling point word extraction module 53011 is configured to extract selling point words from the marketing text corpus.
[0159] The triple obtaining module 53012 is configured to obtain third compatible triples and third repulsion triples using the selling point words.
[0160] The expansion module 53013 is configured to obtain expanded compatible triples and expanded repulsion triples based on the third compatible triples and the third repulsion triples respectively using the transmission of the logical chain.
[0161] The triple combination module 53014 is configured to combine the third compatible triples, the third repulsion triples, the expanded compatible triples, and the expanded repulsion triples as logical triples.
[0162] In one possible implementation, the training module 5302 includes a cold start training module and a reinforcement learning training module, and the reinforcement learning training module is configured to perform reinforcement learning training on the marketing text generation model.
[0163] It should be understood that the above Figure 5 and 6 The division of each component of the marketing text creation apparatus shown above is only a logical functional division, and in actual implementation, all or part of the components can be integrated into one physical entity, or can be physically separated. Moreover, all of the components can be implemented in the form of software through a processing element; all of the components can be implemented in the form of hardware; or some components can be implemented in the form of software through a processing element, and some components can be implemented in the form of hardware. For example, a certain above-described module can be a separately established processing element, or can be integrated in a certain chip of an electronic device to implement. The implementation of other components is similar. Moreover, all or part of the components can be integrated together, or can be independently implemented. In the implementation process, each step of the above method or each component above can be completed by integrated logic circuits of hardware in a processor element or instructions in the form of software.
[0164] For example, the above components can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, the components can be integrated together in the form of a System-On-a-Chip (SOC) implementation.
[0165] In light of the above embodiments and preferred solutions, those skilled in the art can understand that, in actual operations, the present application is applicable to various implementations, and the following carriers are used as illustrative descriptions:
[0166] (1) A marketing text creation device can include:
[0167] one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the device, cause the device to perform the steps / functions of the foregoing embodiments or equivalent implementations.
[0168] Figure 7 For the structural diagram of the embodiment of the marketing text creation device of the present application, the device can be an electronic device or a circuit device built into the above electronic device. The above electronic device can be a PC, a server, a smart terminal (mobile phone, tablet, watch, glasses, etc.), a smart TV, a smart screen, a teller machine, a robot, a drone, an ICV, a smart (gasoline) car, and a vehicle-mounted device, etc. The present embodiment does not limit the specific form of the marketing text creation device.
[0169] Specifically as Figure 7As shown, the marketing text creation device 900 includes a processor 910 and a memory 930. The processor 910 and the memory 930 can communicate with each other through an internal connection path to transmit control and / or data signals. The memory 930 is configured to store a computer program, and the processor 910 is configured to call and run the computer program from the memory 930. The processor 910 can be integrated with the memory 930, or more commonly, the processor 910 and the memory 930 are independent components. The processor 910 is configured to execute program codes stored in the memory 930 to implement the above functions. In specific implementations, the memory 930 can be integrated in the processor 910, or independent of the processor 910.
[0170] In addition, the marketing text creation device 900 can further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, and a sensor 901. The audio circuit can further include a speaker 982 and a microphone 984. The display unit 970 can include a display screen.
[0171] Further, the marketing text creation device 900 can further include a power supply 950 configured to supply power to various devices or circuits in the device 900.
[0172] It should be understood that Figure 7 The marketing text creation device 900 can implement the processes of the above-described method embodiments. The operations and / or functions of the various components in the device 900 can be respectively configured to implement the corresponding processes in the above-described method embodiments. For details, reference can be made to the descriptions of the method, device, and other embodiments described above, and the detailed descriptions are appropriately omitted here.
[0173] It should be understood that Figure 7 The processor 910 in the marketing text creation device 900 can be a system on a chip (SOC). The processor 910 can include a central processing unit (CPU) and can further include other types of processors, such as a graphics processing unit (GPU), and the like. Details are described below.
[0174] In summary, the various processors or processing units inside the processor 910 can cooperate to implement the above method processes, and the corresponding software programs of the various processors or processing units can be stored in the memory 930.
[0175] (2) a readable storage medium, wherein a computer program or the apparatus is stored on the readable storage medium, and when the computer program or the apparatus is executed, the computer program or the apparatus causes a computer to execute the steps / functions of the foregoing embodiments or equivalent embodiments.
[0176] In several embodiments provided by the present application, any function, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such an understanding, some technical solutions of the present application or parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product as described below.
[0177] (3) a computer program product (the product can include the apparatus), which, when running on a terminal device, causes the terminal device to execute the marketing text creation method of the foregoing embodiments or equivalent embodiments.
[0178] From the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps of the foregoing method can be implemented by means of software and the necessary universal hardware platforms. Based on such an understanding, the foregoing computer program product can include but is not limited to an APP; in continuation of the foregoing, the foregoing device / terminal can be a computer device (for example, a mobile phone, a PC terminal, a cloud platform, a server, a server cluster or a network communication device such as a media gateway, etc.). Moreover, the hardware structure of the computer device can further include at least one processor, at least one communication interface, at least one memory and at least one communication bus; the processor, the communication interface and the memory can complete mutual communication through the communication bus. The processor can be a central processing unit CPU, a DSP, a microcontroller or a digital signal processor, and can further include a GPU, an embedded neural network processing unit (Neural-network Process Units; hereinafter referred to as: NPU) and an image signal processor (Image Signal Processing; hereinafter referred to as: ISP), the processor can further include a specific integrated circuit ASIC, or one or more integrated circuits configured to implement an embodiment of the present application, etc., in addition, the processor can have the function of operating one or more software programs, and the software programs can be stored in the memory or other storage medium; and the foregoing memory / storage medium can include a non-volatile memory, for example, a non-removable disk, a U disk, a mobile hard disk, an optical disk, etc., and a read-only memory (Read-Only Memory; hereinafter referred to as: ROM), a random access memory (Random Access Memory; hereinafter referred to as: RAM), etc.
[0179] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the cases of A alone, A and B together, and B alone. Wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" and the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0180] Those skilled in the art can appreciate that the modules, units and method steps described in the embodiments disclosed in the specification can be realized by electronic hardware, computer software and combination of electronic hardware and computer software. Whether the functions are realized in hardware or software mode depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different ways to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0181] In addition, each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other. Especially, for the device, equipment and other embodiments, since they are basically similar to the method embodiments, the related parts can be referred to the part of the method embodiments. The above described device, equipment and other embodiments are only illustrative, and the modules, units and the like described as separate components can be or can not be physically separated, that is, they can be located in one place, or can be distributed to multiple places, such as nodes of system network. According to actual needs, part or all of the modules and units can be selected to achieve the purpose of the above embodiment scheme. Those skilled in the art can understand and implement without creative labor.
[0182] The above embodiments according to the drawings illustrate the structure, features and effects of the present application, but the above is only the preferred embodiment of the present application, and it should be noted that the technical features involved in the above embodiments and preferred modes can be reasonably combined into various equivalent schemes by those skilled in the art without departing from or changing the design idea and technical effects of the present application. Therefore, the present application is not limited by the drawings, and any change or modification made according to the idea of the present application, or any equivalent embodiment within the scope of the specification and drawings, shall be within the scope of protection of the present application.
Claims
1. A method of creating a marketing text, characterized by, The method comprises the following steps: receiving input selling point words; constructing logical triples among the selling point words based on a marketing text corpus, forming a logical triple library, and the logical triple library at least has third repulsion triples and third compatibility triples obtained by the selling point words, wherein the third repulsion triples are obtained by the following method: obtaining output data with a score lower than a preset value by using a baseline model, obtaining two-by-two combinations of selling point words with logical conflicts based on the output data as the third repulsion triples; wherein the input data of the baseline model is the selling point words, the output data is the marketing text, and the baseline model does not contain constraints on the logical relationship between the selling point words; training a marketing text generation model by using the logical triple library, and processing the input selling point words by the marketing text generation model to obtain output marketing text.
2. The method of claim 1, wherein, Processing the input selling point words in combination with the logical triple library to obtain the output marketing text specifically comprises the following steps: searching for triples containing the current input selling point words in the logical triple library, including at least one first compatibility triple and at least one first repulsion triple; converting the current input selling point words, each first compatibility triple and each first repulsion triple into first hidden layer representation, second hidden layer representation and third hidden layer representation respectively; splicing the first hidden layer representation, all second hidden layer representations and all third hidden layer representations, and converting them into fourth hidden layer representation; decoding the fourth hidden layer representation to obtain the marketing text.
3. The method of claim 2, wherein, Processing the input selling point words in combination with the logical triple library to obtain the output marketing text further comprises the following steps: searching for triples containing selling point words similar to the current input selling point words, including at least one second compatibility triple and at least one second repulsion triple; converting each second compatibility triple and each second repulsion triple into fifth hidden layer representation and sixth hidden layer representation respectively; and splicing the first hidden layer representation, all second hidden layer representations, all third hidden layer representations, all fifth hidden layer representations and all sixth hidden layer representations, and converting them into seventh hidden layer representation; decoding the seventh hidden layer representation to obtain the marketing text. Constructing logical triples among the selling point words based on a marketing text corpus to form a logical triple library specifically comprises the following steps:
4. The method of claim 1, wherein, obtaining extended compatibility triples and extended repulsion triples based on the third compatibility triples and the third repulsion triples respectively by using the transmission of logical chains; taking the set of the third compatibility triples, the third repulsion triples, the extended compatibility triples and the extended repulsion triples as the logical triples. Obtaining third compatibility triples by using the selling point words comprises the following steps:
5. The method of claim 4, wherein, extracting selling point words from each positive marketing text corpus to obtain a set of selling point descriptions; forming compatibility combinations by combining the selling point words in the set of selling point descriptions two by two; taking the set of compatibility combinations obtained from all positive marketing text corpora as the third compatibility triples. Obtaining a preset number of high-frequency combinations from the set of compatibility combinations obtained from all positive marketing text corpora as the third compatibility triples.
6. The method of claim 5, wherein, 7. The method of claim 4, wherein, The selling point extraction model is used to extract selling points from the marketing text corpus.
8. The method of claim 1, wherein, The logic triple library is used to train a marketing text generation model, including cold start training and reinforcement learning training.
9. The method of claim 8, wherein, The reward value in the reinforcement learning training includes a reward value reflecting the relevance between the input selling points, the logic triples and the output text.
10. The method of claim 8 or 9, wherein, The reward value in the reinforcement learning training includes a penalty value reflecting the repetition of the selling points.
11. A device for creating a marketing text, characterized by The model obtaining module includes a triple construction module; The receiving module is configured to receive input selling points; The triple construction module is configured to construct logic triples among the selling points based on the marketing text corpus, form a logic triple library, and the logic triple library at least includes third repulsion triples and third compatibility triples obtained using the selling points, wherein the third repulsion triples are obtained in the following manner: using a baseline model to obtain output data with a score lower than a preset value, and based on the output data, obtaining two-by-two combinations of selling points with logical conflicts as the third repulsion triples; wherein the input data of the baseline model is the selling points, the output data is the marketing text, and the baseline model does not contain constraints on the logical relationship between the selling points. The processing module is configured to train a marketing text generation model using the logic triple library, and process the input selling points by the marketing text generation model to obtain output marketing text.
12. The apparatus for creating a marketing text of claim 11, wherein, The processing module includes a retrieval module, a first hidden layer conversion module, a second hidden layer conversion module, and a decoding module. The retrieval module is configured to retrieve triples containing the currently input selling points from the logic triple library, including at least one first compatibility triple and at least one first repulsion triple. The first hidden layer conversion module is configured to convert the currently input selling points, each first compatibility triple and each first repulsion triple into first hidden layer representations, second hidden layer representations and third hidden layer representations, respectively. The second hidden layer conversion module is configured to splice the first hidden layer representations, all second hidden layer representations and all third hidden layer representations, and convert them into fourth hidden layer representations. The decoding module is configured to decode the fourth hidden layer representations to obtain the marketing text.
13. The apparatus for creating a marketing text of claim 11, wherein, The model obtaining module further includes a training module; The training module is configured to train a marketing text generation model using the logic triple library.
14. The apparatus for creating a marketing text of claim 13, wherein, The triple construction module includes a selling point extraction module, a triple obtaining module, an expansion module and a triple combination module; The selling point extraction module is configured to extract selling points from the marketing text corpus; The triple obtaining module is configured to obtain third compatibility triples and third repulsion triples using the selling points; The expansion module is configured to obtain expanded compatibility triples and expanded repulsion triples based on the third compatibility triples and the third repulsion triples, respectively, using the transmission of logic chains; The triad combination module is configured to combine the third compatible triad, the third repelling triad, the expanded compatible triad, and the expanded repelling triad as the logical triad.
15. The apparatus for creating a marketing text of claim 13, wherein, The training module includes a cold start training module and a reinforcement learning training module, and the reinforcement learning training module is configured to perform reinforcement learning training on the marketing text generation model.
16. A creation device of a marketing text, characterized by, The apparatus comprises: one or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the apparatus, cause the apparatus to perform the method of creating a marketing text according to any one of claims 1-10.
Citation Information
Patent Citations
Knowledge graph expansion method, electronic equipment and storage medium
CN112100343A
Generation method, device and equipment of recommended copywriting and storage medium
CN112487141A