A method and device for generating target text

By using reinforcement learning algorithms and item element dictionary combined with user historical data, personalized target text is solved, and the problem that the existing technology cannot generate personalized text is improved, and the user experience and model accuracy are improved.

CN113779974BActive Publication Date: 2025-01-17BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010530512.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-11
Publication Date
2025-01-17
Estimated Expiration
2040-06-11

AI Technical Summary

Technical Problem

The summary generation model trained by existing machine learning algorithms cannot generate personalized target text, and cannot generate personalized text for users based on the item information that users are concerned about, resulting in the inability to effectively stimulate users' desire to purchase.

Method used

By determining the elements of the item based on the pre-built item element dictionary, combining user historical data to determine the elements that the user is concerned about, using a reinforcement learning algorithm to train the summary generation model, and generating target text covering the elements that the user is concerned about.

Benefits of technology

It realizes the generation of personalized target text for users, improves the accuracy and user experience of the summary generation model, and meets the personalized needs of different users for the same item.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113779974B_ABST
    Figure CN113779974B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating a target text, and relates to the field of computer technology. A specific implementation of the method includes: based on a pre-constructed dictionary of item elements, determining one or more first item elements of the item from the description text of the item; based on user historical data, determining one or more second item elements corresponding to the item type of the item that the user is concerned about from the first item elements; based on a reinforcement learning algorithm, training the description text of the item and the second item elements to obtain a summary generation model; based on the description text of the target item and the one or more target item elements of the target item that the target user is concerned about, using the summary generation model, generating a target text for the target user that covers at least a part of the target item elements. This implementation realizes the generation of personalized target text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a target text. Background Art

[0002] In the field of e-commerce, the purpose of generating short and concise target texts based on detailed information of items is to quickly stimulate users' desire to buy. However, since different users have different perspectives on the same item or the same user has different perspectives on different items, it is necessary to generate target texts containing the item information that users are interested in based on the detailed information of the items, that is, to achieve personalized target texts for different users.

[0003] At present, the summary generation model trained based on machine learning algorithms mainly takes the generation of fluent text as the main training goal. For the same item details, only one identical target text can be generated. It is impossible to generate personalized target text for users based on the item information that users are concerned about, thereby better stimulating users' desire to buy items. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a method and device for generating a target text, which can generate a personalized target text for a user based on one or more item elements that the user is concerned about and that correspond to the item category.

