WO2022095798A1 - 一种文案生成方法、装置、电子设备、存储介质和程序 - Google Patents
一种文案生成方法、装置、电子设备、存储介质和程序 Download PDFInfo
- Publication number
- WO2022095798A1 WO2022095798A1 PCT/CN2021/127421 CN2021127421W WO2022095798A1 WO 2022095798 A1 WO2022095798 A1 WO 2022095798A1 CN 2021127421 W CN2021127421 W CN 2021127421W WO 2022095798 A1 WO2022095798 A1 WO 2022095798A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- copy
- product
- attribute data
- data
- candidate
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 238000012216 screening Methods 0.000 claims abstract description 24
- 238000004590 computer program Methods 0.000 claims abstract description 22
- 238000012549 training Methods 0.000 claims description 37
- 230000015654 memory Effects 0.000 claims description 17
- 230000009977 dual effect Effects 0.000 claims description 9
- 239000000047 product Substances 0.000 description 189
- 238000010586 diagram Methods 0.000 description 16
- 239000013598 vector Substances 0.000 description 16
- 238000012545 processing Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 11
- 230000011218 segmentation Effects 0.000 description 10
- 239000006227 byproduct Substances 0.000 description 8
- 238000013461 design Methods 0.000 description 7
- 238000001914 filtration Methods 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 4
- 239000000463 material Substances 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000001788 irregular Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 229920000728 polyester Polymers 0.000 description 3
- 230000000717 retained effect Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 239000003607 modifier Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 108091026890 Coding region Proteins 0.000 description 1
- 238000007476 Maximum Likelihood Methods 0.000 description 1
- 208000003028 Stuttering Diseases 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000009966 trimming Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/216—Parsing using statistical methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/42—Data-driven translation
- G06F40/44—Statistical methods, e.g. probability models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/55—Rule-based translation
- G06F40/56—Natural language generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0623—Item investigation
- G06Q30/0625—Directed, with specific intent or strategy
- G06Q30/0627—Directed, with specific intent or strategy using item specifications
Definitions
- the present disclosure is based on a Chinese patent application with an application number of 202011219419.8 and an application date of November 04, 2020.
- the applicant is Beijing Wodong Tianjun Information Technology Co., Ltd., and the application name is "A copywriting generation method, device, electronic device and storage medium” and claim the priority of the Chinese patent application, the entire contents of which are incorporated into the present disclosure by reference.
- the present disclosure relates to the technical field of text description, and relates to, but is not limited to, a text generation method, apparatus, electronic device, computer storage medium and computer program product.
- the present disclosure provides a copy generation method, apparatus, electronic device, and computer storage medium.
- An embodiment of the present disclosure provides a method for generating a copy, the method comprising:
- the first key attribute data represents part of the attribute data in the first attribute data
- a first candidate copy set of the product is obtained; the first candidate copy set represents a set of at least one product copy;
- the candidate copy data is screened according to the quality determination rule to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- the obtaining the first candidate copy set of the product according to the first key attribute data includes:
- a text description for the first key attribute data is generated sentence by sentence; each first key attribute data corresponds to at least one sentence text description;
- a first candidate copy set for the product is obtained.
- the obtaining a first candidate copy set of the product based on the at least one product copy includes:
- the repetition degree represents the repetition degree between different copy descriptions in each commodity copy
- the consistency represents the The degree of consistency between the attribute data of each commodity copy and the first attribute data
- the first copy generation model is obtained by training the following steps:
- the first copywriting generation model is trained by using the training data, and the trained first copywriting generation model is obtained.
- the first copy generation model includes: a first decoder and a second decoder, the first decoder is configured to decode the second attribute data to obtain the second key attribute data ; the second decoder is used to generate a copy description corresponding to the second key attribute data.
- the training of the first copywriting generation model through the training data to obtain the trained first copywriting generation model includes:
- a dual attention mechanism is used to adjust the network parameters of the first decoder, and an overlay mechanism is used to adjust the network parameters of the second decoder to obtain the trained first copywriting generation model.
- the screening of the candidate copy data according to the quality determination rule includes:
- the at least two copywriting generating models include the first copywriting model.
- the candidate copy data is screened according to the quality determination rule; the candidate copy data includes the commodity copy in the second candidate copy set.
- the quality determination rule includes at least one of the following:
- the repetition degree represents the degree of repetition between different copy descriptions in each product copy
- the consistency represents the degree of consistency between the attribute data of each product copy and the first attribute data
- the quality of the product copy is screened based on the attribute coverage; the attribute coverage represents the coverage degree of the first attribute data in each product copy.
- An embodiment of the present disclosure further proposes a copy generation device, the device includes an acquisition module, a first determination module, a second determination module, and a screening module, wherein,
- an obtaining module configured to obtain the first attribute data of the product
- a first determination module configured to determine the first key attribute data of the commodity based on the pre-trained first copywriting generation model; the first key attribute data represents part of the attribute data in the first attribute data;
- a second determining module configured to obtain a first candidate copy set of the product according to the first key attribute data; the first candidate copy set represents a set of at least one product copy;
- the screening module is configured to screen the candidate copy data according to the quality determination rule to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- An embodiment of the present disclosure provides an electronic device, the device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements one or more of the foregoing techniques when executing the program The copy generation method provided by the program.
- An embodiment of the present disclosure provides a computer storage medium, where a computer program is stored in the computer storage medium; after the computer program is executed, the method for generating a copy provided by one or more of the foregoing technical solutions can be implemented.
- Embodiments of the present disclosure also provide a computer program product, including computer-readable code, when the computer-readable code is executed in an electronic device, the processor in the electronic device executes the code for implementing one or more of the foregoing The copywriting generation method provided by the technical solution.
- Embodiments of the present disclosure provide a copy generation method, apparatus, electronic device, computer storage medium, and computer program product.
- the method includes: the method includes: acquiring first attribute data of a commodity; generating a model based on a pre-trained first copy , determine the first key attribute data of the product; the first key attribute data represents part of the attribute data in the first attribute data; according to the first key attribute data, obtain the first candidate copy set of the product;
- the first candidate copy set represents a set of at least one commodity copy; the candidate copy data is screened according to a quality determination rule to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- the product copy can be automatically generated directly based on the product attribute data and the pre-trained first copy generation model, which can improve the copy generation efficiency; further, the generated product copy is processed according to the quality judgment rules. Screening can ensure the quality of the product copy and the fit with the product.
- FIG. 1 is a schematic flowchart of a method for generating a copy in an embodiment of the present disclosure
- FIG. 2 is a schematic diagram of a result of outputting a copy by using a first copy generation model in an embodiment of the present disclosure
- FIG. 3 is a schematic structural diagram of a copywriting generation framework according to an embodiment of the present disclosure.
- FIG. 4 is a schematic structural diagram of a first copywriting generation model according to an embodiment of the present disclosure.
- FIG. 5a is a schematic diagram of the composition and structure of a copywriting generating apparatus according to an embodiment of the disclosure
- FIG. 5b is a schematic diagram of the composition and structure of another copywriting generating apparatus according to an embodiment of the disclosure.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
- the terms “comprising”, “comprising” or any other variations thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements not only includes the explicitly stated elements, but also other elements not expressly listed or inherent to the practice of the method or apparatus.
- an element defined by the phrase “comprises a" does not preclude the presence of additional related elements (eg, steps in a method or a device) in which the element is included.
- a unit in an apparatus for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
- the text generation method provided by the embodiment of the present disclosure includes a series of steps, but the text generation method provided by the embodiment of the present disclosure is not limited to the described steps.
- the text generation device provided by the embodiment of the present disclosure includes a A series of modules, but the copywriting generation device provided by the embodiments of the present disclosure is not limited to including the explicitly described modules, and may also include modules that need to be set to obtain relevant time series data or perform processing based on the time series data.
- Embodiments of the present disclosure can be applied to computer systems composed of terminal devices and servers, and can operate with numerous other general-purpose or special-purpose computing system environments or configurations.
- the terminal devices may be thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, etc.
- the server may be a server Computer Systems Small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above, etc.
- Electronic devices such as terminal devices, servers, etc., may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system.
- program modules may include routines, programs, object programs, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types.
- Computer systems/servers may be implemented in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
- program modules may be located on local or remote computing system storage media including storage devices.
- the copy generation method may be implemented by using a processor in the copy generation device, and the above-mentioned processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (Digital Signal Processor, DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit) , CPU), at least one of a controller, a microcontroller, and a microprocessor.
- ASIC Application Specific Integrated Circuit
- DSP Digital Signal Processor
- DSPD Digital Signal Processing Device
- PLD Programmable Logic Device
- Field Programmable Gate Array Field Programmable Gate Array
- FPGA Field Programmable Gate Array
- CPU Central Processing Unit
- CPU Central Processing Unit
- FIG. 1 is a schematic flowchart of a method for generating a copy in an embodiment of the present disclosure. As shown in FIG. 1 , the method includes the following steps:
- Step 100 Acquire the first attribute data of the commodity.
- the commodity may represent any type of item traded by an e-commerce platform or a seller through the Internet; for example, it may be a clothing item, a food item, etc., or a virtual item, etc.
- the embodiment of the present disclosure does not limit the type of the item .
- the first attribute data may include attribute words and attributes of the product; the attribute words may refer to words or phrases that describe the characteristics of the product, and the attributes represent attributes that correspond to the attribute word and can be distinguished from other attribute words.
- the data form of each attribute data in the first attribute data is attribute word
- the source of the first attribute data may include at least one of the following: commodity title, commodity category, commodity extension information.
- the first attribute data of the commodity may be acquired by performing a series of processing processes such as word segmentation and part-of-speech tagging on the source of the first attribute data.
- the above processing process can be implemented by a sequence labeling model; the implementation process can be as follows: first, perform word segmentation on the input commodity title, commodity category or commodity extension information to obtain each word sequence; according to the meaning and context of the word sequence
- the content is sequence-labeled for each word sequence; here, each word sequence corresponds to different attribute words, and the content of the sequence label corresponds to the attribute of each attribute word; further, through the sequence labeling model, the first attribute data of the product can be obtained.
- word segmentation is a process of recombining consecutive word sequences into word sequences according to certain specifications, and word segmentation processing can be implemented by word segmentation tools or word segmentation algorithms; here, it can be set according to actual application scenarios, and the present disclosure implements
- the example is not limited; for example, it can be a pkuseg word segmentation tool, a stammer word segmentation algorithm, and the like.
- part-of-speech tagging can be called grammar tagging or part-of-speech disambiguation
- part-of-speech tagging can be a text data processing technology that tags the part-of-speech of a word sequence obtained by word segmentation processing according to its meaning and context content; wherein, part-of-speech tagging processes This can be done manually or by a specific algorithm.
- a copy generation request for the product sent by the user is received, and the copy generation request may include the source of the first attribute data input by the user.
- the extended attribute data obtained from the product title, the product category, and the product extension information can be obtained respectively; and then the attribute data of the three different sources can be combined to obtain the product's attribute data.
- the commodity category is: clothing and underwear
- the title of the product is: XX brand original designer women's clothing summer wear new temperament medium-length Irregular halterneck dress skirt sleeveless one-shoulder white dress XL;
- the result of word segmentation and part-of-speech tagging on the product title is: XX
- Extended attribute data light mature woman
- the attribute data of the above three different sources can be combined to obtain the complete attribute data of the product.
- Attribute data retained after filtering by preset rules Apparel & Underwear
- the preset rules can filter part of the attribute data of the product; this is because the filtered part of the attribute data does not have an obvious effect on the generation of the subsequent product copy. By filtering this part of the attribute data, you can While ensuring the accuracy of the product copy, the generation efficiency of the product copy can be improved; here, the preset rules can be manually formulated based on the product characteristics.
- Step 101 Determine the first key attribute data of the product based on the pre-trained first copywriting generation model; the first key attribute data represents part of the attribute data in the first attribute data.
- the first copywriting generation model is pre-trained to obtain the trained first copywriting generation model; when the copywriting is generated, the acquired first attribute data of the product is used as the input of the first copywriting generation model data, the output of the first copywriting generation model is the copywriting corresponding to the product.
- the process of generating the copy by the first copy generation model mainly includes two stages of content selection and description generation; wherein, the result of the content selection is the first key attribute data determined from the first attribute data of the commodity;
- the first key attribute data represents the content to be mainly described in the final output copy;
- the result of description generation is to generate a corresponding copy description for the first key attribute data.
- the first attribute data of the product "XX
- a copywriting generation model determines that the first key attribute data of the product is "round neck
- the first copywriting generation model is trained through the following steps: acquiring historical copywriting and second attribute data of the product; matching the second attribute data with the historical copywriting to obtain second key attribute data; The copy, the second attribute data, and the second key attribute data are used as training data; the first copy generation model is trained through the training data, and the trained first copy generation model is obtained.
- the training process of the first copy generation model is: input the training data historical copy, the second attribute data and the second key attribute data into the model, and use the back-propagation algorithm to continuously adjust the network parameters of the model,
- the key attribute data determined by the model according to the second attribute data is exactly the same as the second key attribute data; and the product copy generated according to the second key attribute data is as consistent as possible with the historical copy.
- the historical copy may represent an existing related copy describing a commodity, which may be a manually written copy or a copy obtained from a product copy corpus; here, in order to improve the diversity of the product copy It is possible to obtain multiple historical texts of a commodity; and the sources of the multiple historical texts can be set according to actual application scenarios, which are not limited in the embodiments of the present disclosure.
- the second key attribute data of the commodity is obtained by matching the second attribute data with the historical copy, as the intermediate data for training the first copy generation model.
- the acquisition of the second attribute data of the commodity is the same as that of the acquisition of the first attribute data in step 100, which is not repeated here.
- the historical copy of the product is "the overall design is simple and fashionable, and the concise lines outline a good temperament, showing the characteristics of intellectual and capable temperament.
- the collar is an elegant round neck design, showing the simplicity in simplicity. Modern style.
- the waist is designed with stitching, showing a slender waist and modifying the beautiful figure.”
- the second key attribute data obtained by matching the second attribute data with the historical copy may be: temperament
- the first copywriting generation model includes: a first decoder and a second decoder, the first decoder is used to decode the second attribute data to obtain the second key attribute data; the second decoder is used to generate the first 2.
- the first copywriting generation model may be a seq2seq model, and the model may include: an encoder, a first decoder, and a second decoder; in the training process of the first copywriting generation model, the input data of the encoder is "attribute word"
- LSTM Long Short-Term Memory
- h j represents the hidden variable at the time j of the coding end
- h j-1 represents the hidden variable at the time j-1 of the coding end
- x j represents the input data
- h i-1 is the hidden state of the second attribute data at the previous moment.
- k i-1 is the second key attribute data at the current moment in the training phase, and the key attribute data decoded at the previous moment in the prediction phase.
- h i is the hidden state of the second key attribute data at the current moment
- c i is the attention context vector of the encoder at the current moment
- g is a transformation function.
- the first copywriting generation model adopts the method of joint training to complete the selection of the second key attribute data and the generation of the product copywriting at the same time.
- the objective function of the model adopts the maximum likelihood and considers the objectives of the two stages at the same time.
- the joint objective function is shown in formula (5):
- x, k, y respectively refer to the second attribute data of the product, the second key attribute data of the product and the product copy, the first item represents the target decoded by the first decoder, and the second item represents the second decoder to generate the copy.
- Target the second item
- the second attribute data, the second key attribute data and the historical copy are required in the training stage of the first copywriting generation model; the attribute data is input in the first copywriting generation model prediction stage, and the output is the prediction result.
- the first copywriting generation model prediction stage input attribute data, that is, attribute data retained after filtering: clothing and underwear
- attribute data retained after filtering clothing and underwear
- the first decoder decodes key attribute words: temperament
- the second decoder generates a copy, that is, predicts the result: the overall design is simple and stylish, and the concise lines outline a good temperament, showing the characteristics of intellectual and capable temperament.
- the collar is an elegant round neck design, showing a modern style in simplicity.
- the waist is designed with stitching, showing a slender waist and trimming a beautiful figure.
- training the first copy generation model through training data to obtain the trained first copy generation model includes: using a dual attention mechanism to adjust network parameters of the first decoder, and using an overlay mechanism to The network parameters of the second decoder are adjusted to obtain the trained first copywriting generation model.
- the dual attention mechanism and the coverage mechanism are used to optimize the network; wherein, the dual attention mechanism for the input data is "attribute word
- the dual attention mechanism in the decoding stage of the first decoder, is used to calculate the attention data for both the key vector and the value vector, and the attention data distribution used in the final decoding stage is the key vector and the value vector.
- J is the length of the encoding sequence
- i is the index of the current moment of the decoding sequence
- j is the index of the current moment of the encoding sequence.
- One of the problems of the copy generation model is that it is easy to generate repetitive descriptions, including literal repetition and semantic repetition.
- the reason for this problem is that the model repeatedly describes a certain input feature data.
- the use of the overlay mechanism can suppress the generation of repeated descriptions.
- the core idea is to track the described attribute words during the copy generation process, so that the first copy generation model no longer pays attention to the described attribute words; furthermore, reduce the repetition of the product copy. , to improve the quality of the copy.
- the specific method is to first maintain the attention context vector c i in the historical state, and use it as the feature input to calculate the attribute word attention data ⁇ ij (1) and attribute attention data ⁇ ij (2) at the current moment, as shown in the formula ( 8) shown:
- j' is the index of the coding sequence at different times
- the calculation formula of ⁇ ij (2) is the same as ⁇ ij (1)
- e ij is the hidden state hi that measures the second key attribute data at the current moment of the decoding end and the time j of the coding end
- c ij is the result of accumulating the attention context vectors of the encoder at different times.
- Step 102 Obtain a first candidate copy set of the product according to the first key attribute data; the first candidate copy set represents a set of at least one product copy.
- the first copywriting generation model may generate a copywriting description for the first key attribute data according to the first key attribute data; here, each key attribute data corresponds to the generated copywriting There can be one or more descriptions.
- the description of the copy generated by the first copy generation model can be “the collar is a round neck design”; it can also be “the collar of the dress” For an elegant crew neck design” etc.
- obtaining the first candidate copy set of the product according to the first key attribute data may include: generating a copy description for the first key attribute data sentence by sentence according to the first key attribute data;
- the attribute data corresponds to at least one sentence of text description; the text descriptions corresponding to each first key attribute data are spliced to generate at least one product text; based on the at least one product text, a first candidate text set of the product is obtained.
- each key attribute data can generate a corresponding copy description; therefore, in the case that the first key attribute data includes multiple attribute data, the first key attribute data can generate a variety of different Copy description.
- the first key attribute data can generate a variety of different Copy description.
- the first key attribute data includes: attribute M and attribute N; according to attribute M, copy description 1 and copy description 2 can be generated; according to attribute N, copy description 3 can be generated; After splicing, copy description 2 and copy description 3, two types of copy can be finally obtained, and these two types of copy can be used as the first candidate copy set.
- obtaining the first candidate copy set of the product based on at least one product copy may include: judging the repetition degree and/or consistency of each product copy to obtain a judgment result; the repetition degree represents each product The degree of repetition between different copy descriptions in the copy; the consistency indicates the degree of consistency between the attribute data of each product copy and the first attribute data; according to the judgment result, the first candidate copy set of the product is obtained.
- the repetition judgment is to use the literal repetition judgment and the semantic level judgment of the word vector for each commodity copy, that is, there are consecutive repeated words, words, clauses and semantically repeated clauses.
- Consistency judgment is to judge the attribute words to determine the degree of consistency between the attribute words of each commodity copy and each attribute word of the first attribute data; that is, whether the generated copy contains attribute words that do not exist in the input data;
- the attribute word can be obtained by matching the generated copy through the attribute vocabulary, and the attribute vocabulary can be obtained through corpus statistics.
- a hard rule method can be used to judge the degree of repetition between different textual descriptions in each commodity text, and obtain the judgment result. If the judgment result indicates that the If there are duplicate words, words, clauses or semantically duplicated clauses between the copy descriptions, the product copy will be deleted; that is, only the judgment result indicates that any different copy descriptions in the generated product copy are identical. Only if the above-mentioned repetitions do not exist, the product copy can be output.
- the degree of consistency between the attribute word of each commodity copy and each attribute word of the first attribute data is judged, and a judgment result is obtained; if the judgment result indicates that the generated commodity copy contains attribute words that do not exist in the input data , the product copy will be deleted; that is, the product copy can be output only if the judgment result indicates that the attribute words contained in the generated product copy all correspond to the attribute words in the input data.
- FIG. 2 is a schematic diagram of the result of outputting a copy by the first copy generation model in an embodiment of the present disclosure.
- the product attribute is the input data of the first copy generation model, and the product copy obtained by decoding and output does not increase the repetition.
- the generation result of the consistency judgment it can be seen that the "high waist” in the generated result is inconsistent with the input data of the first copy generation model, and there is a difference between "more comfortable to wear” and "to make your wearing more comfortable” repeat.
- Step 103 Screen the candidate copy data according to the quality determination rule to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- the commodity texts in the first candidate text set are screened based on the quality determination rule, and the final output target commodity text is determined.
- the quality determination rule includes at least one of the following: screening the quality of the product copy based on the degree of repetition; the repetition degree represents the degree of repetition between different copy descriptions in each product copy; screening the quality of the product copy based on consistency; Consistency indicates the degree of consistency between the attribute data of each product copy and the first attribute data; the quality of the product copy is screened based on the perplexity; the perplexity represents the clarity of the text description in each product copy; based on the attribute coverage Screen the quality of the product copy; the attribute coverage indicates the coverage degree of the first attribute data in each product copy.
- the commodity copy in the first candidate copy set may be filtered based on the repetition degree; the repetition degree includes literal repetition and semantic repetition, wherein the literal repetition can be determined by formulating rules to determine each Whether there are repetitions between different copy descriptions in the product copy, such as repetition of adjacent words, repetition of clauses, repetition of descriptions of attribute words, etc. Semantic repetition, by training the word2vec word vector, if similar words or similar clauses are found, it is judged that there is a repetition problem between the product texts.
- the commodity copy in the first candidate copy set may be filtered based on consistency; since ensuring the consistency of input data and output data is a basic requirement for the first copy generation model, except for model optimization and generation consistency In addition to the description in surface.
- the attribute vocabulary Based on the attribute vocabulary, it is detected whether the attribute words described in the text conflict with the attribute words of the input data. Among them, in the construction of the attribute vocabulary, the attribute vocabulary is constructed based on the training data. In the construction, the frequency of the attribute word in the copy and the frequency of the input attribute are considered. At the same time, the objective attributes, such as material attributes, are considered, and the more subjective ones are deleted. properties, such as style properties, etc.
- the commodity copy in the first candidate copy set may be sorted based on the degree of confusion; the description generated by the first copy model may not be smooth.
- the perplexity index measures the copy and sorts the copy. The copy with higher perplexity is generally less fluent. Based on the existing commodity copy data as the basic data, the probability under the binary model is calculated, and the perplexity index is calculated based on the statistical results. Calculate the perplexity of all candidate texts of the current product based on the perplexity index, and use this as a metric to sort the candidate texts in descending order of perplexity. Copywriting candidates.
- the product texts in the first candidate text set may be sorted based on the attribute coverage; the product attribute data obtained from multiple information sources such as titles, extended attributes, etc. are filtered, and the retained attribute data as input to the copy generation model.
- the goal of the generated product copy is to describe the input attributes in detail to attract the user's purchasing interest.
- the quality of the product copy can be judged according to the number of input attribute words included in the generated copy. The more input attribute words described, the higher the score of the product copy, and the better the copy quality.
- screening the candidate copy data according to the quality determination rule may include: after obtaining the first attribute data of the product, inputting the first attribute data into at least two copywriting generation models to obtain the second attribute data of the product A candidate copy set; at least two copy generation models include a first copy generation model; the candidate copy data is screened according to quality determination rules; the candidate copy data includes the commodity copy in the second candidate copy set.
- the copy corresponding to the product is jointly generated based on a variety of copy generation models, and the second candidate copy set of the product is obtained; then based on the above quality judgment rules Screen the product copy of the second candidate copy set, and output the product copy that meets the requirements; it can be seen that the accuracy and recall rate of product copy generation in this way can meet the actual needs of the industry.
- Embodiments of the present disclosure provide a copy generation method, apparatus, electronic device, computer storage medium, and computer program product.
- the method includes: the method includes: acquiring first attribute data of a commodity; generating a model based on a pre-trained first copy , determine the first key attribute data of the product; the first key attribute data represents part of the attribute data in the first attribute data; according to the first key attribute data, the first candidate copy set of the product is obtained; the first candidate copy set represents at least one A collection of product copy; the candidate copy data is screened according to the quality judgment rules to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- the product copy is generated based on the product attribute information and the pre-trained first copy generation model, which can improve the copy generation efficiency; further, the generated product copy is screened according to the quality judgment rules, It can ensure the quality of the product copy and the fit with the product.
- FIG. 3 is a schematic structural diagram of a copywriting generation framework according to an embodiment of the disclosure.
- the framework includes three modules: a product information filtering module, a copywriting generation module, and a copywriting selection module; wherein, the product information filtering module is configured from Multi-source commodity information such as commodity title, commodity category, commodity extension information, etc. to obtain commodity categories, brand names, product words, and several modifiers that can accurately reflect the characteristics of commodities, from these categories, brand names, product words and Attribute data is extracted from the modifier; the attribute data includes attribute words and attributes, and the acquired attribute data is filtered to extract commodity attribute information for copywriting generation, that is, the first attribute data.
- the product information filtering module is configured from Multi-source commodity information such as commodity title, commodity category, commodity extension information, etc. to obtain commodity categories, brand names, product words, and several modifiers that can accurately reflect the characteristics of commodities, from these categories, brand names, product words and Attribute data is extracted from the modifier; the attribute data includes attribute words and attributes, and the acquired attribute
- the copywriting generation module is configured to extract and filter the first attribute data output by the product information filtering module based on the first copywriting generation model to determine the first key attribute data of the product; wherein, the double attention mechanism and the coverage mechanism are used for the first attribute data.
- beam search is used in the prediction phase of the first copy generation model of the model.
- the first copy generation model is used to generate several candidate copies, and the repetition and/or consistency of each candidate copy is judged; the repetition degree represents the degree of repetition between different copy descriptions in each product copy; the consistency represents each product The degree of consistency between the attribute data of the copy and the first attribute data; according to the judgment result, each candidate copy after optimization is obtained, that is, the first candidate copy set.
- the text selection module is configured to filter the product texts in the first candidate text set based on repetition and consistency, filter out problematic product texts, and sort the product texts in the first candidate text set based on the degree of confusion and attribute coverage , and retain several commodity texts with high confidence and high coverage as the final output, that is, the target commodity texts.
- FIG. 4 is a schematic structural diagram of a first copywriting generation model according to an embodiment of the present disclosure.
- the processing flow of using the first copywriting generation model for prediction is: attribute”, for example, “V-collar
- attribute for example, “V-collar
- Fig. 5a is a schematic structural diagram of a copywriting generation device according to an embodiment of the present disclosure. As shown in Fig. 5a, the device includes: an acquisition module 500, a first determination module 501, a second determination module 502, and a screening module 503, wherein:
- the obtaining module 500 is configured to obtain the first attribute data of the commodity
- the first determination module 501 is configured to determine the first key attribute data of the product based on the pre-trained first copywriting generation model; the first key attribute data represents part of the attribute data in the first attribute data;
- the second determination module 502 is configured to obtain a first candidate copy set of the product according to the first key attribute data; the first candidate copy set represents a set of at least one product copy;
- the screening module 503 is configured to screen the candidate copy data according to the quality determination rule to determine the target product copy; the candidate copy data includes the product copy in the first candidate copy set.
- the second determination module 502 is configured to obtain the first candidate copy set of the product according to the first key attribute data, including:
- a text description for the first key attribute data is generated sentence by sentence; each first key attribute data corresponds to at least one sentence text description;
- a first candidate copy set for the product is obtained.
- the second determination module 502 is configured to obtain a first candidate copy set of the product based on at least one product copy, including:
- the repetition and/or consistency of each product copy is judged to obtain the judgment result;
- the repetition degree indicates the repetition degree between different copy descriptions in each product copy;
- the consistency means that the attribute data of each product copy is the same as the first one.
- the first candidate copy set of the product is obtained.
- FIG. 5b is a schematic diagram of the composition and structure of another copywriting generating apparatus according to an embodiment of the disclosure. As shown in FIG. 5b, the apparatus further includes a training module 504.
- the training module 504 is configured as follows:
- the first copywriting generation model is trained through the training data, and the trained first copywriting generation model is obtained.
- the first copywriting generation model includes: a first decoder and a second decoder, the first decoder is used to decode the second attribute data to obtain the second key attribute data; the second decoder is used to generate the first 2.
- the training module 504 is configured to train the first copywriting generation model through the training data to obtain the trained first copywriting generation model, including:
- the network parameters of the first decoder are adjusted using a dual attention mechanism, and the network parameters of the second decoder are adjusted using an overlay mechanism to obtain a trained first copywriting generation model.
- the screening module 503 is configured to screen the candidate copy data according to the quality determination rule, including:
- the at least two copywriting generating models include the first copywriting generation model
- the candidate copy data is screened according to the quality determination rule; the candidate copy data includes the commodity copy in the second candidate copy set.
- the quality determination rule includes at least one of the following:
- the degree of repetition indicates the degree of repetition between different copy descriptions in each product copy
- consistency represents the degree of consistency between the attribute data of each product copy and the first attribute data
- the quality of the product copy is screened based on the attribute coverage; the attribute coverage represents the coverage degree of the first attribute data in each product copy.
- the acquisition module 500 , the first determination module 501 , the second determination module 502 , the screening module 503 and the training module 504 can all be implemented by a processor located in the electronic device, and the processor can be an ASIC, DSP, At least one of DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
- each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
- the integrated unit is implemented in the form of software function modules and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the technical solution of this embodiment is essentially or correct. Part of the contribution made by the related art or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal computer). , server, or network device, etc.) or processor (processor) executes all or part of the steps of the method in this embodiment.
- the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
- the computer program instructions corresponding to a copy generation method in this embodiment may be stored on a storage medium such as an optical disc, a hard disk, a U disk, etc.
- a storage medium such as an optical disc, a hard disk, a U disk, etc.
- FIG. 6 shows an electronic device 600 provided by the present disclosure, which may include: a memory 601 and a processor 602; wherein,
- memory 601 configured to store computer programs and data
- the processor 602 is configured to execute the computer program stored in the memory, so as to implement any one of the copywriting generation methods in the foregoing embodiments.
- the above-mentioned memory 601 can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk) Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and provide instructions and data to the processor 602.
- volatile memory such as RAM
- non-volatile memory non-volatile memory
- ROM read-only memory
- flash memory flash memory
- HDD hard disk
- SSD solid-state drive
- the above-mentioned processor 602 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different text generation devices, the electronic device used to implement the above processor function may also be other, which is not specifically limited in the embodiment of the present disclosure.
- the functions or modules included in the apparatuses provided in the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments.
- embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- Probability & Statistics with Applications (AREA)
- Accounting & Taxation (AREA)
- Data Mining & Analysis (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种文案生成方法、装置、电子设备、计算机存储介质和计算机程序产品,该方法包括:获取商品的第一属性数据(100);基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据(101);根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合(102);按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案(103)。
Description
相关申请的交叉引用
本公开基于申请号为202011219419.8、申请日为2020年11月04日的中国专利申请提出,申请人为北京沃东天骏信息技术有限公司,申请名称为“一种文案生成方法、装置、电子设备和存储介质”的技术方案,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
本公开涉及文案描述技术领域,涉及但不限于一种文案生成方法、装置、电子设备、计算机存储介质和计算机程序产品。
伴随着移动互联网的发展,电子商务行业得到了迅猛发展。越来越多的用户习惯在网络上购物,由于移动互联网的普及,用户用于网上浏览商品的时间在不断增加,为了能够吸引用户,对于电商的内容化提出了更高的要求。电商平台以及卖家为了吸引用户,除了商品标题外,还会为商品提供长文案描述,对商品的卖点进行描述,让用户能够快速深入的了解商品的特性。高质量的商品描述是提升客户体验的关键,准确和有吸引力的描述不仅能够帮助客户做出正式的决定而且能提升购买的可能性。
相关技术中,要写出高质量的文案,对于撰写文案的人员就有比较高的要求,不仅所需成本较高,而且由人工撰写文案的效率较低,不能快速覆盖大量商品;此外,对已生成的商品长文案缺乏准确的度量方式,很难确保商品长文案的质量以及与商品之间的契合度。
发明内容
本公开提供一种文案生成方法、装置、电子设备和计算机存储介质。
本公开的技术方案是这样实现的:
本公开实施例提供了一种文案生成方法,所述方法包括:
获取商品的第一属性数据;
基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据;
根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合;
按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案。
在一些实施例中,所述根据所述第一关键属性数据,得到所述商品的第一候选文案集,包括:
根据所述第一关键属性数据,逐句生成针对所述第一关键属性数据的文案描述;所述每个第一关键属性数据对应至少一句文案描述;
将所述每个第一关键属性数据对应的文案描述进行拼接,生成至少一个商品文案;
基于所述至少一个商品文案,得到所述商品的第一候选文案集。
在一些实施例中,所述基于所述至少一个商品文案,得到所述商品的第一候选文案集,包括:
对所述每个商品文案的重复度和/或一致性进行判断,得到判断结果;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;
根据所述判断结果,得到所述商品的第一候选文案集。
在一些实施例中,所述第一文案生成模型是通过以下步骤训练得到的:
获取商品的历史文案以及第二属性数据;
将所述第二属性数据与所述历史文案进行匹配,得到第二关键属性数据;
将所述历史文案、所述第二属性数据以及所述第二关键属性数据作为训练数据;
通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型。
在一些实施例中,所述第一文案生成模型包括:第一解码器和第二解码器,所述第一解码器用于对所述第二属性数据进行解码,得到所述第二关键属性数据;所述第二解码器用于生成所述第二关键属性数据对应的文案描述。
在一些实施例中,所述通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型,包括:
使用双注意力机制对所述第一解码器的网络参数进行调整,并使用覆盖机制对所述第二解码器的网络参数进行调整,得到训练完成的所述第一文案生成模型。
在一些实施例中,所述按照质量判定规则对所述候选文案数据进行筛选,包括:
在获取商品的第一属性数据后,将所述第一属性数据输入到至少两种文案生成模型中,得到所述商品的第二候选文案集;所述至少两种文案生成模型包括所述第一文案生成模型;
按照质量判定规则对所述候选文案数据进行筛选;所述候选文案数据包括所述第二候选文案集中的商品文案。
在一些实施例中,所述质量判定规则包括以下至少之一:
基于重复度对所述商品文案的质量进行筛选;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;
基于一致性对所述商品文案的质量进行筛选;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;
基于困惑度对所述商品文案的质量进行筛选;所述困惑度表示所述每个商品文案中文案描述的清晰程度;
基于属性覆盖度对所述商品文案的质量进行筛选;所述属性覆盖度表示所述第一属性数据在每个商品文案中的覆盖程度。
本公开实施例还提出了一种文案生成装置,所述装置包括获取模块、第一确定模块、第二确定模块和筛选模块,其中,
获取模块,配置为获取商品的第一属性数据;
第一确定模块,配置为基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据;
第二确定模块,配置为根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合;
筛选模块,配置为按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案。
本公开实施例提供一种电子设备,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前述一个或多个技术方案提供的文案生成方法。
本公开实施例提供一种计算机存储介质,所述计算机存储介质存储有计算机程序;所述计算机程序被执行后能够实现前述一个或多个技术方案提供的文案生成方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现前述一个或多个 技术方案提供的文案生成方法。
本公开实施例提出了一种文案生成方法、装置、电子设备、计算机存储介质和计算机程序产品,该方法包括:该方法包括:获取商品的第一属性数据;基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据;根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合;按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案。如此,无需由人工撰写商品文案,而是直接基于商品属性数据和预先训练的第一文案生成模型自动生成商品文案,能够提高文案生成效率;进一步地,按照质量判定规则对已生成的商品文案进行筛选,可以确保商品文案的质量以及与商品之间的契合度。
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1是本公开实施例中的一种文案生成方法的流程示意图;
图2为本公开实施例中通过第一文案生成模型进行文案输出的结果示意图;
图3为本公开实施例的文案生成框架的结构示意图;
图4为本公开实施例的第一文案生成模型的结构示意图;
图5a为本公开实施例的一种文案生成装置的组成结构示意图;
图5b为本公开实施例的另一种文案生成装置的组成结构示意图;
图6为本公开实施例的电子设备的结构示意图。
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
以下结合附图及实施例,对本公开进行进一步详细说明。应当理解,此处所提供的实施例仅仅用以解释本公开,并不用于限定本公开。另外,以下所提供的实施例是用于实施本公开的部分实施例,而非提供实施本公开的全部实施例,在不冲突的情况下,本公开实施例记载的技术方案可以任意组合的方式实施。
需要说明的是,在本公开实施例中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的方法或者装置不仅包括所明确记载的要素,而且还包括没有明确列出的其它要素,或者是还包括为实施方法或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的方法或者装置中还存在另外的相关要素(例如方法中的步骤或者装置中的单元,例如的单元可以是部分电路、部分处理器、部分程序或软件等等)。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,I和/或J,可以表示:单独存在I,同时存在I和J,单独存在J这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括I、J、R中的至少一种,可以表示包括从I、J和R构成的集合中选择的任意一个或多个元素。
例如,本公开实施例提供的文案生成方法包含了一系列的步骤,但是本公开实施例提供的文案生成方法不限于所记载的步骤,同样地,本公开实施例提供的文案生成设备包括了一系列模块,但是本公开实施例提供的文案生成设备不限于包括所明确记载的模块,还可以包括为获取相关时序数据、或基于时序数据进行处理时所需要设置的模块。
本公开实施例可以应用于终端设备和服务器组成的计算机系统中,并可以与众多其它通用或专用计算系统环境或配置一起操作。这里,终端设备可以是瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统,等等,服务器可以是服务器计算机系统小型计算机系统﹑大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。
终端设备、服务器等电子设备可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。
针对上述技术问题,提出以下各实施例。
在本公开的一些实施例中,文案生成方法可以利用文案生成装置中的处理器实现,上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。
图1是本公开实施例中的一种文案生成方法的流程示意图,如图1所示,该方法包括如下步骤:
步骤100:获取商品的第一属性数据。
这里,商品可以表示电商平台或卖家通过互联网进行交易的任意类型的物品;例如,可以是服饰类物品、食品类物品等,还可以是虚拟物品等;本公开实施例对物品的类型不作限制。
本公开实施例中,第一属性数据可以包括商品的属性词和属性;属性词可以指描述商品特征的词语或词组,属性表示与该属性词对应的、且能够与其他属性词的属性形成区分的词;其中,第一属性数据中每个属性数据的数据形式为属性词|属性;例如,一字肩|领型、无袖|袖长、圆领|领型、拼接|流行元素。
在一些实施例中,第一属性数据的来源可以包括以下至少之一:商品标题、商品类目、商品扩展信息。
在一种实施方式中,可以通过对第一属性数据的来源进行分词和词性标注等一系列处理过程,获取到商品的第一属性数据。其中,上述处理过程可以通过序列标注模型进行实现;其实现的过程可以为:首先对输入的商品标题、商品类目或商品扩展信息进行分词处理,得到各个词序列;根据词序列的含义以及上下文内容对各个词序列进行序列标注;这里,各个词序列对应不同的属性词,序列标注的内容对应各个属性词的属性;进而,通过序列标注模型,可以获取到商品的第一属性数据。
在一些实施例中,分词是将连续的字序列按照一定的规范重新组合成词序列的过程,分词处理可以通过分词工具或分词算法进行实现;这里,可以根据实际应用场景进行设置,本公开实施例不作限制;例如,可以是pkuseg分词工具、结巴分词算法等。
在一些实施例中,词性标注可以被称为语法标注或词类消疑,词性标注可以将分词处理得到的词序列的词性按其含义和上下文内容进行标记的文本数据处理技术;其中,词性标注处理可以由人工或特定算法进行实现。
在一种实施方式中,在获取商品的第一属性数据之前,接收用户发送的针对商品的文案生成请求,该文案生成请求中可以包括用户输入的第一属性数据的来源。
在一种实施方式中,可以根据第一属性数据的来源,分别从商品标题、商品类目以 及商品扩展信息中获取的扩展属性数据;再将三种不同来源的属性数据进行合并,得到商品的完整属性数据;根据预设规则对属性数据进行过滤处理,得到符合要求的属性数据,即,商品的第一属性数据。
在一种实施方式中,假设商品类目为:服饰内衣|一级类目、女装|二级类目、连衣裙|三级类目;商品标题为:XX品牌原创设计师女装夏装新款气质中长款不规则挂脖礼服裙子无袖一字肩白色连衣裙XL;对商品标题进行分词和词性标注的结果为:XX|品牌词、原创|风格属性、女装|副产品词、夏装|副产品词、新款|风格属性、气质|风格属性、中长款|样式属性、不规则|样式属性、挂脖|样式属性、礼服|副产品词、裙子|产品词、无袖|样式属性、一字肩|样式属性、白色|颜色属性、连衣裙|产品词、XL|尺码属性。
扩展属性数据:轻熟女|适用人群、涤纶|材质、街拍|风格、25-29周岁|适用年龄、2019年夏季|上市时间、中裙|裙长、拼接|流行元素、高腰|腰型;可以将上述三种不同来源的属性数据进行合并,得到商品的完整属性数据。
通过预设规则过滤后保留的属性数据:服饰内衣|一级类目、女装|二级类目、连衣裙|三级类目、一字肩|样式属性、轻熟女|适用人群、涤纶|材质、街拍|风格、中裙|裙长、拼接|流行元素、高腰|腰型、XX|品牌词、原创|风格属性、夏装|副产品词、气质|风格属性、中长款|样式属性、不规则|样式属性、挂脖|样式属性、礼服|副产品词、裙子|产品词、白色|颜色属性、连衣裙|产品词、圆领|领型。
在一种实施方式中,预设规则可以对商品的部分属性数据进行过滤;这是因为过滤的这部分属性数据对后续商品文案的生成作用不明显,通过进行这部分属性数据的过滤,可以在确保商品文案的准确性的同时提高商品文案的生成效率;这里,预设规则可以由人工基于商品特征制定。
步骤101:基于预先训练的第一文案生成模型,确定商品的第一关键属性数据;第一关键属性数据表示第一属性数据中的部分属性数据。
本公开实施例中,预先对第一文案生成模型进行训练,得到训练完成的第一文案生成模型;在进行文案生成时,将获取到的商品的第一属性数据作为第一文案生成模型的输入数据,第一文案生成模型的输出为商品对应的文案。
本公开实施例中,第一文案生成模型进行文案生成的过程主要包括内容选择和描述生成这两个阶段;其中,内容选择的结果是从商品的第一属性数据确定的第一关键属性数据;第一关键属性数据表示最终输出的文案中要重点描述的内容;描述生成的结果是针对第一关键属性数据生成对应的文案描述。
在一种实施方式中,将商品的第一属性数据“XX|品牌、女装|副产品词、夏装|副产品词、连衣裙|产品词、圆领|领型”输入到第一文案生成模型,如果第一文案生成模型确定商品的第一关键属性数据为“圆领|领型”;第一文案生成模型的输出可以为“衣领为典雅的圆领设计”。
在一些实施例中,第一文案生成模型是通过以下步骤训练得到的:获取商品的历史文案以及第二属性数据;将第二属性数据与历史文案进行匹配,得到第二关键属性数据;将历史文案、第二属性数据以及第二关键属性数据作为训练数据;通过训练数据训练第一文案生成模型,得到训练完成的第一文案生成模型。
在一种实施方式中,第一文案生成模型的训练过程为:将训练数据历史文案、第二属性数据以及第二关键属性数据输入到模型中,利用反向传播算法不断调整模型的网络参数,使得模型根据第二属性数据确定的关键属性数据与第二关键属性数据完全相同;并且根据第二关键属性数据生成的商品文案与历史文案尽可能一致。
在一种实施方式中,历史文案可以表示现有的针对商品进行描述的相关文案,其可以是人工撰写的文案,也可以是从商品文案语料中获取的文案;这里,为了提高商品文案的多样性,可以获取商品的多个历史文案;而多个历史文案的来源可以根据实际应用场景进行设置,本公开实施例不作限制。
本公开实施例中,通过第二属性数据与历史文案的匹配获取商品的第二关键属性数据,作为第一文案生成模型训练的中间数据。其中,商品的第二属性数据的获取与步骤100中第一属性数据的获取方式相同,这里不再累赘。
在一种实施方式中,假设商品的历史文案为“整体的设计为简约风尚,简明的线条勾勒不俗气质,显出知性干练的气质特点。衣领为典雅的圆领设计,简约中显出摩登风。腰部采用拼接设计而成,显出纤细腰肢,修饰美好身材线条”。通过第二属性数据与该历史文案的匹配获取的第二关键属性数据可以为:气质|风格属性、圆领|领型、拼接|流行元素。
在一些实施例中,第一文案生成模型包括:第一解码器和第二解码器,第一解码器用于对第二属性数据进行解码,得到第二关键属性数据;第二解码器用于生成第二关键属性数据对应的文案描述。
这里,第一文案生成模型可以为seq2seq模型,该模型可以包括:编码器、第一解码器和第二解码器;在第一文案生成模型的训练过程中,编码器的输入数据为“属性词|属性”对,对应商品的第二属性数据;采用长短期记忆网络(Long Short-Term Memory, LSTM)作为编码器,对输入数据进行编码,得到隐变量,如公式(1)所示:
h
j=LSTM(h
j-1,x
j) (1)
公式(1)中,h
j表示编码端j时刻的隐变量,h
j-1表示编码端j-1时刻的隐变量,x
j表示输入数据。
使用第一解码器对商品的第二属性数据进行解码,确定出商品的关键属性数据是否与第二关键属性数据对应;对商品的关键属性数据k
i进行解码的过程如公式(2)、(3)、(4)所示:
h
i=LSTM(h
i-1,k
i-1) (2)
其中,h
i-1是前一时刻第二属性数据的隐状态。k
i-1在训练阶段是当前时刻的第二关键属性数据,在预测阶段是前一时刻解码出的关键属性数据。h
i是当前时刻第二关键属性数据的隐状态,c
i是当前时刻编码端的注意力上下文向量,
是当前时刻生成的注意力数据的隐状态,g是一种变换函数。
接着,使用第二解码器解码生成与关键属性数据k
i对应的商品文案y。
在一种实施方式中,第一文案生成模型采用联合训练的方式,同时完成第二关键属性数据的选择和商品文案的生成,该模型的目标函数采用最大似然同时考虑了两个阶段的目标,联合目标函数如公式(5)所示:
max∑
Dlog(k|x)+logp(y|x,k) (5)
其中,x,k,y分别指商品的第二属性数据、商品的第二关键属性数据和商品文案,第一项表示第一解码器解码的目标,第二项表示第二解码器生成文案的目标。
可以看出,在第一文案生成模型训练阶段需要第二属性数据、第二关键属性数据和历史文案;第一文案生成模型预测阶段输入属性数据,输出是预测结果。
在一种实施方式中,第一文案生成模型预测阶段:输入属性数据,即过滤后保留的属性数据:服饰内衣|一级类目、女装|二级类目、连衣裙|三级类目、一字肩|样式属性、轻熟女|适用人群、涤纶|材质、街拍|风格、中裙|裙长、拼接|流行元素、高腰|腰型、XX|品牌词、原创|风格属性、夏装|副产品词、气质|风格属性、中长款|样式属性、不规则| 样式属性、挂脖|样式属性、礼服|副产品词、裙子|产品词、白色|颜色属性、连衣裙|产品词、圆领|领型。
第一解码器解码出关键属性词:气质|风格属性、圆领|领型、拼接|流行元素。
第二解码器生成文案,即,预测结果:整体的设计为简约风尚,简明的线条勾勒不俗气质,显出知性干练的气质特点。衣领为典雅的圆领设计,简约中显出摩登风。腰部采用拼接设计而成,显出纤细腰肢,修饰美好身材线条。
在一些实施例中,通过训练数据训练第一文案生成模型,得到训练完成的第一文案生成模型,包括:使用双注意力机制对第一解码器的网络参数进行调整,并使用覆盖机制对第二解码器的网络参数进行调整,得到训练完成的第一文案生成模型。
本公开实施例中,在对第一文案生成模型训练的过程中,使用双注意力机制和覆盖机制进行网络优化;其中,双注意力机制针对输入数据是“属性词|属性”对这种“键向量|值向量”对的形式,在第一解码器的解码阶段采用双注意力机制分别对键向量和值向量均计算注意力数据,最终解码阶段采用的注意力数据分布是键向量和值向量各自注意力数据融合的结果;由于该方式可以同时利用键向量和值向量两部分的特征,能够提升第一文案生成模型规划的能力,提升文案的可靠性。如果将属性词注意力数据标记为α
ij(1),属性注意力数据标记为α
ij(2),则将属性词注意力数据和属性注意力数据融合后的注意力数据α
ij如公式(6)所示:
其中,J编码序列的长度,i是解码序列当前时刻的索引,j是编码序列当前时刻的索引。
在当前时刻编码端的注意力上下文向量c
i如公式(7)所示:
由于文案生成模型的一个问题是容易生成重复性描述,包括字面上的重复和语意上的重复,出现这种问题的原因是模型对某一个输入特征数据进行重复描述。而使用覆盖机制能够抑制重复描述生成,核心思想为:在文案生成过程中跟踪已经描述的属性词,让第一文案生成模型不再关注已经描述过的属性词;进而,降低商品文案的重复性,提升文案的质量。
具体做法是,首先维护在历史状态下注意力上下文向量c
i,将其作为特征输入计算当前时刻的属性词注意力数据α
ij(1)和属性注意力数据α
ij(2),如公式(8)所示:
其中,j’是编码序列不同时刻的索引,α
ij(2)的计算公式同α
ij(1),e
ij是衡量解码端当前时刻第二关键属性数据的隐状态h
i和编码端j时刻的隐变量h
j的关系所计算的权重。
对于重复出现过高权重的词,在loss函数中给予适当惩罚,如公式(9)所示:
covloss
j=∑
imin(α
ij,c
ij) (9)
其中,c
ij是将不同时刻编码端的注意力上下文向量累加后的结果。
步骤102:根据第一关键属性数据,得到商品的第一候选文案集;第一候选文案集表示至少一个商品文案的集合。
本公开实施例中,在得到第一关键属性数据后,第一文案生成模型可以根据第一关键属性数据,生成针对第一关键属性数据的文案描述;这里,每个关键属性数据对应生成的文案描述可以是一个,也可以多个。
在一种实施方式中,对于第一关键属性数据“圆领|领型”,第一文案生成模型对应生成的文案描述可以为“衣领为圆领设计”;也可以为“连衣裙的衣领为典雅的圆领设计”等。
在一些实施例中,根据第一关键属性数据,得到商品的第一候选文案集,可以包括:根据第一关键属性数据,逐句生成针对第一关键属性数据的文案描述;每个第一关键属性数据对应至少一句文案描述;将每个第一关键属性数据对应的文案描述进行拼接,生成至少一个商品文案;基于至少一个商品文案,得到商品的第一候选文案集。
在一种实施方式中,由于每个关键属性数据均可以生成对应的文案描述;因而,在第一关键属性数据包括多个属性数据的情况下,第一关键属性数据对应可以生成多种不同的文案描述。将多种不同的文案描述进行拼接,可以得到多种商品文案,进而,得到商品的第一候选文案集。
在一种实施方式中,假设第一关键属性数据包括:属性M和属性N;根据属性M可以生成文案描述1和文案描述2;根据属性N生成文案描述3;将描述1和文案描述3进行拼接、文案描述2和文案描述3进行拼接,则最终可以得到两种文案,将这两种文案作为第一候选文案集。
在一些实施例中,基于至少一个商品文案,得到商品的第一候选文案集,可以包括: 对每个商品文案的重复度和/或一致性进行判断,得到判断结果;重复度表示每个商品文案中不同文案描述之间的重复程度;一致性表示每个商品文案的属性数据与第一属性数据之间的一致程度;根据判断结果,得到商品的第一候选文案集。
本公开实施例中,在对不同关键属性数据的文案描述进行拼接后,还可以对拼接后的各个商品文案的重复度和/或一致性进行判断;该过程主要在第一文案生成模型的束搜索阶段进行实现。
其中,重复度判断是对每个商品文案采用字面重复判断以及词向量的语意级别判断,即指有连续重复的字、词、子句以及语意上重复的子句。一致性判断是针对属性词做判断,判断每个商品文案的属性词与第一属性数据每个属性词之间的一致程度;即,生成的文案中是否包含输入数据中不存在的属性词;其中,属性词可以通过属性词表与生成的文案进行匹配获取,属性词表可以通过语料库统计得到。
在通过第一文案生成模型对商品文案进行预测的束搜索阶段,可以采用硬规则方式,对每个商品文案中不同文案描述之间的重复程度进行判断,得到判断结果,如果判断结果中表明生成的文案描述之间存在重复的字、词、子句或语意上重复的子句,则将该商品文案进行删除;也就是说,只有判断结果表明生成的商品文案中任意不同文案描述之间均不存在上述重复情况,才可将该商品文案进行输出。
进一步地,对每个商品文案的属性词与第一属性数据每个属性词之间的一致程度进行判断,得到判断结果;如果判断结果表明生成的商品文案中包含输入数据中不存在的属性词,则将该商品文案进行删除;也就是说,只有判断结果表明生成的商品文案中包含的属性词均与输入数据中的属性词对应,才可将该商品文案进行输出。
图2为本公开实施例中通过第一文案生成模型进行文案输出的结果示意图,如图2所示,商品属性是第一文案生成模型的输入数据,解码输出得到的商品文案是没有增加重复度和一致性判断的生成结果;可以看出,该生成结果中“高腰”与第一文案生成模型的输入数据不一致,并且“穿着更加的舒适”和“让你的穿着更加的舒适”之间重复。在增加了重复度和一致性判别后,将“高腰”替换成“中腰”,“让你的穿着更加的舒适”替换成“让你的时尚感倍增”;可见,通过增加重复度和一致性判别,能够对第一文案生成模型生成结果中的错误描述进行纠正,提高商品文案的质量。
步骤103:按照质量判定规则对候选文案数据进行筛选,确定目标商品文案;候选文案数据包括第一候选文案集中的商品文案。
本公开实施例中,在得到第一候选文案集后,基于质量判定规则对第一候选文案集 中的商品文案进行筛选,确定最终输出的目标商品文案。
这里,质量判定规则包括以下至少之一:基于重复度对商品文案的质量进行筛选;重复度表示每个商品文案中不同文案描述之间的重复程度;基于一致性对商品文案的质量进行筛选;一致性表示每个商品文案的属性数据与第一属性数据之间的一致程度;基于困惑度对商品文案的质量进行筛选;困惑度表示每个商品文案中文案描述的清晰程度;基于属性覆盖度对商品文案的质量进行筛选;属性覆盖度表示第一属性数据在每个商品文案中的覆盖程度。
在一种实施方式中,可以基于重复度对第一候选文案集中的商品文案进行过滤;重复度包括字面上的重复和语意上的重复,其中,字面上的重复可以通过制定规则,判断每个商品文案中不同文案描述之间是否重复,例如相邻字词的重复,子句重复,属性词重复描述等。语意上的重复,通过训练word2vec词向量的方式,若发现相似词或相似子句,则判断商品文案之间存在重复问题。
在一种实施方式中,可以基于一致性对第一候选文案集中的商品文案进行过滤;由于保证输入数据和输出数据的一致性是对第一文案生成模型的基本要求,除了对模型优化生成一致的描述以外,为保证模型最终输出文案的属性数据与输入数据,即第一属性数据的一致程度,结合文案数据的特点,采用匹配属性词的方法判断最终输出文案的一致性,需要构建属性词表。基于属性词表,检测文案中描述属性词是否与输入数据的属性词存在冲突。其中,属性词表的构建,基于训练数据构建属性词表,构建中考虑属性词在文案中出现的频次和输入属性中出现频次的比例,同时考虑保留客观属性,例如材质属性,删除比较主观的属性,例如样式属性等。
在一种实施方式中,可以基于困惑度对第一候选文案集中的商品文案进行排序;第一文案模型生成的描述可能存在不通顺的情况,为了衡量生成文案的通顺度,采用语言模型中的困惑度指标度量文案,对文案进行排序,困惑度越高的文案一般情况下通顺性更差。基于已有的商品文案数据作为基础数据,统计二元模型下的概率,基于统计结果计算困惑度指标。基于困惑度指标计算当前商品所有候选文案的困惑度,并以此作为度量指标按照困惑度从低到高的顺序排序候选文案,取结果中候选文案排列在前的若干候选文案作为当前商品的新文案候选集。
在一种实施方式中,可以基于属性覆盖度对第一候选文案集中的商品文案进行排序;通过从多信息源如标题、扩展属性等获取的商品属性数据,经过过滤处理后,保留的属性数据作为文案生成模型的输入。生成的商品文案目标是对输入的属性做具体的描述, 吸引用户的购买兴趣。可以根据生成文案中包含的输入属性词的个数,判断商品文案的质量,描述的输入属性词越多,该商品文案的评分越高,文案质量越好。
在一些实施例中,按照质量判定规则对候选文案数据进行筛选,可以包括:在获取商品的第一属性数据后,将第一属性数据输入到至少两种文案生成模型中,得到商品的第二候选文案集;至少两种文案生成模型包括第一文案生成模型;按照质量判定规则对候选文案数据进行筛选;候选文案数据包括第二候选文案集中的商品文案。
在文案生成的过程中,除了采用训练完成的第一文案生成模型外,还可以采用其他文案生成模型;即,本公开实施例能够兼容各种文案生成模型。
对于商品文案生成任务,不再单纯依赖某个端到端的文案生成模型,而是基于多种文案生成模型共同生成商品对应的文案,得到商品的第二候选文案集;再基于上述的质量判定规则对第二候选文案集的商品文案进行筛选,将符合要求的商品文案进行输出;可见,采用这种方式进行商品文案生成,其准确率和召回率可以满足工业界的实际需要。
可以看出,通过上述重复度、一致性、困惑度和属性覆盖度四个方面的质量判定规则对候选文案数据进行筛选,不仅可以过滤掉有问题的商品文案,还能保留高置信度和高覆盖度的文案作为最后的输出,确保商品文案的质量。
本公开实施例提出了一种文案生成方法、装置、电子设备、计算机存储介质和计算机程序产品,该方法包括:该方法包括:获取商品的第一属性数据;基于预先训练的第一文案生成模型,确定商品的第一关键属性数据;第一关键属性数据表示第一属性数据中的部分属性数据;根据第一关键属性数据,得到商品的第一候选文案集;第一候选文案集表示至少一个商品文案的集合;按照质量判定规则对候选文案数据进行筛选,确定目标商品文案;候选文案数据包括第一候选文案集中的商品文案。如此,无需通过人工撰写商品文案,而是基于商品属性信息和预先训练的第一文案生成模型生成商品文案,能够提高文案生成效率;进一步地,按照质量判定规则对已生成的商品文案进行筛选,可以确保商品文案的质量以及与商品之间的契合度。
为了能够更加体现本公开的目的,在本公开上述实施例的基础上,进行进一步的举例说明。
图3为本公开实施例的文案生成框架的结构示意图,如图3所示,该框架包括三个模块:商品信息过滤模块、文案生成模块和文案优选模块;其中,商品信息过滤模块配置为从多源商品信息如商品标题、商品类目、商品扩展信息等获取商品的类目、品牌名、产品词,以及若干能准确反映商品特征的修饰词,从这些类目、品牌名、产品词以及修 饰词中提取属性数据;属性数据包括属性词和属性,并对获取的属性数据进行过滤,提取出用于文案生成的商品属性信息,即,第一属性数据。
文案生成模块配置为基于第一文案生成模型,对商品信息过滤模块输出的第一属性数据进行抽取、筛选,确定商品的第一关键属性数据;其中,双注意力机制、覆盖机制用于第一文案生成模型训练阶段,束搜索在模型第一文案生成模型预测阶段使用。采用第一文案生成模型生成若干候选文案,并对各个候选文案的重复度和/或一致性进行判断;重复度表示每个商品文案中不同文案描述之间的重复程度;一致性表示每个商品文案的属性数据与第一属性数据之间的一致程度;根据判断结果,得到优化后的各个候选文案,即,第一候选文案集。
文案优选模块配置为基于重复度和一致性对第一候选文案集中的商品文案进行过滤,过滤掉有问题的商品文案,并基于困惑度和属性覆盖度对第一候选文案集中的商品文案进行排序,保留高置信度和高覆盖度的若干商品文案作为最后的输出,即目标商品文案。
图4为本公开实施例的第一文案生成模型的结构示意图,如图4所示,使用第一文案生成模型进行预测的处理流程为:将获取到的商品的第一属性数据“属性词|属性”,例如,“V领|领型”等,作为输入数据输入至编码器;采用双注意力机制对属性词和属性均计算注意力数据,并基于上下文向量将每个属性数据对应的属性词和属性的注意力数据进行融合,得到每个属性数据的注意力数据权重分布;使用第一解码器对这些属性数据进行解码,得到第一关键属性数据K1,使用第二解码器进行文案解码,得到每个关键属性数据对应的文案描述。
图5a为本公开实施例的一种文案生成装置的组成结构示意图,如图5a所示,装置包括:获取模块500、第一确定模块501、第二确定模块502和筛选模块503,其中:
获取模块500,配置为获取商品的第一属性数据;
第一确定模块501,配置为基于预先训练的第一文案生成模型,确定商品的第一关键属性数据;第一关键属性数据表示第一属性数据中的部分属性数据;
第二确定模块502,配置为根据第一关键属性数据,得到商品的第一候选文案集;第一候选文案集表示至少一个商品文案的集合;
筛选模块503,配置为按照质量判定规则对候选文案数据进行筛选,确定目标商品文案;候选文案数据包括第一候选文案集中的商品文案。
在一些实施例中,第二确定模块502,配置为根据第一关键属性数据,得到商品的 第一候选文案集,包括:
根据第一关键属性数据,逐句生成针对第一关键属性数据的文案描述;每个第一关键属性数据对应至少一句文案描述;
将每个第一关键属性数据对应的文案描述进行拼接,生成至少一个商品文案;
基于至少一个商品文案,得到商品的第一候选文案集。
在一些实施例中,第二确定模块502,配置为基于至少一个商品文案,得到商品的第一候选文案集,包括:
对每个商品文案的重复度和/或一致性进行判断,得到判断结果;重复度表示每个商品文案中不同文案描述之间的重复程度;一致性表示每个商品文案的属性数据与第一属性数据之间的一致程度;
根据判断结果,得到商品的第一候选文案集。
图5b为本公开实施例的另一种文案生成装置的组成结构示意图,如图5b所示,装置还包括训练模块504,训练模块504,配置为:
获取商品的历史文案以及第二属性数据;
将第二属性数据与历史文案进行匹配,得到第二关键属性数据;
将历史文案、第二属性数据以及第二关键属性数据作为训练数据;
通过训练数据训练第一文案生成模型,得到训练完成的第一文案生成模型。
在一些实施例中,第一文案生成模型包括:第一解码器和第二解码器,第一解码器用于对第二属性数据进行解码,得到第二关键属性数据;第二解码器用于生成第二关键属性数据对应的文案描述。
在一些实施例中,训练模块504,配置为通过训练数据训练第一文案生成模型,得到训练完成的第一文案生成模型,包括:
使用双注意力机制对第一解码器的网络参数进行调整,并使用覆盖机制对第二解码器的网络参数进行调整,得到训练完成的第一文案生成模型。
在一些实施例中,筛选模块503,配置为按照质量判定规则对候选文案数据进行筛选,包括:
在获取商品的第一属性数据后,将第一属性数据输入到至少两种文案生成模型中,得到商品的第二候选文案集;至少两种文案生成模型包括第一文案生成模型;
按照质量判定规则对候选文案数据进行筛选;候选文案数据包括第二候选文案集中的商品文案。
在一些实施例中,质量判定规则包括以下至少之一:
基于重复度对商品文案的质量进行筛选;重复度表示每个商品文案中不同文案描述之间的重复程度;
基于一致性对商品文案的质量进行筛选;一致性表示每个商品文案的属性数据与第一属性数据之间的一致程度;
基于困惑度对商品文案的质量进行筛选;困惑度表示每个商品文案中文案描述的清晰程度;
基于属性覆盖度对商品文案的质量进行筛选;属性覆盖度表示第一属性数据在每个商品文案中的覆盖程度。
在实际应用中,上述获取模块500、第一确定模块501、第二确定模块502、筛选模块503和训练模块504均可以由位于电子设备中的处理器实现,该处理器可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
具体来讲,本实施例中的一种文案生成方法对应的计算机程序指令可以被存储在光盘、硬盘、U盘等存储介质上,当存储介质中的与一种文案生成方法对应的计算机程序指令被一电子设备读取或被执行时,实现前述实施例的任意一种文案生成方法。
基于前述实施例相同的技术构思,参见图6,其示出了本公开提供的电子设备600,可以包括:存储器601和处理器602;其中,
存储器601,配置为存储计算机程序和数据;
处理器602,配置为执行存储器中存储的计算机程序,以实现前述实施例的任意一 种文案生成方法。
在实际应用中,上述存储器601可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM、快闪存储器(flash memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器602提供指令和数据。
上述处理器602可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的文案生成设备,用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。
本公开所提供的各方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本公开所提供的各产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本公开所提供的各方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程文案生成设备的处理器以产生一个机器,使得通过计算机或其他可编程文案生成设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功 能的装置。
这些计算机程序指令也可装载到计算机或其他可编程文案生成设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。
Claims (19)
- 一种文案生成方法,所述方法包括:获取商品的第一属性数据;基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据;根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合;按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案。
- 根据权利要求1所述的方法,其中,所述根据所述第一关键属性数据,得到所述商品的第一候选文案集,包括:根据所述第一关键属性数据,逐句生成针对所述第一关键属性数据的文案描述;所述每个第一关键属性数据对应至少一句文案描述;将所述每个第一关键属性数据对应的文案描述进行拼接,生成至少一个商品文案;基于所述至少一个商品文案,得到所述商品的第一候选文案集。
- 根据权利要求2所述的方法,其中,所述基于所述至少一个商品文案,得到所述商品的第一候选文案集,包括:对所述每个商品文案的重复度和/或一致性进行判断,得到判断结果;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;根据所述判断结果,得到所述商品的第一候选文案集。
- 根据权利要求1所述的方法,其中,所述第一文案生成模型是通过以下步骤训练得到的:获取商品的历史文案以及第二属性数据;将所述第二属性数据与所述历史文案进行匹配,得到第二关键属性数据;将所述历史文案、所述第二属性数据以及所述第二关键属性数据作为训练数据;通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型。
- 根据权利要求4所述的方法,其中,所述第一文案生成模型包括:第一解码器 和第二解码器,所述第一解码器用于对所述第二属性数据进行解码,得到所述第二关键属性数据;所述第二解码器用于生成所述第二关键属性数据对应的文案描述。
- 根据权利要求5所述的方法,其中,所述通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型,包括:使用双注意力机制对所述第一解码器的网络参数进行调整,并使用覆盖机制对所述第二解码器的网络参数进行调整,得到训练完成的所述第一文案生成模型。
- 根据权利要求1所述的方法,其中,所述按照质量判定规则对所述候选文案数据进行筛选,包括:在获取商品的第一属性数据后,将所述第一属性数据输入到至少两种文案生成模型中,得到所述商品的第二候选文案集;所述至少两种文案生成模型包括所述第一文案生成模型;按照质量判定规则对所述候选文案数据进行筛选;所述候选文案数据包括所述第二候选文案集中的商品文案。
- 根据权利要求1或7所述的方法,其中,所述质量判定规则包括以下至少之一:基于重复度对所述商品文案的质量进行筛选;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;基于一致性对所述商品文案的质量进行筛选;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;基于困惑度对所述商品文案的质量进行筛选;所述困惑度表示所述每个商品文案中文案描述的清晰程度;基于属性覆盖度对所述商品文案的质量进行筛选;所述属性覆盖度表示所述第一属性数据在每个商品文案中的覆盖程度。
- 一种文案生成装置,所述装置包括:获取模块,配置为获取商品的第一属性数据;第一确定模块,配置为基于预先训练的第一文案生成模型,确定所述商品的第一关键属性数据;所述第一关键属性数据表示第一属性数据中的部分属性数据;第二确定模块,配置为根据所述第一关键属性数据,得到所述商品的第一候选文案集;所述第一候选文案集表示至少一个商品文案的集合;筛选模块,配置为按照质量判定规则对所述候选文案数据进行筛选,确定目标商品文案;所述候选文案数据包括所述第一候选文案集中的商品文案。
- 根据权利要求9所述的装置,其中,所述第二确定模块,配置为根据所述第一关键属性数据,得到所述商品的第一候选文案集,包括:根据所述第一关键属性数据,逐句生成针对所述第一关键属性数据的文案描述;所述每个第一关键属性数据对应至少一句文案描述;将所述每个第一关键属性数据对应的文案描述进行拼接,生成至少一个商品文案;基于所述至少一个商品文案,得到所述商品的第一候选文案集。
- 根据权利要求10所述的装置,其中,所述第二确定模块,配置为基于所述至少一个商品文案,得到所述商品的第一候选文案集,包括:对所述每个商品文案的重复度和/或一致性进行判断,得到判断结果;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;根据所述判断结果,得到所述商品的第一候选文案集。
- 根据权利要求9所述的装置,其中,所述装置还包括训练模块,所述训练模块,配置为:获取商品的历史文案以及第二属性数据;将所述第二属性数据与所述历史文案进行匹配,得到第二关键属性数据;将所述历史文案、所述第二属性数据以及所述第二关键属性数据作为训练数据;通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型。
- 根据权利要求12所述的装置,其中,所述第一文案生成模型包括:第一解码器和第二解码器,所述第一解码器用于对所述第二属性数据进行解码,得到所述第二关键属性数据;所述第二解码器用于生成所述第二关键属性数据对应的文案描述。
- 根据权利要求13所述的装置,其中,所述训练模块,配置为通过所述训练数据训练所述第一文案生成模型,得到训练完成的所述第一文案生成模型,包括:使用双注意力机制对所述第一解码器的网络参数进行调整,并使用覆盖机制对所述第二解码器的网络参数进行调整,得到训练完成的所述第一文案生成模型。
- 根据权利要求9所述的装置,其中,所述筛选模块,配置为按照质量判定规则对所述候选文案数据进行筛选,包括:在获取商品的第一属性数据后,将所述第一属性数据输入到至少两种文案生成模型中,得到所述商品的第二候选文案集;所述至少两种文案生成模型包括所述第一文案生 成模型;按照质量判定规则对所述候选文案数据进行筛选;所述候选文案数据包括所述第二候选文案集中的商品文案。
- 根据权利要求9或15所述的装置,其中,所述质量判定规则包括以下至少之一:基于重复度对所述商品文案的质量进行筛选;所述重复度表示所述每个商品文案中不同文案描述之间的重复程度;基于一致性对所述商品文案的质量进行筛选;所述一致性表示所述每个商品文案的属性数据与所述第一属性数据之间的一致程度;基于困惑度对所述商品文案的质量进行筛选;所述困惑度表示所述每个商品文案中文案描述的清晰程度;基于属性覆盖度对所述商品文案的质量进行筛选;所述属性覆盖度表示所述第一属性数据在每个商品文案中的覆盖程度。
- 一种电子设备,其中,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至8任一项所述的方法。
- 一种计算机存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现权利要求1至8任一项所述的方法。
- 一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行权利要求1至8任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/251,055 US20230385535A1 (en) | 2020-11-04 | 2021-10-29 | Copy generation method and apparatus, and electronic device, storage medium and program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011219419.8A CN112434493A (zh) | 2020-11-04 | 2020-11-04 | 一种文案生成方法、装置、电子设备和存储介质 |
CN202011219419.8 | 2020-11-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022095798A1 true WO2022095798A1 (zh) | 2022-05-12 |
Family
ID=74695429
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/127421 WO2022095798A1 (zh) | 2020-11-04 | 2021-10-29 | 一种文案生成方法、装置、电子设备、存储介质和程序 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20230385535A1 (zh) |
CN (1) | CN112434493A (zh) |
WO (1) | WO2022095798A1 (zh) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112434493A (zh) * | 2020-11-04 | 2021-03-02 | 北京沃东天骏信息技术有限公司 | 一种文案生成方法、装置、电子设备和存储介质 |
CN113420217A (zh) * | 2021-06-25 | 2021-09-21 | 北京三快在线科技有限公司 | 生成文案的方法、装置、电子设备和计算机可读存储介质 |
CN113553838A (zh) * | 2021-08-03 | 2021-10-26 | 稿定(厦门)科技有限公司 | 一种商品文案生成方法及装置 |
CN114328798B (zh) * | 2021-11-09 | 2024-02-23 | 腾讯科技(深圳)有限公司 | 搜索文本的处理方法、装置、设备、存储介质和程序产品 |
CN114997131A (zh) * | 2022-05-19 | 2022-09-02 | 北京沃东天骏信息技术有限公司 | 文案生成方法、模型训练方法及装置、设备、存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108932335A (zh) * | 2018-07-10 | 2018-12-04 | 北京京东尚科信息技术有限公司 | 一种生成文案的方法和装置 |
US20190205750A1 (en) * | 2017-12-29 | 2019-07-04 | Alibaba Group Holding Limited | Content generation method and apparatus |
CN110321537A (zh) * | 2019-06-11 | 2019-10-11 | 阿里巴巴集团控股有限公司 | 一种文案生成方法和装置 |
CN110852793A (zh) * | 2019-10-28 | 2020-02-28 | 北京深演智能科技股份有限公司 | 文案推荐方法及装置、电子设备 |
CN111782784A (zh) * | 2020-06-24 | 2020-10-16 | 京东数字科技控股有限公司 | 一种文案生成方法、装置、电子设备及存储介质 |
CN112434493A (zh) * | 2020-11-04 | 2021-03-02 | 北京沃东天骏信息技术有限公司 | 一种文案生成方法、装置、电子设备和存储介质 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110362823B (zh) * | 2019-06-21 | 2023-07-28 | 北京百度网讯科技有限公司 | 描述文本生成模型的训练方法和装置 |
CN111242741B (zh) * | 2020-01-15 | 2023-08-04 | 新石器慧通(北京)科技有限公司 | 一种基于场景的商品文案生成方法、系统及无人零售车 |
CN111581923A (zh) * | 2020-04-29 | 2020-08-25 | 北京字节跳动网络技术有限公司 | 文案生成方法、装置、设备和计算机可读存储介质 |
-
2020
- 2020-11-04 CN CN202011219419.8A patent/CN112434493A/zh active Pending
-
2021
- 2021-10-29 WO PCT/CN2021/127421 patent/WO2022095798A1/zh active Application Filing
- 2021-10-29 US US18/251,055 patent/US20230385535A1/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190205750A1 (en) * | 2017-12-29 | 2019-07-04 | Alibaba Group Holding Limited | Content generation method and apparatus |
CN108932335A (zh) * | 2018-07-10 | 2018-12-04 | 北京京东尚科信息技术有限公司 | 一种生成文案的方法和装置 |
CN110321537A (zh) * | 2019-06-11 | 2019-10-11 | 阿里巴巴集团控股有限公司 | 一种文案生成方法和装置 |
CN110852793A (zh) * | 2019-10-28 | 2020-02-28 | 北京深演智能科技股份有限公司 | 文案推荐方法及装置、电子设备 |
CN111782784A (zh) * | 2020-06-24 | 2020-10-16 | 京东数字科技控股有限公司 | 一种文案生成方法、装置、电子设备及存储介质 |
CN112434493A (zh) * | 2020-11-04 | 2021-03-02 | 北京沃东天骏信息技术有限公司 | 一种文案生成方法、装置、电子设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN112434493A (zh) | 2021-03-02 |
US20230385535A1 (en) | 2023-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022095798A1 (zh) | 一种文案生成方法、装置、电子设备、存储介质和程序 | |
TWI557664B (zh) | Product information publishing method and device | |
KR101634020B1 (ko) | 서프-쇼핑을 위한 연관성 추출 시스템 및 방법 | |
CN110245257B (zh) | 推送信息的生成方法及装置 | |
CN110489553B (zh) | 一种基于多源信息融合的情感分类方法 | |
CN109933686B (zh) | 歌曲标签预测方法、装置、服务器及存储介质 | |
CN108256968B (zh) | 一种电商平台商品专家评论生成方法 | |
CN112084381A (zh) | 一种事件抽取方法、系统、存储介质以及设备 | |
CN107357793A (zh) | 信息推荐方法和装置 | |
TW201541267A (zh) | 篩選推廣關鍵詞的方法和裝置 | |
Adnan et al. | Sentiment analysis of restaurant review with classification approach in the decision tree-j48 algorithm | |
WO2018068648A1 (zh) | 一种信息匹配方法及相关装置 | |
CN109598586A (zh) | 一种基于注意力模型的推荐方法 | |
CN113408287B (zh) | 实体识别方法、装置、电子设备及存储介质 | |
De Souza et al. | Generating e-commerce product titles and predicting their quality | |
CN111738807B (zh) | 用于推荐目标对象的方法、计算设备和计算机存储介质 | |
CN114971730A (zh) | 文案素材提取方法及其装置、设备、介质、产品 | |
Rani et al. | Study and comparision of vectorization techniques used in text classification | |
Hassan et al. | Sentimental analysis of Amazon reviews using naïve bayes on laptop products with MongoDB and R | |
CN115563982A (zh) | 广告文本优化方法及其装置、设备、介质、产品 | |
CN115186085A (zh) | 回复内容处理方法以及媒体内容互动内容的交互方法 | |
CN112241490A (zh) | 分类处理及数据搜索方法、装置、电子设备、智能音箱 | |
CN110580285B (zh) | 一种产品标签确定方法及装置,电子设备 | |
Buys et al. | A Bayesian model for generative transition-based dependency parsing | |
CN112257439B (zh) | 一种通过舆情数据挖掘热度词根的方法和装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21888495 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18251055 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21888495 Country of ref document: EP Kind code of ref document: A1 |