Article summary generation method and device, computer storage medium, and electronic device
Through a reinforcement learning training model based on item description vocabulary, the item summary is generated, and the problem that the abstract cannot cover key information of the item in the prior art is solved, and efficient user attraction and item promotion is achieved.
Patent Information
- Application Number
- CN202010536993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-12
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-06-12
AI Technical Summary
The item summary generated in the prior art cannot accurately cover the key information of the item, resulting in the inability to effectively attract users and promote the item.
By constructing a training dataset of item description vocabulary, training the initial summary model, and using the similarity between the initial summary and the template summary as a reward function for reinforcement learning, reinforcement training is performed to generate the target summary.
The generated target summary can quickly attract users, highlight the prominent points and uniqueness of the item, achieve the effect of promoting the item, and reduce the cost of manually writing the summary.
Smart Images

Figure CN113779232B_ABST
Abstract
Description
Background Art
[0002] Usually, Internet websites will set up some columns or channels to display or recommend items to users, such as discovering good products, buying albums, etc. In order to attract users, titles, pictures and text descriptions will be added to the items. These text descriptions are called summaries.
[0003] At present, the relevant summary generation method generally uses supervised learning to train the model and automatically generates short summaries based on the detailed text description of the item. However, on the one hand, different words may express the same semantics, so supervised learning at the word level is too absolute. On the other hand, different items often have different highlights at the element level. For example, some mobile phones have "large memory" and some mobile phones have "large battery capacity". Therefore, the generated summary cannot accurately cover the key information of the item.
[0004] In view of this, there is an urgent need in the art to develop a new method and device for generating item summaries.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention
[0006] The purpose of the present disclosure is to provide a method for generating an item summary, an item summary generating device, a computer storage medium and an electronic device, thereby overcoming the defect that the summary generated in the related art cannot cover the key information of the item at least to a certain extent.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, a method for generating an item summary is provided, comprising: constructing a training data set based on a description vocabulary set of an item, and performing model training for determining an initial summary according to an input vocabulary according to the training data set to obtain an initial model; using the similarity between the initial summary and a template summary as a reward function of reinforcement learning; wherein the summary template contains item keywords; performing reinforcement training on the initial model according to the reward function and the training data set, and generating a target summary according to the summary description model obtained after the reinforcement training.
[0009] In an exemplary embodiment of the present disclosure, generating a target summary based on the summary description model obtained after the intensive training includes: acquiring description words of the target item; semantically encoding the description words through an encoder in the summary description model to obtain semantic encoding vectors corresponding to each of the description words; decoding the semantic encoding vectors through a decoder in the summary description model to obtain a hidden state vector at a current moment; determining a summary word output by the summary description model at a current moment based on the hidden state vector at the current moment; and generating the target summary based on each summary word output by the summary description model.
[0010] In an exemplary embodiment of the present disclosure, the method further includes: determining the attribute names in the description vocabulary set, and determining the attribute descriptors in the description vocabulary set; using each of the attribute names as a keyword, and storing the attribute descriptors corresponding to each of the attribute names as key-value pairs to obtain a plurality of key-value pair sets; and constructing an attribute dictionary of the item based on the plurality of key-value pair sets.
[0011] In an exemplary embodiment of the present disclosure, the method also includes: determining a first attribute name contained in the template summary based on the attribute dictionary of the item; determining a second attribute name contained in the initial summary based on the attribute dictionary of the item; obtaining a target number of the first attribute names contained in the second attribute names; obtaining a ratio of the target number to the total number of first attribute names contained in the template summary, and determining the ratio as the similarity between the initial summary and the template summary.
[0012] In an exemplary embodiment of the present disclosure, the method further includes: when the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches a training termination condition; when the training termination condition is reached, storing the initial model to obtain the summary description model.
[0013] In an exemplary embodiment of the present disclosure, when the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches the training termination condition includes: when the value of the reward function reaches the target reward value and the number of training times of the initial model reaches a preset number of training times, determining that the training of the initial model reaches the training termination condition.
[0014] In an exemplary embodiment of the present disclosure, when the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches the training termination condition includes: when the value of the reward function reaches the target reward value, and the error function of the initial model is less than a preset accuracy, determining that the training of the initial model reaches the training termination condition.
[0015] According to a second aspect of the present disclosure, there is provided an apparatus for generating an item summary, comprising: a model training module, configured to construct a training data set based on a description vocabulary set of an item, and to perform model training for determining an initial summary according to an input vocabulary based on the training data set to obtain an initial model; a similarity comparison module, configured to use the similarity between the initial summary and a template summary as a reward function for reinforcement learning; wherein the summary template contains item keywords; and a summary generation module, configured to perform reinforcement training on the initial model based on the reward function and the training data set, and to generate a target summary based on the summary description model obtained after the reinforcement training.
[0016] According to a third aspect of the present disclosure, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating an item summary described in the first aspect is implemented.
[0017] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the item summary generation method described in the first aspect above by executing the executable instructions.
[0018] It can be seen from the above technical solutions that the method for generating an item summary, the device for generating an item summary, the computer storage medium, and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0019] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, a training data set is constructed based on the description vocabulary set of the item, and a model training is performed based on the training data set to determine the initial summary based on the input vocabulary to obtain an initial model, which can obtain an initial model for automatically writing item summaries, shorten the writing time, improve writing efficiency, avoid the high cost technical problem caused by manually writing item summaries in related technologies, and reduce labor costs. Further, the similarity between the initial summary and the template summary (the summary template contains item keywords) is used as a reward function for reinforcement learning, which can reward the initial summary containing item keywords generated by the model, so that the summary generated by the model is constantly close to the focus of interest to the user and the highlight of the item. On the other hand, the initial model is reinforced according to the reward function and the training data set, and the target summary is generated according to the summary description model obtained after the reinforcement training, which can solve the technical problem that the generated summary in the related technology cannot cover the key information of the item, so that the generated target summary can quickly attract the user's attention, so that the user can quickly understand the highlight and uniqueness of the item, and achieve the effect of promoting the item.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A schematic diagram showing a flow chart of a method for generating an article summary in an exemplary embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a sub-process of a method for generating an article summary in an exemplary embodiment of the present disclosure is shown;
[0024] Figure 3 A schematic diagram of a sub-process of a method for generating an article summary in an exemplary embodiment of the present disclosure is shown;
[0025] Figure 4 A schematic diagram of a sub-process of a method for generating an article summary in an exemplary embodiment of the present disclosure is shown;
[0026] Figure 5 A schematic diagram showing the structure of an apparatus for generating an article summary in an exemplary embodiment of the present disclosure is shown;
[0027] Figure 6 A schematic diagram showing the structure of a computer storage medium in an exemplary embodiment of the present disclosure;
[0028] Figure 7 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0030] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0032] At present, the relevant summary generation method generally uses supervised learning to train the model and automatically generates a short summary based on the detailed text description of the item. However, on the one hand, for a summary, different words may express the same semantics. Therefore, supervised learning at the word level is too absolute and cannot ensure the generation of a satisfactory summary. On the other hand, different items often have different highlights at the element level. For example, some mobile phones have "large memory" and some mobile phones have "large battery capacity". Therefore, the generated summary cannot accurately cover the key information of the item.
[0033] In the embodiments of the present disclosure, firstly, a method for generating an item summary is provided, which at least to some extent overcomes the defect that the method for generating an item summary provided in the prior art cannot cover the key information of the item.
[0034] Figure 1 A schematic flow chart of a method for generating an item summary in an exemplary embodiment of the present disclosure is shown. The execution subject of the method for generating an item summary may be a server that generates an item summary.
[0035] refer to Figure 1 According to an embodiment of the present disclosure, a method for generating an article summary includes the following steps:
[0036] Step S110, constructing a training data set based on the description vocabulary set of the item, and performing model training for determining an initial summary according to input vocabulary based on the training data set to obtain an initial model;
[0037] Step S120, using the similarity between the initial summary and the template summary as a reward function for reinforcement learning; wherein the summary template contains item keywords;
[0038] Step S130, performing reinforcement training on the initial model according to the reward function and the training data set, and generating a target summary according to the summary description model obtained after the reinforcement training.
[0039] exist Figure 1 In the technical solution provided by the illustrated embodiment, on the one hand, a training data set is constructed based on the description vocabulary set of the item, and a model training is performed based on the training data set to determine the initial summary based on the input vocabulary to obtain an initial model, which can obtain an initial model for automatically writing item summaries, shorten the writing time, improve writing efficiency, avoid the high cost technical problem caused by manually writing item summaries in the related art, and reduce labor costs. Further, the similarity between the initial summary and the template summary (the summary template contains the item keywords) is used as a reward function for reinforcement learning, which can reward the initial summary containing the item keywords generated by the model, so that the summary generated by the model is constantly close to the focus of interest to the user and the highlight of the item. On the other hand, the initial model is reinforced trained according to the reward function and the training data set, and the target summary is generated according to the summary description model obtained after the reinforcement training, which can solve the technical problem that the generated summary in the related art cannot cover the key information of the item, so that the generated target summary can quickly attract the user's attention, so that the user can quickly understand the highlight and uniqueness of the item, and achieve the effect of promoting the item.
[0040] The following Figure 1 The specific implementation process of each step is described in detail:
[0041] In the exemplary embodiments of the present disclosure, the articles may be electronic products (mobile phones, computers, tablet computers, etc.), electrical appliances, daily necessities, cosmetics, clothing, etc., which may be set according to actual conditions and fall within the scope of protection of the present disclosure.
[0042] In step S110, a training data set is constructed based on the description vocabulary set of the object, and model training for determining an initial summary according to input vocabulary is performed based on the training data set to obtain an initial model.
[0043] The item description vocabulary set may be a collection of a large number of item description words, including description words for various items (for example, when the item is an electronic product, its item description words may include: the clever superposition of frosted glass and nano-textured film, an innovative glass process, super-slow motion, incredible night shots, ultra-high-speed photography, ultra-high-definition night shots, wireless fast charging, innovative technological means, etc.).
[0044] For example, the description words of the above items can be obtained by crawling the item description words contained in each web page based on a web crawler. A web crawler is also called a web spider or a web robot. It is a program or script used to automatically browse the World Wide Web and can automatically grab valuable information from the Internet.
[0045] After obtaining the description vocabulary set of the item, a training data set may be constructed based on the description vocabulary set of the item, and model training for determining an initial summary according to input vocabulary may be performed based on the training data set to obtain an initial model.
[0046] After obtaining the initial model, for example, for the electronic product "mobile phone A", the initial summary generated by the above initial model can be: "Powerful hardcore chip, stable output of high frame rate images and reduced game power consumption; ultra-high-definition three-dimensional AI (Artificial intelligence, artificial intelligence, abbreviated as: AI) camera; tailored for young people, interpreting the fashion trends of the younger generation, targeting you who are also both beautiful inside and out."
[0047] In step S120, the similarity between the initial summary and the template summary is used as a reward function for reinforcement learning; wherein the summary template contains item keywords.
[0048] The template summary can be a pre-acquired, manually written summary containing item keywords, where the item keywords can be the item's superior performance components (for example, a processor with ultra-fast computing speed, an ultra-high-definition camera), the item's unique appearance style (for example, a borderless full screen with an ultra-high screen-to-body ratio), and the item's cost-effective sales parameters (for example, selling price), etc., which can be set according to actual conditions and fall within the scope of protection of this disclosure.
[0049] For example, when the battery capacity of the electronic product "mobile phone A" is small and the charging speed is slow, while other configuration components (such as screen, chip, memory, camera, processor, etc.) have superior performance, the template summary of item A can be: "Foldable screen; powerful hard-core chip; large memory, no lag; 40 million ultra-sensitive camera, ultra-high-definition night-shot AI camera, lightly press the shutter, freeze time, and truly record the details you see; Kirin 990 processor, powerful computing power, peak speed; tailored for young people, interpreting the fashion trends of the younger generation, and targeting you who are also both internal and external". Therefore, it is obvious that the summary template can focus on describing the keywords of the item, so as to achieve the effect of highlighting the strengths and avoiding the weaknesses, so that users can quickly understand the highlights and uniqueness of the item, and can quickly attract the user's attention to achieve the effect of promoting the item.
[0050] For example, an attribute dictionary of an item can also be constructed. For example, reference can be made to Figure 2 , Figure 2 A schematic diagram of a sub-process of a method for generating an item summary in an exemplary embodiment of the present disclosure is shown, specifically a schematic diagram of a sub-process of constructing an attribute dictionary of the above-mentioned item, including steps S201-S203. Figure 2 Step S120 is explained.
[0051] In step S201, the attribute names in the description vocabulary set are determined, and the attribute description words in the description vocabulary set are determined.
[0052] The attribute names in the descriptive vocabulary set of the above-mentioned items can be labeled. Exemplarily, the determined attribute names can be words such as "battery, screen, chip, memory, camera, processor" and the like.
[0053] The attribute descriptors in the description vocabulary set of the above-mentioned items can also be marked. For example, the determined attribute descriptors can be words such as: power, remaining power, battery life, curved screen, foldable screen, soft light quad camera, ultra-large capacity, etc.
[0054] In step S202, each attribute name is used as a keyword, and the attribute description word corresponding to each attribute name is stored as a key-value pair, thereby obtaining a plurality of key-value pair sets.
[0055] After determining the attribute name and attribute descriptor, each attribute name can be used as a keyword (key), and the attribute descriptor corresponding to each attribute name can be stored as a key value (value), thereby obtaining multiple key-value pair sets (key-value sets).
[0056] In step S203, an attribute dictionary of the item is constructed according to multiple key-value pair sets.
[0057] Thus, each item may correspond to multiple key-value pairs, and the item attribute dictionary may be constructed by combining multiple key-value pairs corresponding to multiple types of items. Exemplarily, a digital identifier may be added to each key-value pair set to obtain the above attribute dictionary.
[0058] After the attribute dictionary is constructed, the attribute names contained in the initial summary and the target summary can be identified according to the attribute dictionary, and the similarity between the initial summary and the template summary can be determined according to the number of attribute names. Figure 3 , Figure 3 A schematic diagram of a sub-process of a method for generating an article summary in an exemplary embodiment of the present disclosure is shown, specifically a schematic diagram of a sub-process of determining the similarity between an initial summary and a summary template, including steps S301 to S304. Figure 3 Step S120 is explained.
[0059] In step S301, based on the attribute dictionary of the item, a first attribute name included in the template summary is determined.
[0060] Exemplarily, the first attribute name included in the template summary can be determined based on the attribute dictionary of the above-mentioned items. Exemplarily, referring to the above-mentioned relevant explanations, the first attribute name included in the template summary is: "screen, chip, memory, camera, processor".
[0061] In step S302, based on the attribute dictionary of the item, a second attribute name included in the initial summary is determined.
[0062] Exemplarily, the second attribute name included in the initial summary may be determined based on the attribute dictionary of the item. Exemplarily, referring to the relevant explanation of step S110, the second attribute name included in the initial summary may be: "chip, camera".
[0063] In step S303, a target number of first attribute names included in the second attribute names is determined.
[0064] Thus, the number of intersections between the second attribute name and the first attribute name can be obtained, and then the number of intersections can be used as the target number of the first attribute name contained in the second attribute name. Exemplarily, referring to the relevant explanations of the above steps S301 and S302, the intersection of the second attribute name and the first attribute name is "chip, camera", that is, the number of intersections is 2, then it can be determined that the target number of the first attribute name contained in the above second attribute name is 2.
[0065] In step S304, the similarity between the initial summary and the template summary is determined according to the ratio of the number of targets to the total number of first attribute names included in the template summary.
[0066] Exemplarily, the total number of first attribute names included in the summary template may be 5, and the similarity between the initial summary and the summary template may be determined based on the ratio of the target number to the total number of first attribute names included in the summary template. Then, exemplary, the similarity between the initial summary and the template summary may be 2 / 5=40%.
[0067] Furthermore, the similarity between the above initial summary and the template summary can be determined as the value of the reward function of reinforcement learning. Among them, reinforcement learning (RL, also known as enhanced learning) is to continuously improve the strategy (i.e., what action to take in what state) by continuously interacting with the environment and using the rewards and punishments given by the environment in order to obtain the maximum cumulative rewards and punishments. Reinforcement includes positive reinforcement and negative reinforcement, among which positive reinforcement makes organisms tend to obtain more benefits, and negative reinforcement makes organisms tend to avoid damage. The biggest feature of reinforcement learning is that there is no correct answer in the learning process, but learning is done through reward signals. Therefore, it can avoid the technical problems of training models through supervised learning in the prior art, which requires labeling a large number of labeled training samples, which is laborious and costly, and reduces the training cost of the model.
[0068] It should be noted that for each item (there is a specific template summary), multiple initial summaries can be generated based on the above training data set. Each time an initial summary is generated, the similarity between the initial summary and the template summary can be calculated once. Thus, the reward function of the above reinforcement learning can be continuously iterated and updated, so that the summary generated by the model continues to develop towards a trend of higher similarity with the template summary, thereby ensuring that the generated item summary contains the above item keywords.
[0069] Continue to refer Figure 1 In step S130, the initial model is subjected to reinforcement training according to the reward function and the training data set, and a target summary is generated according to the summary description model obtained after the reinforcement training.
[0070] In an exemplary embodiment of the present disclosure, the above-mentioned initial model can be reinforced trained based on the model parameters and the training data set based on the reinforcement learning algorithm to obtain a summary description model. Among them, the above-mentioned reinforcement learning algorithm can be a gradient policy algorithm (Policy Gradient), a policy iteration algorithm (Policy Iteration Method) or a derivative-free optimization algorithm (derivative-free optimization method), etc., which can be set according to actual conditions and belong to the protection scope of the present disclosure. The biggest advantage of Policy Gradients directly outputting actions is that it can select actions within a continuous interval.
[0071] When the value of the reward function of reinforcement learning reaches the target reward value, it can be determined whether the training of the initial model has reached the training termination condition. When the training termination condition is reached, the trained initial model is stored to obtain a summary description model.
[0072] Exemplarily, when the value of the reward function of reinforcement learning reaches the target reward value and the number of training times of the initial model reaches the preset number of training times, it is determined that the training of the initial model reaches the training termination condition, and then, the training process of the model can be terminated, and the trained initial model is stored to obtain the above-mentioned summary description model.
[0073] Exemplarily, when the value of the reward function of reinforcement learning reaches the target reward value and the error function of the initial model is less than the preset accuracy, it can be determined that the training of the initial model reaches the above-mentioned training termination condition, and then, the training process of the model can be terminated, and the trained initial model can be stored to obtain the above-mentioned summary description model.
[0074] For example, please refer to Figure 4 , Figure 4 A schematic diagram of a sub-process of a method for generating an item summary in an exemplary embodiment of the present disclosure is shown, specifically a schematic diagram of a sub-process of generating a target summary according to a summary description model, including steps S401 to S404. Figure 4 Step S140 is explained.
[0075] In step S401, a description word of a target item is obtained.
[0076] For example, the description words of the target item can be obtained. For example, the target item can be "Mobile Phone B", and for example, its description words can be: "Battery capacity is relatively small: 2000mAh, 8GB+512GB large memory; 50 million super-sensing Leica camera; Kirin 990 processor".
[0077] In step S402, the description words are semantically encoded by an encoder in the summary description model to obtain a semantic encoding vector corresponding to each description word.
[0078] Exemplarily, the above summary description model can be an encoder-decoder framework. The Encoder-Decoder structure converts an input sequence into another sequence output. In this framework, the encoder converts the input sequence into a vector, and the decoder receives the vector and generates an output sequence in chronological order. Exemplarily, the above encoder can be a bidirectional recurrent neural network (Bidirectional RNN, Bi-RNN), and the above decoder can be a recurrent neural network (Recurrent Neural Networks, referred to as RNN).
[0079] It should be noted that the above encoder and decoder can use the same type of neural network model or different types of neural network models. For example, the encoder and decoder can both be CNN (Convolutional Neural Networks) models, or the encoder can use the RNN model and the decoder can use the CNN model. They can be combined according to actual conditions and all belong to the protection scope of this disclosure.
[0080] Exemplarily, the description words may be input into a summary description model, and the description words may be semantically encoded by an encoder in the summary description model to obtain a semantic encoding vector corresponding to each description word.
[0081] Semantically related encoding of descriptive words is the process of converting descriptive words into vectors. The semantic encoding vector refers to the vector obtained by inputting the descriptive words into the encoder to obtain the corresponding semantic vector, and then inputting the semantic vector into the hidden layer of the encoder. Hidden layer is a term in the neural network model, which is the middle layer relative to the input layer and the output layer. The hidden layer includes the model parameters obtained by training the neural network model. Here, the hidden layer of the encoder is the middle layer relative to the input layer of the encoder and the output layer of the encoder. The hidden layer of the encoder may include multiple neural network layers. Here, the hidden layer of the encoder is described as a "black box".
[0082] Exemplarily, the semantic vector corresponding to each word in the word sequence is input into the hidden layer of the encoder of the first channel to obtain the semantic encoding vector corresponding to each semantic vector. Therefore, the semantic encoding vector corresponding to each word in the word sequence can be obtained, which can be recorded as x 1 、x 2 、x 3 ……x t , the information can be summarized, and the final semantic encoding vector C = f(x 1 、x 2 、x 3 ……x t ).
[0083] In step S403, the semantic encoding vector is decoded according to the word vector of the summary word output by the summary description model at the previous moment through the decoder in the summary description model to obtain the hidden state vector at the current moment.
[0084] Decoding is the process of converting a vector into a sequence output. The hidden state vector refers to the vector calculated by inputting the semantic encoding vector corresponding to the semantic vector of each word in the word sequence into the hidden layer of the decoder. Here, the hidden layer of the decoder is the middle layer relative to the input layer of the decoder and the output layer of the decoder. The hidden layer of the decoder may include multiple neural network layers. The hidden layer of the decoder is described here as a "black box". In one embodiment, the hidden state vector of the decoder at the initial moment can be a model parameter obtained by model training, or it can be a model parameter set by default.
[0085] Specifically, when the server is generating the summary word output at the current moment, it can obtain the word vector of the summary word output at the previous moment, and decode the semantic encoding vector output by the encoder through the decoder based on the word vector of the summary word output at the previous moment to obtain the hidden state vector at the current moment. The hidden state vector not only contains the semantic information of each word in the word sequence of the original text, but also integrates the semantic information of the summary word output at the previous moment, so that the final generated summary text is more coherent and richer in information. For example, the word vector of the summary word output at the current moment is x 1 When x 1 Decode the semantic coding vector C to obtain the hidden state vector at the current moment. The hidden state vector obtained can be h t .
[0086] In step S404, the summary word output by the summary description model at the current moment is determined according to the hidden state vector at the current moment.
[0087] Furthermore, we can use the hidden state vector h at the current moment t , predict the summary word y output at the current moment t Thus, we can get the summary word y corresponding to each current moment. 1 ,y 2 ,y 3 ……y t .
[0088] In step S405, a target summary is generated according to each summary word output by the summary description model.
[0089] Furthermore, a target summary can be generated based on each summary word output by the summary description model. For example, referring to the relevant explanation of the above step S401, the generated target summary can be "8GB+512GB large memory, say goodbye to lag, and quickly switch between various mobile applications; 50 million super-sensing Leica camera, ultra-clear at all times, let every ray of light illuminate you, in your lens, you are the protagonist; Kirin 990 processor, hard-core responsibility without losing elegance".
[0090] Referring to the relevant explanations of the above steps S401 and S405, it can be seen that the summary description model obtained based on reinforcement learning training in the present disclosure can avoid non-selling attributes that affect the sales of items when generating target summaries, cover item keywords, and thus render the key selling attributes of items, making the generated summary more attractive to users, and facilitating users to quickly understand the highlights and unique features of the items, thereby achieving the effect of promoting the items.
[0091] The object summary generation method disclosed in the present invention can automatically write the object summary according to the keywords of the input object, thereby solving the technical problem that the object summary generated in the related technology cannot accurately cover the key information of the object, so that the writing quality can be controlled and the accuracy of the object summary can be guaranteed; and it can also shorten the writing time, improve the writing efficiency and reduce the writing cost.
[0092] The present disclosure also provides a device for generating an article summary. Figure 5 A schematic diagram showing the structure of an article summary generating device in an exemplary embodiment of the present disclosure is shown; Figure 5 As shown, the article summary generation device 500 may include a model training module 501, a similarity comparison module 502 and a summary generation module 503. Among them:
[0093] The model training module 501 is used to construct a training data set based on the description vocabulary set of the item, and perform model training based on the training data set to determine the initial summary according to the input vocabulary to obtain an initial model.
[0094] In an exemplary embodiment of the present disclosure, the model training module is used to determine whether the training of the initial model reaches the training termination condition when the value of the reward function reaches the target reward value; when the training termination condition is reached, the initial model is stored to obtain a summary description model.
[0095] In an exemplary embodiment of the present disclosure, the model training module is used to determine that the training of the initial model reaches the training termination condition when the value of the reward function reaches the target reward value and the number of training times of the initial model reaches a preset number of training times.
[0096] In an exemplary embodiment of the present disclosure, the model training module is used to determine that the training of the initial model reaches the training termination condition when the value of the reward function reaches the target reward value and the error function of the initial model is less than a preset accuracy.
[0097] The similarity comparison module 502 is used to use the similarity between the initial summary and the template summary as a reward function for reinforcement learning; wherein the summary template contains item keywords.
[0098] In an exemplary embodiment of the present disclosure, a similarity comparison module is used to determine the attribute names in a description vocabulary set, and to determine the attribute descriptors in the description vocabulary set; each attribute name is used as a keyword, and the attribute descriptors corresponding to each attribute name are stored as key-value pairs to obtain multiple key-value pair sets; and an attribute dictionary of the item is constructed based on the multiple key-value pair sets.
[0099] In an exemplary embodiment of the present disclosure, a similarity comparison module is used to determine a first attribute name included in a template summary based on an attribute dictionary of an item; determine a second attribute name included in an initial summary based on an attribute dictionary of an item; obtain a target number of first attribute names included in the second attribute names; obtain a ratio of the target number to the total number of first attribute names included in the template summary, and determine the ratio as the similarity between the initial summary and the template summary.
[0100] The summary generation module 503 is used to perform intensive training on the initial model according to the reward function and the training data set, and generate a target summary according to the summary description model obtained after the intensive training.
[0101] In an exemplary embodiment of the present disclosure, a summary generation module is used to obtain description words of a target item; semantically encode the description words through an encoder in a summary description model to obtain a semantic encoding vector corresponding to each description word; decode the semantic encoding vector through a decoder in the summary description model to obtain a hidden state vector at a current moment; determine the summary word output by the summary description model at the current moment according to the hidden state vector at the current moment; and generate a target summary according to each summary word output by the summary description model.
[0102] The specific details of each module in the above-mentioned item summary generation device have been described in detail in the corresponding item summary generation method, so they will not be repeated here.
[0103] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0104] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0105] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0106] In the exemplary embodiments of the present disclosure, a computer storage medium capable of implementing the above method is also provided. A program product capable of implementing the above method of this specification is stored thereon. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0107] refer to Figure 6 As shown, a program product 600 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0108] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0109] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0110] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0111] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0112] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0113] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0114] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0115] like Figure 7As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0116] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can perform the following steps: Figure 1 As shown in: Step S110, constructing a training data set based on a description vocabulary set of an item, and performing model training for determining an initial summary based on an input vocabulary according to the training data set to obtain an initial model; Step S120, using the similarity between the initial summary and the template summary as a reward function for reinforcement learning; wherein the summary template contains item keywords; Step S130, performing reinforcement training on the initial model according to the reward function and the training data set, and generating a target summary according to the summary description model obtained after the reinforcement training.
[0117] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0118] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0119] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0120] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0121] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0122] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0123] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A method for generating an article summary, characterized in that: include: Constructing a training data set based on a description vocabulary set of the item, and performing model training for determining an initial summary according to an input vocabulary based on the training data set to obtain an initial model; Using the similarity between the initial summary and the template summary as a reward function for reinforcement learning; wherein the template summary contains item keywords; Performing reinforcement training on the initial model according to the reward function and the training data set, and generating a target summary according to the summary description model obtained after the reinforcement training; The generating a target summary according to the summary description model obtained after the intensive training includes: Obtain descriptive vocabulary for the target item; The description words are semantically encoded by the encoder in the summary description model to obtain semantic encoding vectors corresponding to each description word; Decoding the semantic coding vector by a decoder in the summary description model to obtain a hidden state vector at the current moment; Determining the summary word output by the summary description model at the current moment according to the hidden state vector at the current moment; The target summary is generated according to each summary word output by the summary description model.
2. The method according to claim 1, characterized in that: The method further comprises: Determining attribute names in the description vocabulary set, and determining attribute description words in the description vocabulary set; Using each of the attribute names as a keyword, and storing the attribute description words corresponding to each of the attribute names as key values, to obtain a plurality of key-value pair sets; Construct an attribute dictionary of the item according to the multiple key-value pair sets.
3. The method according to claim 2, characterized in that The method further comprises: Determining a first attribute name included in the template summary based on the attribute dictionary of the item; Determining a second attribute name included in the initial summary based on the attribute dictionary of the item; Obtaining a target number of the first attribute name contained in the second attribute name; A ratio of the number of targets to the total number of first attribute names included in the template abstract is obtained, and the ratio is determined as the similarity between the initial abstract and the template abstract.
4. The method according to claim 1, characterized in that: The method further comprises: When the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches a training termination condition; When the training termination condition is reached, the initial model is stored to obtain the summary description model.
5. The method according to claim 4, characterized in that When the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches the training termination condition includes: When the value of the reward function reaches the target reward value and the number of training times of the initial model reaches a preset number of training times, it is determined that the training of the initial model reaches the training termination condition.
6. The method according to claim 4, characterized in that When the value of the reward function reaches the target reward value, determining whether the training of the initial model reaches the training termination condition includes: When the value of the reward function reaches the target reward value and the error function of the initial model is less than a preset accuracy, it is determined that the training of the initial model reaches the training termination condition.
7. An article summary generating device, characterized in that: include: A model training module, used to construct a training data set based on a description vocabulary set of an item, and perform model training for determining an initial summary based on an input vocabulary according to the training data set to obtain an initial model; A similarity comparison module, used to use the similarity between the initial summary and the template summary as a reward function for reinforcement learning; wherein the template summary contains item keywords; A summary generation module, used for performing intensive training on the initial model according to the reward function and the training data set, and generating a target summary according to the summary description model obtained after the intensive training; The summary generation module is also used to: obtain a description vocabulary of the target item; The description words are semantically encoded by the encoder in the summary description model to obtain semantic encoding vectors corresponding to each description word; Decoding the semantic coding vector by a decoder in the summary description model to obtain a hidden state vector at the current moment; Determining the summary word output by the summary description model at the current moment according to the hidden state vector at the current moment; The target summary is generated according to each summary word output by the summary description model.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating an article summary according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for generating an item summary according to any one of claims 1 to 6 by executing the executable instructions.
Citation Information
Patent Citations
Model training method, device, terminal and storage medium based on data processing
CN109460463A