[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for generating a target text is provided, comprising:

[0006] Determining one or more first item elements of the item from the item description text based on a pre-built item element dictionary, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements;

[0007] Determining, from the first item elements, one or more second item elements that the user is interested in and that correspond to the item category of the item according to the user history data;

[0008] Based on a reinforcement learning algorithm, training the description text of the item and the second item element to obtain a summary generation model;

[0009] According to the description text of the target item and one or more target item elements of the target item that the target user is interested in, the summary generation model is used to generate a target text covering at least a part of the target item elements for the target user.

[0010] Optionally, the step of training the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model includes:

[0011] Build an initial summary generation model;

[0012] Inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item;

[0013] determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements;

[0014] The initial summary generation model is optimized according to the reward value to obtain the summary generation model.

[0015] Optionally, determining, according to the item element dictionary, an element word corresponding to the second item element in the target text;

[0016] According to the element words corresponding to the second item elements, the number of the second item elements covered in the target text is determined.

[0017] Optionally, determining, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item according to the user history data, includes:

[0018] According to one or more user operation types corresponding to the item type indicated by the user history data, obtaining an item set corresponding to the user operation type, wherein the item set includes one or more items corresponding to the user operation type;

[0019] For each of the first item elements, the number of items having the first item element in each of the item sets is calculated, so as to calculate the user attention degree of the first item element according to the number of items and the preset weight of the user operation type;

[0020] One or more of the second item elements are determined from the first item elements according to the order of the user attention from high to low.

[0021] Optionally, the calculating the user attention of the first item element according to the preset weights of the item quantity and the user operation type includes:

[0022] Calculate the product of each of the item quantity and the preset weight of the corresponding operation type to obtain the sub-user attention degree of the first item element;

[0023] The sum of the sub-user attentions is calculated to obtain the user attention of the first item element.

[0024] Optionally, the acquiring one or more first item elements of the item from the item description text based on the pre-built item element dictionary includes:

[0025] According to the item type of the item, acquiring from the item element dictionary one or more item elements corresponding to the item type and one or more element words corresponding to the item elements;

[0026] Calculate the occurrence frequency of the item element according to the occurrence frequency of the element word in the description text of the item;

[0027] One or more of the first item elements are determined from the item elements according to the order of occurrence frequency of the item elements from high to low.

[0028] Optionally, the initial summary generation model is an Encoder-Decoder model; wherein,

[0029] The neural network of the Encoder layer is used to generate corresponding semantic vectors based on the description text of the item;

[0030] The neural network of the Decoder layer is used to generate the target text according to the semantic vector.

[0031] To achieve the above object, according to another aspect of an embodiment of the present invention, a target text generation device is provided, comprising: an element acquisition module, a model generation module, and a summary generation module; wherein:

[0032] The element acquisition module is used to determine one or more first item elements of the item from the item description text based on a pre-built item element dictionary, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements;

[0033] The element acquisition module is further used to determine, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item based on the user history data;

[0034] The model generation module is used to train the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model;

[0035] The summary generation module is used to generate a target text covering at least a part of the target item elements for the target user using the summary generation model according to the description text of the target item and one or more target item elements of the target item that the target user is interested in.

[0036] Optionally, the step of training the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model includes:

[0037] Build an initial summary generation model;

[0038] Inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item;

[0039] determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements;

[0040] The initial summary generation model is optimized according to the reward value to obtain the summary generation model.

[0041] Optionally, the model generation module is used to determine, based on the item element dictionary, an element word in the target text corresponding to the second item element;

[0042] According to the element words corresponding to the second item elements, the number of the second item elements covered in the target text is determined.

[0043] Optionally, determining, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item according to the user history data, includes:

[0044] According to one or more user operation types corresponding to the item type indicated by the user history data, obtaining an item set corresponding to the user operation type, wherein the item set includes one or more items corresponding to the user operation type;

[0045] For each of the first item elements, the number of items having the first item element in each of the item sets is calculated, so as to calculate the user attention degree of the first item element according to the number of items and the preset weight of the user operation type;

[0046] One or more of the second item elements are determined from the first item elements according to the order of the user attention from high to low.

[0047] Optionally, the calculating the user attention of the first item element according to the preset weights of the item quantity and the user operation type includes:

[0048] Calculate the product of each of the item quantity and the preset weight of the corresponding operation type to obtain the sub-user attention degree of the first item element;

[0049] The sum of the sub-user attentions is calculated to obtain the user attention of the first item element.

[0050] Optionally, the acquiring one or more first item elements of the item from the item description text based on the pre-built item element dictionary includes:

[0051] According to the item type of the item, acquiring from the item element dictionary one or more item elements corresponding to the item type and one or more element words corresponding to the item elements;

[0052] Calculate the occurrence frequency of the item element according to the occurrence frequency of the element word in the description text of the item;

[0053] One or more of the first item elements are determined from the item elements according to the order of occurrence frequency of the item elements from high to low.

[0054] Optionally, the initial summary generation model is an Encoder-Decoder model; wherein,

[0055] The neural network of the Encoder layer is used to generate corresponding semantic vectors based on the description text of the item;

[0056] The neural network of the Decoder layer is used to generate the target text according to the semantic vector.

[0057] To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an electronic device for generating a target text, comprising:

[0058] one or more processors;

[0059] a storage device for storing one or more programs,

[0060] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above in the target text generation method.

[0061] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any method in the target text generation method described above is implemented.

[0062] An embodiment of the above invention has the following advantages or beneficial effects: by using a reinforcement learning algorithm to train the description text of the item and the item elements that the user is concerned about, a target text that can be generated for the user and covers the item elements that the user is concerned about is obtained, and a target text with different faces for different users is realized. On this basis, by determining the reward value corresponding to the initial summary generation model according to the ratio of the number of the second item elements covered in the target text to the total number of the second item elements, and optimizing the initial summary generation model according to the reward value to obtain the summary generation model, the accuracy of the target text generated by the summary generation model is further improved.

[0063] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0065] Figure 1 is a schematic diagram of the main process of the target text generation method according to an embodiment of the present invention;

