Target item recommendation method and device, computer device and storage medium
By acquiring the set of items operated by users and utilizing multi-level attention mechanisms and multi-head attention mechanisms, the problem of existing recommendation systems being unable to predict short-term preferences is solved, achieving more accurate item recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-05-16
- Publication Date
- 2026-06-16
AI Technical Summary
Existing recommendation systems cannot accurately predict users' short-term preferences, resulting in insufficient accuracy in item recommendations.
By acquiring the set of items operated by the user within a preset time period, determining the item feature representation based on the operation timestamp and relationship transformation representation, and calculating the item relationship feature representation through a multi-level attention mechanism and a multi-head attention mechanism, the target recommended item is determined from the candidate recommended items.
It improves the accuracy of predicting users' short-term preferences and enhances the precision of item recommendations.
Smart Images

Figure CN116578784B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device, and storage medium for recommending a target item. Background Technology
[0002] In the information and digital economy, recommendation systems have become a basic tool, especially in the field of product recommendation. With the increasing variety of products, users have to make choices from a large number of items, making it difficult for them to make reasonable decisions. Recommendation systems can help users make reasonable decisions and choices in daily consumption, business operations, and learning and entertainment.
[0003] Current recommendation systems can only predict and recommend items based on users' long-term preferences. However, in real life, users often develop short-term preferences, which current systems cannot predict. This prevents them from accurately helping users make informed decisions in daily consumption, business operations, and learning and entertainment. Therefore, there is an urgent need for a method that can predict users' short-term preferences and improve the accuracy of item recommendations. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, device, computer equipment, and storage medium for recommending target items that can predict short-term preferences and improve the accuracy of item recommendations, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for recommending target items. The method includes:
[0006] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0007] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0008] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0009] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0010] In one embodiment, determining the relational transformation representation of at least two operational items includes:
[0011] Based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item;
[0012] Based on the mutual conversion relationship between any two manipulated items and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of at least two manipulated items.
[0013] In one embodiment, the target item feature representation of each operational item is determined based on the operation timestamps and relationship transformation representations corresponding to at least two operational items, including:
[0014] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the initial item feature representation of each operation item under different relation types; wherein, the relation types include self-transformation relation, out-degree transformation relation, in-degree transformation relation, and in-out-degree transformation relation;
[0015] Based on the initial item feature representations of each operational item under different relation types, determine the target item feature representations of each operational item.
[0016] In one embodiment, based on the operation timestamps and relation transformation representations corresponding to at least two operation items, the initial item feature representation of each operation item under different relation types is determined, including:
[0017] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information of each operation item under different relation types;
[0018] Based on the feature activation information of each operated item under different relation types and the operation timestamp of each operated item, the initial item feature representation of each operated item under different relation types is determined.
[0019] In one embodiment, the target item feature representation of each operational item is determined based on the initial item feature representation of each operational item under different relation types, including:
[0020] Through the first-level relational attention mechanism, the subset feature representation corresponding to each item subset is determined based on the initial item feature representation of each operation item under different relation types;
[0021] The second-level relational attention mechanism determines the item set feature representation based on the subset feature representation corresponding to each item subset.
[0022] By employing a multi-head attention mechanism, the target item feature representation for each operation item is determined based on the feature representation of the item set.
[0023] In one embodiment, based on the target item feature representation of each operational item, an item relationship feature representation is determined, and based on the item relationship feature representation, a target recommended item is determined from the candidate recommended items, including:
[0024] Based on the feature representations of the last operated item and the target item of each operated item, determine the item relationship feature representation;
[0025] Based on the characteristics of item relationships, determine the operation probability of candidate items;
[0026] Based on the operation probability of candidate items, the target recommended item is determined from the candidate items.
[0027] In one embodiment, the item relationship feature representation is determined based on the feature representation of the last operated item among the operated items and the target item of each operated item, including:
[0028] The weight value of each operation item is determined based on the characteristics of the last operation item and the target item of each operation item.
[0029] Based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation.
[0030] Secondly, this application also provides a device for recommending a target article. The device includes:
[0031] The item set acquisition module is used to acquire the item set corresponding to at least two items operated by the user within a preset time period;
[0032] The first representation determination module is used to sequentially delete each operation item in the item set according to the operation timestamps corresponding to at least two operation items, to obtain at least two item subsets, and to determine the relationship transformation representation of at least two operation items;
[0033] The second representation determination module is used to determine the target item feature representation of each operation item based on the operation timestamps and relationship transformation representations corresponding to at least two operation items;
[0034] The recommended item determination module is used to determine the item relationship feature representation based on the target item feature representation of each operation item, and to determine the target recommended item from the candidate recommended items based on the item relationship feature representation.
[0035] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0036] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0037] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0038] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0039] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0040] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0041] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0042] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0043] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0044] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0045] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0046] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0047] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0048] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0049] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0050] The above-mentioned method, apparatus, computer equipment, and storage medium for recommending target items. Based on an item set within a preset time period, an item subset is obtained, thereby determining the relational transformation representation of the operated items. Then, based on the operation timestamps and relational transformation representations of the items, the target item feature representation of each operated item is determined. This achieves the determination of item relational feature representations based on the target item feature representations of each operated item, and finally, the target recommended item is determined from the candidate recommended items based on the item relational feature representations. This scheme considers the relational transformation representations between pairs of operated items within the item set within the preset time period when predicting items to determine the target item feature representations of each operated item. Because of the introduction of the relational transformation representations between pairs of operated items, even when predicting short-term preferences, the relational transformation representations between pairs of operated items can be determined, thereby improving the accuracy of determining the target item feature representations of each operated item. Furthermore, this scheme determines the item relational feature representations based on the target item feature representations, and then determines the target recommended item from the candidate recommended items based on the item relational feature representations. Therefore, improving the accuracy of determining the target item feature representations of each operated item also improves the accuracy of determining the target recommended item. Attached Figure Description
[0051] Figure 1 This is a diagram illustrating the application environment of a method for recommending target items in one embodiment.
[0052] Figure 2 This is a flowchart illustrating a method for recommending target items in one embodiment;
[0053] Figure 3 This is a flowchart illustrating a method for determining the target feature representation of each operational item in one embodiment;
[0054] Figure 4 This is a flowchart illustrating a method for determining a target recommended item from candidate items in one embodiment;
[0055] Figure 5 This is a flowchart illustrating a method for recommending target items in another embodiment;
[0056] Figure 6 This is a structural block diagram of a device for recommending a target item in one embodiment;
[0057] Figure 7 This is a structural block diagram of a device for recommending a target item in another embodiment;
[0058] Figure 8This is a structural block diagram of a device for recommending a target item in yet another embodiment;
[0059] Figure 9 This is a structural block diagram of a device for recommending a target item in another embodiment;
[0060] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] The method for recommending target items provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data required for performing related processing. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the recommended method for the target article shown in any of the following embodiments.
[0063] In one embodiment, such as Figure 2 As shown, a method for recommending target items is provided, which is then applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0064] S201, Obtain the item set corresponding to at least two items operated by the user within a preset time period.
[0065] The item set is a collection of operation items. For example, if the operation items within a preset time period are i1, i2, i3, and i4, then the item set corresponding to the operation items is {i1, i2, i3, i4}.
[0066] The items that a user can manipulate can be any item on the platform. For example, if the platform is a financial product service platform, the items that can be manipulated can be financial products, wealth management products and services, etc.
[0067] Optionally, based on a preset time period, the computer device searches its storage system for the user's operation items corresponding to that preset time period, and extracts these operation items to form an item set.
[0068] S202, based on the operation timestamps corresponding to at least two operation items, delete each operation item in the item set in sequence to obtain at least two item subsets, and determine the relational transformation representation of at least two operation items.
[0069] Here, the operation timestamp is the operation time corresponding to each operation item; the relationship transformation is represented by a transformation matrix that characterizes the transformation relationship between pairs of operation items, determined based on the item subset.
[0070] Specifically, the various operation items are sorted according to their timestamps to form an item set, which is then used as the first item subset. Next, based on the timestamps, the operation item with the latest timestamp in the first item subset is removed, forming the second item subset; similarly, the operation item with the latest timestamp in the second item subset is removed, forming the third item subset, and so on, until only one operation item remains in each item subset, thus dividing the item set into multiple item subsets. Then, based on the predicted relationships between pairs of operation items in each item subset, as well as the predicted relationships within each operation item itself, the relational transformation representation of each operation item is determined.
[0071] Optionally, one possible method for determining the relationship transformation representation of at least two operation items is as follows: based on the operation timestamps of the operation items contained in each item subset, determine the mutual transformation relationship between pairs of operation items and the self-transformation relationship of each operation item; based on the mutual transformation relationship between pairs of operation items and the self-transformation relationship of each operation item, determine the relationship transformation representation of at least two operation items.
[0072] Among them, the mutual conversion relationship between any two manipulated items is a prediction path that predicts the latter based on the former; the self-conversion relationship of each manipulated item is a prediction path that predicts the manipulated item based on the manipulated item itself.
[0073] Specifically, for each item subset, the number of predicted paths between any two items in the subset is determined based on the operation item with the earlier timestamp predicting the operation item with the later timestamp; this is the mutual transformation relationship between the two items. For each operation item in the subset itself, the number of predicted paths between any two items is determined based on the operation item with the earlier timestamp predicting the operation item with the later timestamp; this is the self-transformation relationship of each operation item. Finally, the determined number of predicted paths are combined to form a transformation matrix, which is the relational transformation representation of the operation items.
[0074] For example, if the item set corresponding to the operated item is {i1, i2}, then the item subset corresponding to the operated item is {i1, i2} and {i1}. Therefore, there are 0 ways to recommend i1 based on i1; 1 way to recommend i2 based on i1; 0 ways to recommend i1 based on i2; and 0 ways to recommend i2 based on i2. The conversion relationship between the operated items is then...
[0075] S203, determine the target item feature representation of each operation item based on the operation timestamps and relationship transformation representations corresponding to at least two operation items.
[0076] Among them, the target item feature is represented as an aggregated feature representation of the relationship transformation between the target item and all other items.
[0077] Optionally, one possible approach is to process the transformation relationship between the manipulated items and the operation timestamps corresponding to the manipulated items according to a preset feature relationship aggregation logic, and use the feature relationship aggregation result as the target item feature representation for each manipulated item. Another possible approach is to input the transformation relationship between the manipulated items and the operation timestamps corresponding to the manipulated items into the target item feature representation model, and determine the target item feature representation for each manipulated item based on the output of the target item feature representation model.
[0078] S204. Based on the target item feature representation of each operation item, determine the item relationship feature representation, and based on the item relationship feature representation, determine the target recommended item from the candidate recommended items.
[0079] Among them, the item relationship feature is a vector representation used to characterize the conversion relationship between different commodities, which is statistically derived from the target item feature representation of each operation item.
[0080] Specifically, the target item feature representation of each operation item is input into a pre-trained item relationship feature representation model, and the output of the item relationship feature representation model is the item relationship feature representation. Then, the feature vector of each candidate recommended item is multiplied with the item relationship feature representation, and the result of the multiplication is used as the preference score. The candidate recommended item with the higher preference score is selected as the target recommended item.
[0081] The above embodiment obtains a subset of items based on an item set within a preset time period, thereby determining the relationship transformation representation of the operated items. Then, based on the operation timestamps and relationship transformation representations of the items, the target item feature representation of each operated item is determined. This achieves the determination of item relationship feature representations based on the target item feature representations of each operated item, and finally, the determination of the target recommended item from the candidate recommended items based on the item relationship feature representations. This solution considers the relationship transformation representations between pairs of operated items within the item set within the preset time period when predicting items to determine the target item feature representation of each operated item. Because the relationship transformation representations between pairs of operated items are introduced, even when predicting short-term preferences, the relationship transformation representations between pairs of operated items can be determined, thereby improving the accuracy of determining the target item feature representation of each operated item. Furthermore, this solution determines the item relationship feature representation based on the target item feature representation, and then determines the target recommended item from the candidate recommended items based on the item relationship feature representation. Therefore, improving the accuracy of determining the target item feature representation of each operated item also improves the accuracy of determining the target recommended item.
[0082] The above embodiments illustrate how to recommend items in general. Building upon these embodiments, such as... Figure 3 As shown, the process of determining the target item feature representation of each operation item in the above embodiments is described in detail. The specific method is as follows:
[0083] S301, Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the initial item feature representation of each operation item under different relation types.
[0084] Among them, the relationship types include self-transformation relationship, out-degree transformation relationship, in-degree transformation relationship, and in-out-degree transformation relationship.
[0085] Specifically, each relationship type corresponds to an initial item feature representation. The operation timestamp and relationship transformation representation corresponding to the operation item can be substituted into the preset calculation formula to calculate the initial item feature representations corresponding to the four relationship types respectively.
[0086] Optionally, another possible method for determining the initial item feature representation of each operation item under different relation types is as follows: based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information corresponding to each operation item under different relation types; based on the feature activation information corresponding to each operation item under different relation types and the operation timestamps corresponding to each operation item, determine the initial item feature representation corresponding to each operation item under different relation types.
[0087] Specifically, first, based on the operation timestamp and relational transformation representation of the operated items, the historical node state vector corresponding to each operated item is determined. That is, each operated item needs to be predicted based on the item at the previous moment, thus determining the historical node state vector corresponding to each operated item. Where t is the operation timestamp corresponding to the operation item; then, according to the historical node state vector corresponding to each operation item, the feature activation information corresponding to each operation item under different relation types is calculated according to the preset formula. Taking the feature activation information corresponding to each operation item under the out-degree transformation relation as an example, its calculation formula is as follows: (1)
[0088]
[0089] in, Let H be the historical node state vector corresponding to each operated item, where H is the weight and b is the bias parameter. Let be the transformation matrix corresponding to the out-degree transformation relationship. This provides the feature activation information for each operated item under the out-degree transformation relationship.
[0090] Then, based on the feature activation information of each operation item under different relation types and the operation timestamp of each operation item, the initial item feature representation of each operation item under different relation types is determined according to the preset initial item feature representation calculation formula. Taking the initial item feature representation of each operation item under the out-degree transformation relation as an example, its calculation formula is as follows: (2)-(6):
[0091]
[0092]
[0093]
[0094]
[0095]
[0096] in, It's a door reset. This is the update gate, σ is the sigmoid activation function, σ is the element-wise multiplication operator, and WZ, WR, W, UZ, UR, and U are hyperparameters in the neural network model. This represents the hidden vector representation of the item under the out-degree transformation relationship. It is the item vector representation under the out-degree transformation relationship. It is the item vector representation under the in-degree transformation relationship. It is the item vector representation under the in-degree transformation relationship. It is the item vector representation corresponding to the self-degree transformation relationship. This represents the initial item feature representation after the feature level update.
[0097] 302. Based on the initial item feature representations of each operation item under different relation types, determine the target item feature representations of each operation item.
[0098] Specifically, the initial item feature representations of each operation item under different relation types are calculated using the same method, and then the target item feature representations of each operation item are determined based on the attention mechanism.
[0099] Optionally, one possible way to determine the target item feature representation of each operation item is as follows: through the first-level relational attention mechanism, based on the initial item feature representation of each operation item under different relation types, determine the subset feature representation corresponding to each item subset. The calculation formula for the subset feature representation corresponding to each item subset is as follows: (7)-(10):
[0100]
[0101]
[0102]
[0103]
[0104] Where atten represents the deep neural network used to perform hierarchical attention learning, W p It is the weight matrix, b p It is a bias vector, and the softmax function is used to... Normalize, Weight for each item A vector representation for each subset of items. This represents the initial item feature representation after the feature level update. This indicates a weighted summation.
[0105] Then, through the second-level relational attention mechanism, the item set feature representation is determined based on the subset feature representation corresponding to each item subset. The calculation formula for the item set feature representation is as follows: (11)-(12):
[0106]
[0107]
[0108] Where atten represents a deep neural network used to perform hierarchical attention learning. Indicates weighted summation, si For the feature representation of an item set, Weight for each item This is a vector representation of each subset of items.
[0109] Finally, through the multi-head attention mechanism, the target item feature representation of each operation item is determined based on the item set feature representation. The calculation formula for the target item feature representation is as follows (13):
[0110] D i =MHA(Q=s i K = s i V = s i (13)
[0111] Where Q is the query vector, k is the query vector, v is the content vector, MHA(-) is the multi-head attention mechanism, and D... i For the feature representation of the target item, s i This represents the characteristics of an item set.
[0112] In the above embodiment, based on the operation timestamps of the operation items contained in each item subset, the mutual conversion relationship between pairs of operation items and the self-conversion relationship of each operation item are determined; then, based on the mutual conversion relationship between pairs of operation items and the self-conversion relationship of each operation item, the relationship conversion representation of at least two operation items is determined. This method not only considers the conversion relationship between items, but also the conversion relationship of each item itself, which increases the accuracy of determining the relationship conversion representation of operation items.
[0113] The above embodiments determine the relational transformation representation of the manipulated items. Based on this, such as Figure 4 As shown, this implementation illustrates how to recommend items based on the relationship transformation representation of manipulated items. Specific methods include:
[0114] S401, determine the item relationship feature representation based on the last operated item and the target item feature representation of each operated item.
[0115] Specifically, based on the characteristics of the last operated item and the target item of each operated item, the probability of each operated item can be determined according to a preset calculation method, and the relationship characteristics of the items can be determined based on the probability of each operated item.
[0116] Optionally, one method for determining the characteristic representation of item relationships is: based on the characteristic representation of the last operated item and the target item of each operated item, determine the weight value of each operated item, and the formula for calculating the weight value of the item is as follows (14);
[0117] γ i=W T σ(W1i s,|n| +W2D i +c) (14)
[0118] Among them, i s,|n| It is a set of items s = [i s1, i s,2 , ..., i s,|n| The final clicked item's vector representation, where W1 is the weight controlling the item's vector, and γ... i Let W be the weight value of the manipulated item, σ be the parameter matrix, and σ be the bias matrix. Both W and c are hyperparameters.
[0119] Then, based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation. The calculation formula for the item relationship feature representation is as follows (15):
[0120]
[0121] Among them, S s γ represents the relationship characteristics of items. i D represents the weight value of the manipulated item. i Let m be the characteristic representation of the target item, and m be the number of items in the item set.
[0122] S402, Determine the operation probability of candidate items based on the item relationship characteristics.
[0123] Specifically, based on the item relationship characteristics, the calculation formula for determining the operation probability of candidate items is as follows (16):
[0124]
[0125] in, Let I be the transpose of the representation of the item relationship features. i For candidate items, The probability of operating on the candidate item.
[0126] S403, determine the target recommended item from the candidate items based on the operation probability of the candidate items.
[0127] Specifically, based on the operation probability of candidate items, the calculation formula for determining the target recommended item from the candidate items is as follows (17):
[0128]
[0129] Here, softmax is a function that calculates the probability of clicking the item next time it appears. This indicates the probability of the item appearing in the next click count. The probability of operating on the candidate item.
[0130] In the above embodiment, the item relationship feature representation is determined based on the last operated item and the target item feature representation of each operated item; then the operation probability of the candidate items is determined; and the target recommended item is determined from the candidate items. This method can intuitively display the next click probability of each item, increasing the convenience of target item recommendation.
[0131] To more comprehensively demonstrate this solution, this embodiment provides an optional method for recommending target items, such as... Figure 5 As shown:
[0132] S501, Obtain the item set corresponding to at least two operation items by the user within a preset time period.
[0133] S502, based on the operation timestamps corresponding to at least two operation items, delete each operation item in the item set in sequence to obtain at least two item subsets.
[0134] S503, based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item.
[0135] S504, based on the mutual conversion relationship between pairs of manipulated items and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of at least two manipulated items.
[0136] S505, based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information corresponding to each operation item under different relation types.
[0137] S506, Based on the feature activation information corresponding to each operation item under different relation types and the operation timestamp corresponding to each operation item, determine the initial item feature representation corresponding to each operation item under different relation types.
[0138] S507, through the first-level relational attention mechanism, determines the subset feature representation corresponding to each item subset based on the initial item feature representation of each operation item under different relation types.
[0139] S508 uses a second-level relational attention mechanism to determine the feature representation of an item set based on the feature representation of each item subset.
[0140] S509 uses a multi-head attention mechanism to determine the target item feature representation for each operation item based on the item set feature representation.
[0141] S510, determine the weight value of each operation item based on the characteristics of the last operation item and the target item of each operation item.
[0142] S511, based on the target item feature representation and weight value of each operation item, perform weighted summation on the target item feature representation of each operation item to obtain the item relationship feature representation.
[0143] S512, Determine the operation probability of candidate items based on the item relationship characteristics.
[0144] S513, determine the target recommended item from the candidate items based on the operation probability of the candidate items.
[0145] The specific processes of S501-S513 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.
[0146] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0147] Based on the same inventive concept, this application also provides a device for recommending target items to implement the above-described method for recommending target items. The solution provided by this device is similar to the solution described in the above-described method. Therefore, the specific limitations of one or more embodiments of the device for recommending target items provided below can be found in the limitations of the method for recommending target items described above, and will not be repeated here.
[0148] In one embodiment, such as Figure 6 As shown, a target item recommendation device is provided, comprising: an item set acquisition module 60, a first representation determination module 61, a second representation determination module 62, and a recommended item determination module 63, wherein:
[0149] The item set acquisition module 60 is used to acquire the item set corresponding to at least two operation items of the user within a preset time period;
[0150] The first representation determination module 61 is used to sequentially delete each operation item in the item set according to the operation timestamps corresponding to at least two operation items, to obtain at least two item subsets, and to determine the relationship transformation representation of at least two operation items;
[0151] The second representation determination module 62 is used to determine the target item feature representation of each operation item based on the operation timestamps and relationship conversion representations corresponding to at least two operation items;
[0152] The recommended item determination module 63 is used to determine the item relationship feature representation based on the target item feature representation of each operation item, and to determine the target recommended item from the candidate recommended items based on the item relationship feature representation.
[0153] In another embodiment, such as Figure 7 As shown, the first representation determination module 61 in the above embodiment further includes:
[0154] The relationship determination unit 610 is used to determine the mutual conversion relationship between pairs of operational items and the self-conversion relationship of each operational item based on the operation timestamps of the operational items contained in each item subset.
[0155] The representation determination unit 611 is used to determine the relationship transformation representation of at least two operation items based on the mutual transformation relationship between pairs of operation items and the self-transformation relationship of each operation item.
[0156] In another embodiment, such as Figure 8 As shown, the second representation determination module 62 in the above embodiment further includes:
[0157] The initial representation determination unit 620 is used to determine the initial item feature representation of each operation item under different relation types based on the operation timestamps and relation transformation representations corresponding to at least two operation items.
[0158] Among them, the relationship types include self-transformation relationship, out-degree transformation relationship, in-degree transformation relationship, and in-out-degree transformation relationship.
[0159] The target representation determination unit 621 is used to determine the target item feature representation of each operation item based on the initial item feature representation of each operation item under different relation types.
[0160] In another embodiment, the initial representation determination unit 620 in the above embodiments further includes:
[0161] The information determination subunit 6200 is used to determine the feature activation information of each operation item under different relationship types based on the operation timestamps and relationship transformation representations corresponding to at least two operation items.
[0162] The subunit 6221 is used to determine the initial item feature representation of each operation item under different relation types based on the feature activation information corresponding to each operation item under different relation types and the operation timestamp corresponding to each operation item.
[0163] In another embodiment, the target representation determination unit 621 in the above embodiments further includes:
[0164] The first representation determines the subunit 6210, which is used to determine the subset feature representation corresponding to each item subset through the first-level relational attention mechanism, based on the initial item feature representation of each operation item under different relational types.
[0165] The second representation determines the subunit 6211, which is used to determine the item set feature representation based on the subset feature representation corresponding to each item subset through the second-level relational attention mechanism.
[0166] The target representation determination subunit 6212 is used to determine the target item feature representation of each operation item based on the item set feature representation through a multi-head attention mechanism.
[0167] In another embodiment, such as Figure 9 As shown, the recommended item determination module 63 in the above embodiment further includes:
[0168] The third representation determination unit 630 is used to determine the item relationship feature representation based on the last operation item among the operation items and the target item feature representation of each operation item.
[0169] The probability determination unit 631 is used to determine the operation probability of candidate items based on the item relationship feature representation.
[0170] The target item determination unit 632 is used to determine the target recommended item from the candidate items based on the operation probability of the candidate items.
[0171] In another embodiment, the third representation determination unit 630 in the above embodiments further includes:
[0172] The weight value determination subunit 6300 is used to determine the weight value of each operation item based on the last operation item and the target item feature representation of each operation item.
[0173] The third representation determines the subunit 6301, which is used to perform weighted summation of the target item feature representations of each operation item according to the target item feature representations and weight values of each operation item to obtain the item relationship feature representation.
[0174] Each module in the recommended device for the aforementioned target item can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0175] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a recommended method for a target item. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0176] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0177] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0178] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0179] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0180] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0181] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0183] Based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item;
[0184] Based on the mutual conversion relationship between any two manipulated items and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of at least two manipulated items.
[0185] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0186] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the initial item feature representation of each operation item under different relation types; wherein, the relation types include self-transformation relation, out-degree transformation relation, in-degree transformation relation, and in-out-degree transformation relation;
[0187] Based on the initial item feature representations of each operational item under different relation types, determine the target item feature representations of each operational item.
[0188] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0189] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information of each operation item under different relation types;
[0190] Based on the feature activation information of each operated item under different relation types and the operation timestamp of each operated item, the initial item feature representation of each operated item under different relation types is determined.
[0191] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0192] Through the first-level relational attention mechanism, the subset feature representation corresponding to each item subset is determined based on the initial item feature representation of each operation item under different relation types;
[0193] The second-level relational attention mechanism determines the item set feature representation based on the subset feature representation corresponding to each item subset.
[0194] By employing a multi-head attention mechanism, the target item feature representation for each operation item is determined based on the feature representation of the item set.
[0195] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0196] Based on the feature representations of the last operated item and the target item of each operated item, determine the item relationship feature representation;
[0197] Based on the characteristics of item relationships, determine the operation probability of candidate items;
[0198] Based on the operation probability of candidate items, the target recommended item is determined from the candidate items.
[0199] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0200] The weight value of each operation item is determined based on the characteristics of the last operation item and the target item of each operation item.
[0201] Based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation.
[0202] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0203] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0204] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0205] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0206] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0208] Based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item;
[0209] Based on the mutual conversion relationship between any two manipulated items and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of at least two manipulated items.
[0210] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0211] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the initial item feature representation of each operation item under different relation types; wherein, the relation types include self-transformation relation, out-degree transformation relation, in-degree transformation relation, and in-out-degree transformation relation;
[0212] Based on the initial item feature representations of each operational item under different relation types, determine the target item feature representations of each operational item.
[0213] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0214] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information of each operation item under different relation types;
[0215] Based on the feature activation information of each operated item under different relation types and the operation timestamp of each operated item, the initial item feature representation of each operated item under different relation types is determined.
[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0217] Through the first-level relational attention mechanism, the subset feature representation corresponding to each item subset is determined based on the initial item feature representation of each operation item under different relation types;
[0218] The second-level relational attention mechanism determines the item set feature representation based on the subset feature representation corresponding to each item subset.
[0219] By employing a multi-head attention mechanism, the target item feature representation for each operation item is determined based on the feature representation of the item set.
[0220] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0221] Based on the feature representations of the last operated item and the target item of each operated item, determine the item relationship feature representation;
[0222] Based on the characteristics of item relationships, determine the operation probability of candidate items;
[0223] Based on the operation probability of candidate items, the target recommended item is determined from the candidate items.
[0224] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0225] The weight value of each operation item is determined based on the characteristics of the last operation item and the target item of each operation item.
[0226] Based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation.
[0227] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0228] Obtain the item set corresponding to at least two items operated by the user within a preset time period;
[0229] Based on the operation timestamps corresponding to at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of at least two operation items is determined.
[0230] Based on the operation timestamps and relationship transformation representations corresponding to at least two operation items, determine the target item feature representation for each operation item;
[0231] Based on the target item feature representation of each operation item, the item relationship feature representation is determined, and based on the item relationship feature representation, the target recommended item is determined from the candidate recommended items.
[0232] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0233] Based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item;
[0234] Based on the mutual conversion relationship between any two manipulated items and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of at least two manipulated items.
[0235] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0236] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the initial item feature representation of each operation item under different relation types; wherein, the relation types include self-transformation relation, out-degree transformation relation, in-degree transformation relation, and in-out-degree transformation relation;
[0237] Based on the initial item feature representations of each operational item under different relation types, determine the target item feature representations of each operational item.
[0238] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0239] Based on the operation timestamps and relation transformation representations corresponding to at least two operation items, determine the feature activation information of each operation item under different relation types;
[0240] Based on the feature activation information of each operated item under different relation types and the operation timestamp of each operated item, the initial item feature representation of each operated item under different relation types is determined.
[0241] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0242] Through the first-level relational attention mechanism, the subset feature representation corresponding to each item subset is determined based on the initial item feature representation of each operation item under different relation types;
[0243] The second-level relational attention mechanism determines the item set feature representation based on the subset feature representation corresponding to each item subset.
[0244] By employing a multi-head attention mechanism, the target item feature representation for each operation item is determined based on the feature representation of the item set.
[0245] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0246] Based on the feature representations of the last operated item and the target item of each operated item, determine the item relationship feature representation;
[0247] Based on the characteristics of item relationships, determine the operation probability of candidate items;
[0248] Based on the operation probability of candidate items, the target recommended item is determined from the candidate items.
[0249] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0250] The weight value of each operation item is determined based on the characteristics of the last operation item and the target item of each operation item.
[0251] Based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation.
[0252] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0253] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0254] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for recommending target items, characterized in that, The method includes: Obtain the item set corresponding to at least two items operated by the user within a preset time period; Based on the operation timestamps corresponding to the at least two operation items, each operation item in the item set is deleted sequentially to obtain at least two item subsets, and the relationship transformation representation of the at least two operation items is determined. Based on the operation timestamps and relationship transformation representations corresponding to the at least two operation items, determine the target item feature representation of each operation item; Based on the target item feature representation of each operation item, determine the item relationship feature representation, and based on the item relationship feature representation, determine the target recommended item from the candidate recommended items; Determining the relationship transformation representation of the at least two operational items includes: Based on the operation timestamps of the operation items contained in each item subset, determine the mutual conversion relationship between pairs of operation items, as well as the self-conversion relationship of each operation item; Based on the mutual conversion relationship between each pair of manipulated items, and the self-conversion relationship of each manipulated item, determine the relationship conversion representation of the at least two manipulated items; Among them, the mutual conversion relationship between any two manipulated items is a prediction path that predicts the latter based on the former; the self-conversion relationship of each manipulated item is a prediction path that predicts the manipulated item based on the manipulated item itself. The relational transformation is represented by a transformation matrix that characterizes the transformation relationship between pairs of operational items, determined based on the item subset. For each item subset, the number of prediction paths between pairs of operational items is determined based on the operational item with the earlier timestamp predicting the operational item with the later timestamp; this is the mutual transformation relationship between the pairs of operational items. The number of prediction paths between each operational item in the item subset is determined based on the operational item with the earlier timestamp predicting the operational item with the later timestamp; this is the self-transformation relationship of each operational item. Finally, the determined prediction path numbers are combined to form a transformation matrix, which is the relational transformation representation of the operational items.
2. The method according to claim 1, characterized in that, The step of determining the target item feature representation of each operation item based on the operation timestamps and relationship transformation representations corresponding to the at least two operation items includes: Based on the operation timestamps and relation transformation representations corresponding to the at least two operation items, determine the initial item feature representations of each operation item under different relation types; wherein, the relation types include self-transformation relation, out-degree transformation relation, in-degree transformation relation, and in-out-degree transformation relation; Based on the initial item feature representations of each operational item under different relation types, determine the target item feature representations of each operational item.
3. The method according to claim 2, characterized in that, The step of determining the initial item feature representation of each operation item under different relation types based on the operation timestamps and relation transformation representations corresponding to the at least two operation items includes: Based on the operation timestamps and relationship transformation representations corresponding to the at least two operation items, determine the feature activation information corresponding to each operation item under different relationship types; Based on the feature activation information of each operated item under different relation types and the operation timestamp of each operated item, the initial item feature representation of each operated item under different relation types is determined.
4. The method according to claim 2, characterized in that, The step of determining the target item feature representation for each operational item based on its initial item feature representation under different relation types includes: Through the first-level relational attention mechanism, the subset feature representation corresponding to each item subset is determined based on the initial item feature representation of each operation item under different relation types; The second-level relational attention mechanism determines the item set feature representation based on the subset feature representation corresponding to each item subset. Through a multi-head attention mechanism, the target item feature representation of each operation item is determined based on the feature representation of the item set.
5. The method according to claim 1, characterized in that, Based on the target item feature representation of each operational item, an item relationship feature representation is determined, and based on the item relationship feature representation, a target recommended item is determined from the candidate recommended items, including: Based on the feature representations of the last operated item and the target item of each operated item, determine the item relationship feature representation; Based on the characteristics of item relationships, determine the operation probability of candidate items; Based on the operational probabilities of the candidate items, a target recommended item is determined from the candidate items.
6. The method according to claim 5, characterized in that, The step of determining the item relationship feature representation based on the feature representation of the last operated item and the target item of each operated item includes: The weight value of each operation item is determined based on the characteristics of the last operation item and the target item of each operation item. Based on the target item feature representation and weight value of each operation item, the target item feature representation of each operation item is weighted and summed to obtain the item relationship feature representation.
7. A device for recommending a target item, characterized in that, The device includes: The item set acquisition module is used to acquire the item set corresponding to at least two items operated by the user within a preset time period; The first representation determination module is used to sequentially delete each operation item in the item set according to the operation timestamps corresponding to the at least two operation items, to obtain at least two item subsets, and to determine the relationship transformation representation of the at least two operation items; The second representation determination module is used to determine the target item feature representation of each operation item based on the operation timestamps and relationship transformation representations corresponding to the at least two operation items; The recommended item determination module is used to determine the item relationship feature representation based on the target item feature representation of each operation item, and to determine the target recommended item from the candidate recommended items based on the item relationship feature representation; The first representation determination module includes: a relationship determination unit, used to determine the mutual conversion relationship between pairs of operation items and the self-conversion relationship of each operation item based on the operation timestamps of the operation items contained in each item subset; The representation determination unit is used to determine the relationship transformation representation of at least two operational items based on the mutual transformation relationship between pairs of operational items and the self-transformation relationship of each operational item; Among them, the mutual conversion relationship between any two manipulated items is a prediction path that predicts the latter based on the former; the self-conversion relationship of each manipulated item is a prediction path that predicts the manipulated item based on the manipulated item itself. The relational transformation is represented by a transformation matrix that characterizes the transformation relationship between pairs of operational items, determined based on the item subset. For each item subset, the number of prediction paths between pairs of operational items is determined based on the operational item with the earlier timestamp predicting the operational item with the later timestamp; this is the mutual transformation relationship between the pairs of operational items. The number of prediction paths between each operational item in the item subset is determined based on the operational item with the earlier timestamp predicting the operational item with the later timestamp; this is the self-transformation relationship of each operational item. Finally, the determined prediction path numbers are combined to form a transformation matrix, which is the relational transformation representation of the operational items.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.