[0066] Figure 2 is a schematic diagram of the main process of the method for determining the first item element according to an embodiment of the present invention;

[0067] Figure 3 is a schematic diagram of the main process of the method for determining the second item element according to an embodiment of the present invention;

[0068] Figure 4 is a schematic diagram of the main process of the training method of the summary generation model according to an embodiment of the present invention;

[0069] Figure 5 is a schematic diagram of main modules of a target text generating device according to an embodiment of the present invention;

[0070] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0071] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0072] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0073] Figure 1 is a schematic diagram of the main process of the target text generation method according to an embodiment of the present invention. Figure 1 As shown, the target text generation method may specifically include the following steps:

[0074] Step S101, based on a pre-constructed item element dictionary, determine one or more first item elements of the item from the description text of the item, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements.

[0075] The description text of an item refers to text information that describes the item in detail, such as the item manual, item details page, etc., while item elements refer to the words that an item has that are used to describe the performance of the item, and item element words are synonyms, antonyms, or hyponyms of item elements. The item element dictionary can be constructed manually based on actual experience, or it can be constructed using machine learning algorithms and natural language processing technology. Among them, the relationship between item types and item elements can be one-to-one or one-to-many, and the relationship between item elements and element words can also be one-to-one or one-to-many. Specifically, see the example of the item element dictionary provided in Table 1 below:

[0076] Table 1 Example of item element dictionary

[0077]

[0078] In an optional embodiment, the method of obtaining one or more first item elements of the item from the item description text based on the pre-built item element dictionary includes: obtaining one or more item elements corresponding to the item type and one or more element words corresponding to the item elements from the item element dictionary according to the item type of the item; calculating the frequency of occurrence of the item elements according to the frequency of occurrence of the element words in the item description text; and determining one or more first item elements from the item elements according to the order of the frequency of occurrence of the item elements from high to low. That is, the item element that appears in the item description text is determined as the first item element by matching the element words that appear in the item description text with the item element dictionary.

[0079] Step S102: determining, based on user history data, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item.

[0080] The user history data refers to any one or more of the records of items clicked by users, items browsed by users, items collected by users, items followed by users, items added to shopping carts by users, and items purchased by users. Therefore, the item elements that users follow or prefer can be determined based on the item elements of items that users have clicked or purchased.

[0081] In an optional embodiment, determining one or more second item elements corresponding to the item type of the item and that the user is concerned about from the first item element based on the user history data includes: obtaining an item set corresponding to the user operation type based on one or more user operation types corresponding to the item type indicated by the user history data, the item set containing one or more items corresponding to the user operation type; for each of the first item elements, calculating the number of items having the first item element in each of the item sets, so as to calculate the user attention to the first item element based on the preset weights of the number of items and the user operation type; and determining one or more of the second item elements from the first item elements in order of the user attention from high to low.

[0082] Step S103: Based on a reinforcement learning algorithm, the description text of the item and the second item element are trained to obtain a summary generation model.

[0083] Specifically, the reinforcement learning algorithms that can be used include but are not limited to: Q-learning algorithm, DNQ algorithm, Policy Gradient algorithm, Advantage Actor Critic (A2C) algorithm, Trust Region Policy Optimization (TRPO) algorithm, Proximal Policy Optimization (PPO) algorithm, etc. The embodiment of the present invention preferably uses the Policy Gradient algorithm to generate the summary generation model.

[0084] In an optional embodiment, the reinforcement learning algorithm is used to train the description text of the item and the second item element to obtain a summary generation model, including: constructing an initial summary generation model; inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item; determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements; and optimizing the initial summary generation model according to the reward value to obtain the summary generation model.

[0085] Specifically, the initial summary generation model is an Encoder-Decoder model, wherein the Encoder and the Decoder may adopt any of the following models: CNN (Convolutional Neural Networks), RNN (Recurrent Neural Network), Bidirectional RNN, LSTM (Long Short Term Neural Network), GRU (Gated Recurrent Units), etc.

[0086] More specifically, the element words corresponding to the second item element in the target text are determined according to the item element dictionary; and the number of the second item elements included in the target text is determined according to the element words corresponding to the second item element. For example, if the element words corresponding to item element A include word 1 and word 2, as long as the target text includes any one of word 1 and word 2, it is considered that the target text includes item element A.

[0087] Step S104, based on the description text of the target item and one or more target item elements of the target item that the target user is interested in, using the summary generation model, generate a target text covering at least a part of the target item elements for the target user.

[0088] It can be understood that before generating a target text based on the description text of the target item and the one or more target item elements of the target item that the target user is concerned about, it is necessary to determine the one or more item elements of the target item based on a pre-built item element dictionary; then, based on the historical data of the target user, determine the one or more target item elements of the target item that the target user is concerned about from the one or more first item elements of the target item; on this basis, based on the description text of the target item and the one or more target item elements of the target item that the target user is concerned about, use a summary generation model to generate a target text covering at least a part of the target item elements for the target user.

[0089] It is worth noting that since the target item element may correspond to one or more element words, as long as the generated target text contains the element words of the item element, it is considered that the target text contains this item element. In addition, due to the limitations of the existing technology, the obtained summary generation model cannot guarantee the 100% correctness of the generated target text. Therefore, it is only required that the generated target text needs to cover one or more of the target item elements.

[0090] Based on the above embodiment, since the reinforcement learning algorithm is used to train the description text of the item and the item elements that the user is concerned about, a target text that can be generated for the user and covers the item elements that the user is concerned about is obtained, and a target text with different faces for different users is realized. On this basis, the reward value corresponding to the initial summary generation model is determined according to the ratio of the number of the second item elements covered in the target text to the total number of the second item elements, and the initial summary generation model is optimized according to the reward value to obtain the summary generation model, thereby further improving the accuracy of the target text generated by the summary generation model.

[0091] See also Figure 2 Based on the above embodiment, the method for determining the first item element involved in step S101 is further described in detail. The method specifically includes the following steps:

[0092] Step S1011, according to the item type of the item, obtaining from the item element dictionary one or more item elements corresponding to the item type and one or more element words corresponding to the item elements.

[0093] Specifically, the description text of the item includes "HUAWEI P40 mobile phone, modern interpretation of advanced colors, pure aesthetics, five pure colors; full focal length high-definition, 30x digital zoom, 2.5cm super macro, from near to far, full ultra-clear; deep technology, Kirin 990 5G SoC chip, elegant and hard-core; full network communication, 5G+4G dual SIM dual standby; screen size 6.1 inches, battery capacity 3800mAh, body memory 128GB..." as an example: Since the item is a HUAWEI P40 mobile phone, one or more item elements corresponding to the item type "mobile phone" and the element words corresponding to the business element can be obtained according to the item element dictionary. For example, taking the item element dictionary shown in Table 1 as an example, the item elements corresponding to "mobile phone" are "battery", "screen", "storage capacity", "network type", etc., and the element words corresponding to "screen" include "screen size", "resolution", "full screen", and "curved screen".

[0094] Step S1012, calculating the occurrence frequency of the item element according to the occurrence frequency of the element word in the description text of the item.

[0095] That is to say, based on the item elements and corresponding element words determined according to the item element dictionary in the above steps, the frequency of occurrence of each element word in the item description text is counted. Specifically, taking the item element "screen" as an example, the frequency of occurrence of the element words "screen size", "resolution", "full screen", and "curved screen" corresponding to "screen" in the item description text is counted respectively, and taking the counted frequency of occurrence as 20, 30, 10, and 5 respectively, the screen of occurrence of the item element "screen" is the sum of the frequency of occurrence of each element word contained in it, which is 65.

[0096] Step S1013: determining one or more first item elements from the item elements according to the order of the occurrence frequencies of the item elements from high to low.

[0097] Specifically, the occurrence frequencies of the item elements "battery", "screen", "storage capacity", "network type", and "operating system" in the description text of the item after the above steps are counted are 45, 65, 55, 20, and 10, respectively. Due to the huge number of actual item types and items, in order to improve the efficiency of the entire target text generation, it is possible to consider retaining one or more first item elements for each item in descending order of the frequency of occurrence of the item elements. More specifically, taking the example of retaining 3 item elements for each item, it can be determined that the first item elements corresponding to the HUAWEI P40 mobile phone are "battery", "screen", and "storage capacity" according to the frequency of occurrence of the item elements counted in the above steps.

[0098] See also Figure 3 Based on the above embodiment, the method for determining the second item element involved in step S102 is further described in detail. The method specifically includes the following steps:

[0099] Step S1021, according to one or more user operation types corresponding to the item category indicated by the user history data, obtain an item set corresponding to the user operation type, wherein the item set includes one or more items corresponding to the user operation type.

[0100] Among them, user history data refers to any one or more of the records of items clicked by users, items browsed by users, items collected by users, items followed by users, items added to shopping carts by users, and items purchased by users. Therefore, the item elements that users follow or prefer can be determined based on the item elements of items that users have clicked or purchased. User operation types include, but are not limited to, click, browse, collect, follow, add to shopping cart, purchase, etc.

[0101] Specifically, still taking the item type as "mobile phone", the user's historical data only includes the records of mobile phones clicked, followed or purchased by the user as an example, then correspondingly, the mobile phone collection clicked by the user, the mobile phone collection followed by the user, and the mobile phone collection purchased by the user can be obtained respectively. On this basis, the first item element of a specific mobile phone item in the mobile phone collection can be determined according to one or more first item elements corresponding to each mobile phone item determined in step S101. As shown in Table 2 below, an example of an item collection and one or more item elements of each item in the item collection are provided.

[0102] Table 2 Example of item collection

[0103]

[0104] Step S1022: For each of the first item elements, the number of items in each of the item sets having the first item element is calculated, so as to calculate the user attention of the first item element according to the preset weights of the number of items and the user operation type.

[0105] Among them, the preset weight corresponding to the operation type refers to the value set according to the user's purchasing tendency. For example, the preset weights corresponding to the four operation types of user click, browse, follow, and purchase can be set to 0.3, 0.5, 0.8, and 1 respectively. In this way, the user's attention to different item elements is adjusted according to the user's historical behavior, so as to more accurately obtain the second item element that the user pays attention to.

[0106] Specifically, still referring to Table 2, the item set is provided in Table 2 as the set of mobile phones clicked by the user, the set of mobile phones followed by the user, and the set of mobile phones purchased by the user, and the corresponding preset weights are 0.5, 0.8, and 1 respectively. The first item elements corresponding to all items in the item set include: item element A, item element B, item element C, item element D, item element E, and item element F. For each item element X, the user attention can be calculated according to the following formula:

[0107] S(X)=w1*N 1X +w2*N 2X +w3*N 3X

[0108] Among them, S(X) refers to the user's attention to item element X, w1, w2, and w3 refer to the preset weights corresponding to the user's click behavior, attention behavior, and purchase behavior, respectively, and N 1X 、N 2X 、N 3XThey refer to the number of items with item element X in the mobile phone set clicked by the user, the mobile phone set followed by the user, and the mobile phone set purchased by the user. Based on this, the calculated user attention levels of item element A, item element B, item element C, item element D, item element E, and item element F are 3.6, 2.8, 1.8, 1.3, 1, and 1.8, respectively. It can be seen that the first item element that users pay more attention to is item element A, followed by item element B.

[0109] Step S1023: determining one or more of the second item elements from the first item elements according to the order of the user attention from high to low.

[0110] See also Figure 4 Based on the above embodiment, the training method of the summary generation model involved in step S103 is further described in detail. The method specifically includes the following steps:

[0111] Step S1031: construct an initial summary generation model.

[0112] Specifically, the initial summary generation model is constructed by using the Encoder-Decoder framework, and the model training is performed based on the PolicyGradient reinforcement learning algorithm as an example: after the initial summary generation model is constructed by using the Encoder-Decoder framework, the initial summary generation model is used as an agent in reinforcement learning; the neural network of the Encoder layer is used to generate the corresponding semantic vector according to the description text of the item, and the neural network of the Decoder layer is used to generate the target text according to the semantic vector; the environment that interacts with the Decoder is the target text or words in the target text generated at the previous moment, as well as the semantic vector; the agent's parameters are used as the policy. On this basis, according to the policy and the environment, the agent can make an action at the current moment, that is, generate the target text; then the environment can calculate the reward value based on the ratio of the number of second item elements covered in the target text to the total number of second item elements, and feedback the reward value to the agent to optimize the initial summary generation model.

[0113] More specifically, taking the example that the second item element includes item element A, item element B, and item element C, if the generated target text only includes the element words included in item element A and item element B, the ratio of the number of second item elements included in the target text to the total number of second item elements is 66.7%. It can be understood that the higher the ratio of the number of second item elements included in the target text to the total number of second item elements, the greater the corresponding reward value, and the higher the accuracy of the summary generation model obtained by training.

[0114] Step S1032: input the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item.

[0115] Step S1033: determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements.

[0116] Step S1034: Optimize the initial summary generation model according to the reward value to obtain the summary generation model.

[0117] See also Figure 5 Based on the above embodiments, the present invention provides a target text generation device 500, including: an element acquisition module 501, a model generation module 502, and a target text generation module 503; wherein,

[0118] The element acquisition module 501 is used to determine one or more first item elements of the item from the item description text based on a pre-built item element dictionary, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements;

[0119] The element acquisition module 502 is further used to determine, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item based on the user history data;

[0120] The model generation module 503 is used to train the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model;

[0121] The target text generation module 504 is used to generate a target text covering at least a part of the target item elements for the target user using the summary generation model according to the description text of the target item and one or more target item elements of the target item that the target user is interested in.

[0122] In an optional implementation, the training of the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model includes:

[0123] Build an initial summary generation model;

[0124] Inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item;

[0125] determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements;

[0126] The initial summary generation model is optimized according to the reward value to obtain the summary generation model.

[0127] In an optional implementation, determining, according to the item element dictionary, an element word corresponding to the second item element in the target text;

[0128] According to the element words corresponding to the second item elements, the number of the second item elements covered in the target text is determined.

[0129] In an optional implementation, determining, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item according to the user history data, includes:

[0130] According to one or more user operation types corresponding to the item type indicated by the user history data, obtaining an item set corresponding to the user operation type, wherein the item set includes one or more items corresponding to the user operation type;

[0131] For each of the first item elements, the number of items having the first item element in each of the item sets is calculated, so as to calculate the user attention degree of the first item element according to the number of items and the preset weight of the user operation type;

[0132] One or more of the second item elements are determined from the first item elements according to the order of the user attention from high to low.

[0133] In an optional implementation, the calculating the user attention of the first item element according to the preset weights of the item quantity and the user operation type includes:

[0134] Calculate the product of each of the item quantity and the preset weight of the corresponding operation type to obtain the sub-user attention degree of the first item element;

[0135] The sum of the sub-user attentions is calculated to obtain the user attention of the first item element.

[0136] In an optional implementation, the acquiring one or more first item elements of the item from the item description text based on the pre-built item element dictionary includes:

[0137] According to the item type of the item, acquiring from the item element dictionary one or more item elements corresponding to the item type and one or more element words corresponding to the item elements;

[0138] Calculate the occurrence frequency of the item element according to the occurrence frequency of the element word in the description text of the item;

[0139] One or more of the first item elements are determined from the item elements according to the order of occurrence frequency of the item elements from high to low.

[0140] In an optional implementation, the initial summary generation model is an Encoder-Decoder model; wherein,

[0141] The neural network of the Encoder layer is used to generate corresponding semantic vectors based on the description text of the item;

[0142] The neural network of the Decoder layer is used to generate the target text according to the semantic vector.

[0143] Figure 6 An exemplary system architecture 600 is shown to which the target text generation method or target text generation device according to the embodiment of the present invention can be applied.

[0144] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0145] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.).

[0146] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0147] The server 605 may be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target text generated for the user) to the terminal device.

[0148] It should be noted that the method for generating the abstract target text provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the target text generating device is generally arranged in the server 605 .

[0149] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0150] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0151] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0152] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0153] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0154] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-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 of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0155] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0156] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor including an element acquisition module, a model generation module, and a target text generation module. The names of these modules do not constitute limitations on the modules themselves in some cases. For example, the model generation module may also be described as "a module for training the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model".

[0157] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: determining one or more first item elements of the item from the description text of the item based on a pre-built item element dictionary, the item element dictionary indicating one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements; determining one or more second item elements corresponding to the item category of the item that the user is concerned about from the first item elements based on user history data; training the description text of the item and the second item elements based on a reinforcement learning algorithm to obtain a summary generation model; using the summary generation model, generating a target text covering at least a part of the target item elements for the target user based on the description text of the target item and the one or more target item elements of the target item that the target user is concerned about.

[0158] According to the technical solution of the embodiment of the present invention, since the reinforcement learning algorithm is used to train the description text of the item and the item elements that the user is concerned about, a target text that can be generated for the user and covers the item elements that the user is concerned about is obtained, and a target text with different faces for different people is realized. On this basis, the reward value corresponding to the initial summary generation model is determined according to the ratio of the number of the second item elements covered in the target text to the total number of the second item elements, and the initial summary generation model is optimized according to the reward value to obtain the summary generation model, thereby further improving the accuracy of the target text generated by the summary generation model.

[0159] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating a target text, characterized in that: include: Determining one or more first item elements of the item from the item description text based on a pre-built item element dictionary, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements; Determining, from the first item elements, one or more second item elements that the user is interested in and that correspond to the item category of the item according to the user history data; Based on a reinforcement learning algorithm, training the description text of the item and the second item element to obtain a summary generation model; According to the description text of the target item and one or more target item elements of the target item that the target user is interested in, using the summary generation model, generating a target text covering at least a part of the target item elements for the target user; The step of training the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model includes: Build an initial summary generation model; Inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item; determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements; The initial summary generation model is optimized according to the reward value to obtain the summary generation model.

2. The target text generation method according to claim 1, characterized in that: Determining, according to the item element dictionary, an element word corresponding to the second item element in the target text; According to the element words corresponding to the second item elements, the number of the second item elements covered in the target text is determined.

3. The target text generation method according to claim 1, characterized in that: The determining, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item according to the user history data includes: According to one or more user operation types corresponding to the item type indicated by the user history data, obtaining an item set corresponding to the user operation type, wherein the item set includes one or more items corresponding to the user operation type; For each of the first item elements, the number of items having the first item element in each of the item sets is calculated, so as to calculate the user attention degree of the first item element according to the number of items and the preset weight of the user operation type; One or more of the second item elements are determined from the first item elements according to the order of the user attention from high to low.

4. The target text generation method according to claim 3, characterized in that: The calculating the user attention of the first item element according to the preset weights of the item quantity and the user operation type includes: Calculate the product of each of the item quantity and the preset weight of the corresponding operation type to obtain the sub-user attention degree of the first item element; The sum of the sub-user attentions is calculated to obtain the user attention of the first item element.

5. The target text generation method according to claim 1, characterized in that: The acquiring one or more first item elements of the item from the item description text based on the pre-built item element dictionary includes: According to the item type of the item, acquiring from the item element dictionary one or more item elements corresponding to the item type and one or more element words corresponding to the item elements; Calculate the occurrence frequency of the item element according to the occurrence frequency of the element word in the description text of the item; One or more of the first item elements are determined from the item elements according to the order of occurrence frequency of the item elements from high to low.

6. The target text generation method according to claim 1, characterized in that: The initial summary generation model is an Encoder-Decoder model; wherein, The neural network of the Encoder layer is used to generate corresponding semantic vectors based on the description text of the item; The neural network of the Decoder layer is used to generate the target text according to the semantic vector.

7. A target text generation device, characterized in that: include: Factor acquisition module, model generation module, summary generation module; among them, The element acquisition module is used to determine one or more first item elements of the item from the item description text based on a pre-built item element dictionary, wherein the item element dictionary indicates one or more item categories, one or more item elements corresponding to the item categories, and one or more element words corresponding to the item elements; The element acquisition module is further used to determine, from the first item elements, one or more second item elements that the user is concerned about and that correspond to the item category of the item based on the user history data; The model generation module is used to train the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model; The summary generation module is used to generate a target text covering at least a part of the target item elements for the target user using the summary generation model according to the description text of the target item and one or more target item elements of the target item that the target user is interested in; The step of training the description text of the item and the second item element based on a reinforcement learning algorithm to obtain a summary generation model includes: Build an initial summary generation model; Inputting the description text of the item and the second item element into the initial summary generation model to generate a target text corresponding to the description text of the item; determining a reward value corresponding to the initial summary generation model according to a ratio of the number of the second item elements covered in the target text to the total number of the second item elements; The initial summary generation model is optimized according to the reward value to obtain the summary generation model.

8. An electronic device for generating a target text, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Description text generation model training method and device

    CN110377902A

  • Method and device for calculating user preferences

    CN110516033A