Article recommendation method and device, electronic equipment and medium
By using multi-interest hierarchical conversation maps and attention networks in the item recommendation system, the problem of difficulty in effectively extracting multiple user interests in the prior art is solved, and a more efficient item recommendation effect is achieved.
Patent Information
- Application Number
- CN202510033947.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing item recommendation method is processed, it is difficult to effectively extract multiple user interests when processing user item interaction sequences, resulting in poor recommendation results.
By obtaining the target user item interaction sequence, inputting it to the trained item recommendation model, multiple user interest sub-sessions are generated, and user item interaction sub-graphs are constructed based on item groups of different granularities, and multi-interest hierarchical session maps are fused to generate a sub-graph of different granularities. The user interest characteristics and item characteristics are extracted using the multi-interest hierarchical map attention network, and the user conversation feature representation is generated through the hierarchical comparison learning mechanism, and recommended items matching multiple user interests are finally screened out from the candidate items.
Improve the accuracy of item recommendations, and enhance the relevance and accuracy of recommendation results by extracting multiple user interests and accurately matching item characteristics.
Smart Images

Figure CN119963285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing, and more specifically, to an item recommendation method, device, electronic device, and medium. Background Art
[0002] In order to solve the problem of "information overload", information recommendation system has become an effective tool, which can not only help users find the required resources from massive information, but also improve the profits of enterprises and enhance their market competitiveness. Therefore, recommendation system is widely used in the field of e-commerce. Traditional collaborative filtering recommendation method is overly dependent on the user's long-term historical user-item interaction information, which leads to poor recommendation effect in the case of short-term user-item interaction.
[0003] Sequential recommendation methods can make efficient recommendations based on the user's interaction sequence within a certain period of time. However, most of the existing neural network-based recommendation methods are designed for feature extraction of a single user's interests, ignoring the fact that the user-item interaction sequence may usually imply the interests of multiple users, resulting in poor recommendation results. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide an item recommendation method, device, electronic device and medium, which can extract multiple user interests and enhance the accuracy of item features and user interest features when recommending items, thereby improving the accuracy of item recommendations.
[0005] An item recommendation method provided in an embodiment of the present application comprises the following steps:
[0006] Obtaining a target user-item interaction sequence, and inputting the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series;
[0007] The item recommendation model generates a plurality of user interest sub-sessions based on a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests;
[0008] The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities;
[0009] The item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph to extract user interest features and item features corresponding to each user interest;
[0010] The item recommendation model adopts a hierarchical contrastive learning mechanism to learn the user interest features corresponding to each user interest, and generates a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest;
[0011] The item recommendation model screens target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations.
[0012] In some embodiments, in the item recommendation method, the item recommendation model is trained based on the following method:
[0013] Acquire a sample user-item interaction sequence, and construct an enhanced sample user-item interaction sequence based on the sample user-item interaction sequence;
[0014] The item recommendation model to be trained learns and outputs user interest features and item features corresponding to each user interest in the sample user-item interaction sequence, as well as user interest feature representations at different levels, and obtains user interest features and item features corresponding to each user interest in the enhanced sample user-item interaction sequence, as well as user interest feature representations at different levels;
[0015] Based on the user interest feature representation of each layer corresponding to each user interest in the sample user-item interaction sequence and the enhanced sample user sequence, a set of positive samples and a set of negative samples are constructed;
[0016] The item recommendation model to be trained learns the user interest features and item features corresponding to each user interest of the sample user-item interaction sequence, and the user interest feature representations at different levels, and generates multiple user session feature representations corresponding to multiple user interests of the sample user-item interaction sequence respectively;
[0017] Based on the set of positive samples, the set of negative samples and the predefined hierarchical multi-interest loss function, the multi-interest non-orthogonal loss function, as well as the multiple user session feature representations corresponding to the multiple user interests of the sample user-item interaction sequence and the predefined cross-entropy loss function, the item recommendation model learning to be trained is optimized to obtain the trained item recommendation model learning; the hierarchical multi-interest loss function is used to fuse the user interest feature representations of different layers to determine the accuracy of the extracted user interest features; the multi-interest non-orthogonal loss function is used to make different user interest feature representations independent of each other; the cross-entropy loss function is used to characterize the gap between the actual item selected by the user next time and the predicted item selected by the user next time.
[0018] In some embodiments, in the item recommendation method, the item recommendation model generates multiple user interest sub-sessions based on multiple user interests contained in the target user-item interaction sequence, including:
[0019] The item recommendation model converts multiple items arranged in time series in the target user-item interaction sequence into item embedding vectors based on the recommendation model embedding layer;
[0020] Constructing multiple user interest spaces, mapping the item embedding vector of each item in the target user-item interaction sequence to the multiple user interest spaces respectively, and generating item feature representations of each item in the user interest space; wherein different user interest spaces correspond to different user interests;
[0021] Determine the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filter out items whose relevance to the user interest does not meet the preset similarity requirement, and generate multiple user interest sub-sessions.
[0022] In some embodiments, in the item recommendation method, determining the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filtering out items whose relevance to the user interest does not meet the preset similarity requirement, and generating multiple user interest sub-sessions includes:
[0023] For the user interest space, an attention mechanism is used to generate feature representations of item groups that contain corresponding user interests.
[0024] Calculate the correlation between the item group feature representation of the user's interest space and the item feature representation of each item;
[0025] Filter out items whose relevance is lower than a preset relevance threshold, and generate multiple user interest sub-sessions; wherein the preset relevance threshold is determined based on an average value of the relevance between all item feature representations and item group feature representations.
[0026] In some embodiments, in the item recommendation method, the item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests, including:
[0027] The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities; the number of items in the item groups of different granularities is different; and the items in the item groups are continuous items;
[0028] The user-item interaction subgraphs of different granularities corresponding to each user interest subsession are hierarchically used to generate a user interest session graph corresponding to the user interest subsession;
[0029] The user interest conversation graphs corresponding to different user interest sub-conversations are combined in parallel to generate a multi-interest hierarchical conversation graph containing multiple user interests.
[0030] In some embodiments, in the item recommendation method, the item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and extracts user interest features and item features corresponding to each user interest based on the multi-interest hierarchical conversation graph using a multi-interest hierarchical graph attention network, including:
[0031] For the user interest session graph in the multi-interest hierarchical session graph, feature extraction is performed on each layer of the user-item interaction subgraph in the user interest session in turn, and the feature representation of the item group in each layer of the user-item interaction subgraph is extracted by combining the time interval between consecutive item groups and the time interval between items in the item group in the user-item interaction subgraph;
[0032] For each item group in each layer of the user-item interaction subgraph of the user interest conversation graph in the multi-interest hierarchical conversation graph, a graph attention mechanism is used to update the feature representation of the item group based on the in-degree neighboring points and the out-degree neighboring points of the item group to obtain an updated feature representation of the item group;
[0033] Extracting user interest feature representations of each layer of user-item interaction subgraphs in the user interest conversation graph of the multi-interest hierarchical conversation graph, and updating user interest feature representations of a higher layer of user-item interaction subgraphs based on the user interest feature representations of a lower layer of user-item interaction subgraphs, to obtain updated user interest feature representations of each layer;
[0034] Based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation, the user interest feature and the item feature corresponding to each user interest are determined.
[0035] In some embodiments, in the item recommendation method, determining the user interest feature and item feature corresponding to each user interest based on the updated feature representation of the item group and the updated user interest feature representation of each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph includes:
[0036] The length of the item group in the first-layer user-item interaction subgraph is 1. The feature representation of the item group in the first-layer user-item interaction subgraph is enhanced and updated through the updated user interest features of each layer of the user-item interaction subgraph in the user interest session graph, so as to enhance and update the feature representation of all items and determine the item features of the user interest corresponding to the user interest session graph;
[0037] Obtain high-level user interest feature representation from the top-level user-item interaction subgraph in the user interest conversation graph, and obtain item features from the bottom-level user-item interaction subgraph in the user interest conversation graph;
[0038] Based on the user interest feature representation and the item feature, a set of user interest feature representations and an item feature set of multiple user interest conversation graphs in the multi-interest hierarchical conversation graph are determined.
[0039] In some embodiments, in the item recommendation method, the item recommendation model uses a hierarchical contrastive learning mechanism to learn the user interest features corresponding to each user interest, and generates multiple user session feature representations corresponding to multiple user interests based on the extracted user interest features and item features corresponding to each user interest, including:
[0040] For each user interest feature and item feature corresponding to the user interest, adding the location information of the item corresponding to the item feature to the item feature to obtain an updated item feature;
[0041] Based on the user interest feature corresponding to each user interest, the updated item feature, and the contribution of each updated item feature to the user interest, a plurality of user session feature representations corresponding to the plurality of user interests are generated.
[0042] In some embodiments, in the item recommendation method, the item recommendation model selects target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations, including:
[0043] Based on the multiple user interests respectively corresponding to the multiple user session feature representations, respectively, the probability of the target candidate item being recommended for each user interest is calculated, and the maximum probability is selected as the probability of the target candidate item being finally recommended;
[0044] From the probabilities of all target candidate items being finally recommended, select the target recommended items whose probabilities of being finally recommended meet the preset recommendation conditions.
[0045] In some embodiments, an item recommendation device is further provided, the device comprising:
[0046] An acquisition module, used to acquire a target user-item interaction sequence, and input the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series;
[0047] A first generating module is used to enable the item recommendation model to generate a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests;
[0048] The second generation module is used to enable the item recommendation model to construct user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and to fuse the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities;
[0049] An extraction module, configured to enable the item recommendation model to combine the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and to extract user interest features and item features corresponding to each user interest using a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph;
[0050] A third generation module is used to enable the item recommendation model to learn the user interest features corresponding to each user interest by adopting a hierarchical contrast learning mechanism, and generate a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest;
[0051] The screening module is used to enable the item recommendation model to screen out target recommended items that match the interests of multiple users from the target candidate items based on the multiple user session feature representations.
[0052] In an embodiment of the present application, a method and device for recommending an item are provided. The method for recommending an item obtains a target user-item interaction sequence, and inputs the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series; the item recommendation model generates a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-session includes a plurality of items corresponding to the user interests; the item recommendation model constructs a user-item interaction sub-graph of different granularities in the user interest sub-session based on item groups of different granularities for each user interest sub-session, and fuses the user-item interaction sub-graphs of different granularities of each user interest sub-session to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction sub-graphs of different granularities; the item recommendation model combines the time intervals between consecutive item groups in the user-item interaction sub-graphs and the time intervals between items in the item groups, and adopts a multi-interest hierarchical session graph based on the multi-interest hierarchical session graph The graph attention network extracts user interest features and item features corresponding to each user interest; the item recommendation model adopts a hierarchical contrastive learning mechanism to learn the user interest features corresponding to each user interest, and generates multiple user session feature representations corresponding to multiple user interests based on the extracted user interest features and item features corresponding to each user interest; the item recommendation model screens target recommended items that match multiple user interests from target candidate items based on the multiple user session feature representations; the method extracts multiple user interests of the user, constructs a multi-interest hierarchical conversation graph including multiple levels of multiple user interests based on continuous item groups of different granularities, introduces the time interval information between continuous item groups and the time interval information between items in an item group into model training at the same time, improves the extraction accuracy of user interest features and item features, and compares the features extracted by the multi-interest hierarchical graph attention network in a hierarchical manner based on the hierarchical contrastive learning mechanism, thereby improving the accuracy of the multiple user session feature representations corresponding to multiple user interests, and finally improving the accuracy of item recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 A flowchart of the item recommendation method described in an embodiment of the present application is shown;
[0055] Figure 2A flow chart of a method for generating multiple user interest sub-sessions according to an embodiment of the present application is shown;
[0056] Figure 3 A flow chart of a method for generating a multi-interest hierarchical conversation graph according to an embodiment of the present application is shown;
[0057] Figure 4 A schematic diagram of a process of generating three user interaction subgraphs from a user interest sub-session 1 according to an embodiment of the present application is shown;
[0058] Figure 5 It shows that the embodiment of the present application Figure 4 The 3-layer user interest session graph generated by user interest subsession 1;
[0059] Figure 6 A multi-interest hierarchical conversation graph composed of three generated user interest conversation graphs described in an embodiment of the present application is shown;
[0060] Figure 7 A flowchart of a method for extracting user interest features and item features corresponding to each user interest using a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph according to an embodiment of the present application is shown;
[0061] Figure 8 The hierarchical extraction process of user interests from the first layer to the third layer of the three-layer user interest session graph generated by the user interest subsession 1 is shown. DETAILED DESCRIPTION
[0062] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0063] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0064] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0065] In order to solve the problem of "information overload", information recommendation system has become an effective tool, which can not only help users find the required resources from massive information, but also improve the profits of enterprises and enhance their market competitiveness. Therefore, recommendation system is widely used in the field of e-commerce. Traditional collaborative filtering recommendation method is overly dependent on the user's long-term historical user-item interaction information, which leads to poor recommendation effect in the case of short-term user-item interaction.
[0066] Sequential recommendation methods can make efficient recommendations based on the user's interaction sequence within a certain period of time. However, most of the existing neural network-based recommendation methods are designed for feature extraction of a single user's interests, ignoring the fact that the user-item interaction sequence may usually imply the interests of multiple users, resulting in poor recommendation results.
[0067] Based on this, in an embodiment of the present application, a method and device for recommending an item are provided, wherein the method for recommending an item obtains a target user-item interaction sequence, and inputs the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series; the item recommendation model generates a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-session includes a plurality of items corresponding to the user interests; the item recommendation model constructs a user-item interaction sub-graph of different granularities in the user interest sub-session based on item groups of different granularities for each user interest sub-session, and fuses the user-item interaction sub-graphs of different granularities of each user interest sub-session to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction sub-graphs of different granularities; the item recommendation model combines the time intervals between consecutive item groups in the user-item interaction sub-graphs and the time intervals between items in the item groups, and adopts a multi-interest hierarchical session graph based on the multi-interest hierarchical session graph The hierarchical graph attention network extracts user interest features and item features corresponding to each user interest; the item recommendation model adopts a hierarchical contrast learning mechanism to learn the user interest features corresponding to each user interest, and generates multiple user session feature representations corresponding to multiple user interests based on the extracted user interest features and item features corresponding to each user interest; the item recommendation model screens target recommended items that match multiple user interests from target candidate items based on the multiple user session feature representations; the method extracts multiple user interests of the user, constructs a multi-interest hierarchical conversation graph including multiple levels of multiple user interests based on continuous item groups of different granularities, introduces the time interval information between continuous item groups and the time interval information between items in an item group into the model training at the same time, improves the extraction accuracy of user interest features and item features, and compares the features extracted by the multi-interest hierarchical graph attention network in a hierarchical manner based on the hierarchical contrast learning mechanism, thereby improving the accuracy of the multiple user session feature representations corresponding to multiple user interests, and finally improving the accuracy of item recommendation.
[0068] Please refer to Figure 1 , Figure 1 A flowchart of the item recommendation method described in an embodiment of the present application is shown; Figure 1 As shown, the method comprises the following steps S101-S106:
[0069] S101, obtaining a target user-item interaction sequence, and inputting the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series;
[0070] S102, the item recommendation model generates a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests;
[0071] S103, the item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities;
[0072] S104, the item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph to extract user interest features and item features corresponding to each user interest;
[0073] S105, the item recommendation model adopts a hierarchical contrast learning mechanism to learn the user interest features corresponding to each user interest, and generates a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest;
[0074] S106: The item recommendation model selects target recommended items that match the interests of multiple users from the target candidate items based on the multiple user session feature representations.
[0075] In the step S101, a target user-item interaction sequence is obtained, and the target user-item interaction sequence is input into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series.
[0076] The target user is a user to whom an item is recommended, such as a user of an online shopping platform or a user on a social media platform.
[0077] The target user-item interaction sequence represents the history of the target user's interaction with different items in the past preset time period; these interactions can be purchasing behaviors, clicking behaviors, browsing behaviors, rating behaviors, etc.; for example, a user on an online shopping platform may have purchased mobile phones, headphones, computers and other products, and these products constitute the user's item interaction sequence.
[0078] The target user-item interaction sequence may also be referred to as a user session.
[0079] In the step S102, the item recommendation model generates a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests.
[0080] That is, multiple user interest sub-sessions representing multiple user interests are extracted from the target user-item interaction sequence.
[0081] For details, please refer to Figure 2 The item recommendation model generates a plurality of user interest sub-sessions based on a plurality of user interests contained in the target user-item interaction sequence, including the following steps S201-S203:
[0082] S201, the item recommendation model converts multiple items arranged in time series in the target user-item interaction sequence into item embedding vectors based on the recommendation model embedding layer;
[0083] S202, constructing multiple user interest spaces, mapping the item embedding vector of each item in the target user-item interaction sequence to the multiple user interest spaces respectively, and generating an item feature representation of each item in the user interest space; wherein different user interest spaces correspond to different user interests;
[0084] S203: Determine the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filter out items whose relevance to the user interest does not meet the preset similarity requirement, and generate multiple user interest sub-sessions.
[0085] In some embodiments, determining the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filtering out items whose relevance to the user interest does not meet the preset similarity requirement, and generating multiple user interest sub-sessions includes:
[0086] For the user interest space, an attention mechanism is used to generate feature representations of item groups that contain corresponding user interests.
[0087] Calculate the correlation between the item group feature representation of the user's interest space and the item feature representation of each item;
[0088] Filter out items whose relevance is lower than a preset relevance threshold, and generate multiple user interest sub-sessions; wherein the preset relevance threshold is determined based on an average value of the relevance between all item feature representations and item group feature representations.
[0089] That is to say, multiple user interest spaces are generated first; specifically, a user session (i.e., a target user-item interaction sequence) is input, and after generating an item embedding vector sequence, the item embedding vector sequence is mapped to different latent spaces to generate multiple user interest spaces.
[0090] Then, a user interest subsession is generated; for each user interest space, a user interest subsession is generated by calculating the similarity between item features and item group features, and the user interest subsession implies a user interest.
[0091] Specifically, to generate multiple user interest spaces, first, input the user session (i.e., the target user-item interaction sequence) into the item recommendation model embedding layer to generate an item embedding vector sequence. Then, the item embedding vector sequence is mapped to different user interest spaces respectively. The details are as follows:
[0092] 1) Given a user session s, denoted as Among them, v i is the i-th item that the user interacts with in chronological order in the session, L s is the length of the item sequence in the session. For any item v i ,i∈(1,…,L s ), the one-hot vector e of the item i ∈R N Generate item embedding vectors through the recommendation model embedding layer Right now Where N is the number of all items in the recommendation system, d is the dimension of the item embedding vector, and M∈R d×N is a trainable parameter matrix.
[0093] 2) Embed items into vectors Through K different trainable transformation matrices, they are mapped to K different user interest spaces, and K item feature representations related to the K user interest spaces are generated, as shown in formula (1):
[0094]
[0095] Among them, W k ∈R d×d is the transformation matrix related to the k-th user interest space, Is an item v i The embedding vector of Is an item v i The embedding vector is mapped to the item feature representation in the k-th user interest space. Thus, in the k-th user interest space, for the user session Generate a corresponding item feature representation sequence, recorded as Therefore, K item feature representation sequences are generated from K user interest spaces.
[0096] User interest subsession generation. In each user interest space, generate a feature representation of an item group that contains the user's interest. Then, in each user interest space, calculate the similarity between the feature representation of the item group and the feature representation of each item in the session, and filter out items that are not related to the user interest space to generate a user interest subsession. Finally, multiple user interest subsessions are generated from multiple user interest spaces. The specific implementation steps are as follows:
[0097] 1) For the k-th user interest space, the attention mechanism is used to generate the feature representation of the item group that contains the k-th user interest, as shown in formulas (2) and (3):
[0098]
[0099]
[0100] Among them, g k ∈R d is the feature representation of the item group that contains the k-th user’s interest, Represents the item v in the kth user’s interest space i The characteristic representation of Characterize the feature representation of item vj in the k-th user’s interest space, It is the feature representation of the item For user's interest item group g k The feature represents the contribution of the generated feature, and exp(·) is the exponential function e x , L s is the sequence length of session s, is a trainable parameter vector associated with the k-th user interest space;
[0101] 2) For the kth user interest space, calculate the item group feature representation g k And the feature representation of each item in the session The correlation between As shown in formula (4):
[0102] in, is a trainable parameter vector associated with the k-th user interest space, and are two trainable parameter matrices related to the kth user’s interest space, and σ1(·) is the sigmoid activation function is the tanh activation function
[0103] 3) For the kth user interest space, filter out the feature representation g of the item group k Relevance below threshold , as shown in formula (5):
[0104]
[0105] in, is the feature representation of all items in session s and the feature representation of item groups g k The average value of the relevance value, λ is a tuning parameter used to control the threshold for selecting items; items below the threshold value have a higher relevance value. Set to 0, which means that the item has little relevance to the user's interest and is filtered out.
[0106] 4) After screening, a subsession containing the kth user’s interest is generated according to the item interaction order of session s, denoted as Among them, L k Subsessions k Length of item sequence.
[0107] 5) According to the process from 1) to 4), K user interest sub-sessions are generated from the K user interest spaces.
[0108] In the step S103, the item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities.
[0109] For details, please refer to Figure 3 The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests, including the following steps S301-S303:
[0110] S301, the item recommendation model constructs a user-item interaction subgraph of different granularities in each user interest subsession based on item groups of different granularities; the number of items in the item groups of different granularities is different; and the items in the item groups are continuous items;
[0111] S302, generating a user interest session graph corresponding to each user interest subsession by using a hierarchical manner to generate a user interest session graph corresponding to the user interest subsession;
[0112] S303: Combine the user interest conversation graphs corresponding to different user interest sub-conversations in parallel to generate a multi-interest hierarchical conversation graph containing multiple user interests.
[0113] That is to say, first, a set of user-item interaction subgraphs of different granularities are generated for each user interest subsession; then, the user-item interaction subgraphs of different granularities are hierarchically combined to generate a user interest session graph; finally, the user interest session graphs generated by all user interest subsessions are combined together to construct a multi-interest hierarchical session graph.
[0114] The specific implementation steps are as follows:
[0115] 1) For the k-th user interest subsession, construct a set of H user-item interaction subgraphs of different granularities; specifically, in constructing the first user-item interaction subgraph, a single item in the subsession is taken as an item group, that is, the item group length is 1, and the items are sorted in the order of item group timestamps, that is, by the timestamps of the interaction, to generate a directed user-item interaction subgraph with an item group length of 1. Next, in constructing the second user-item interaction subgraph, any two consecutive items in the subsession are grouped into an item group, that is, the item group length is 2, and the items are sorted in the order of item group timestamps, that is, the average value of the interaction timestamps of the two items in the item group, to generate a directed user-item interaction subgraph with an item group length of 2. The lengths of consecutive items are increased successively to form item groups, and a user-item interaction subgraph is generated until the H-th user-item interaction subgraph is generated, in which the item group length is H. For example, assuming session s u Generate three user interest sub-sessions, which are respectively recorded as user interest sub-session 1, user interest sub-session 2 and user interest sub-session 3; for example, please refer to Figure 4 , Figure 4 The figure shows the process of generating three user interaction subgraphs from user interest subsession 1, namely {v1, v2, v3, v2, v4, v3, v2, v4}, where Figure 4 (a) is the user-item interaction subgraph generated with an item group length of 1. Figure 4 (b) is the user-item interaction subgraph generation with an item group length of 2. Figure 4 (c) is the generation of the user-item interaction subgraph with an item group length of 3.
[0116] 2) Generate a user interest session graph by hierarchically combining H user-item interaction subgraphs of different granularities; specifically, for the kth user interest subsession, the user-item interaction subgraphs are hierarchically combined according to the length of the item group, i.e., the user-item interaction subgraph with an item group length of 1 is placed on the first layer, the user-item interaction subgraph with an item group length of 2 is placed on the second layer, and so on, the user-item interaction subgraph with an item group length of H is placed on the Hth layer, thereby constructing a user interest session graph related to the kth user interest subsession.
[0117] Please refer to Figure 5 , Figure 5 It shows that the embodiment of the present application Figure 4 The three-layer user interest session graph generated by user interest subsession 1 in Figure 1 .
[0118] 3) Using the methods of 1) and 2), K user interest conversation graphs are generated from K user interest sub-conversations, each representing K user interests. The K user interest conversation graphs are combined in parallel to form a multi-interest hierarchical conversation graph containing K user interests.
[0119] Please refer to Figure 6 , Figure 6 Shown by the session u The generated 3 user interest session graphs are composed of a multi-interest hierarchical session graph, where the user interest session Figure 1 The 3-layer user interest session graph generated for user interest subsession 1, user interest session Figure 2 Conversation with user interests Figure 3 User sessions u User interest sub-session 2 and user interest sub-session 3 are generated.
[0120] In the step S104, the item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph to extract user interest features and item features corresponding to each user interest.
[0121] Please refer to Figure 7 The item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network to extract user interest features and item features corresponding to each user interest based on the multi-interest hierarchical conversation graph, including the following steps S701-S704:
[0122] S701, for the user interest conversation graph in the multi-interest hierarchical conversation graph, extract features from each layer of the user-item interaction subgraph in the user interest conversation in turn, and extract feature representations of the item groups in each layer of the user-item interaction subgraph based on the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph;
[0123] S702: for each item group in each layer of the user-item interaction subgraph in the user interest conversation graph of the multi-interest hierarchical conversation graph, a graph attention mechanism is used to update the feature representation of the item group based on the in-degree neighboring points and the out-degree neighboring points of the item group to obtain an updated feature representation of the item group;
[0124] S703, extracting the user interest feature representation of each layer of the user-item interaction subgraph in the user interest conversation graph of the multi-interest hierarchical conversation graph, and updating the user interest feature representation of the user-item interaction subgraph of the higher layer based on the user interest feature representation of the user-item interaction subgraph of the lower layer, to obtain the updated user interest feature representation of each layer;
[0125] S704: Determine the user interest feature and the item feature corresponding to each user interest based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation.
[0126] In the item recommendation method, based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation, the user interest feature and item feature corresponding to each user interest are determined, including:
[0127] The length of the item group in the first-layer user-item interaction subgraph is 1. The feature representation of the item group in the first-layer user-item interaction subgraph is enhanced and updated through the updated user interest features of each layer of the user-item interaction subgraph in the user interest session graph, so as to enhance and update the feature representation of all items and determine the item features of the user interest corresponding to the user interest session graph;
[0128] Obtain high-level user interest feature representation from the top-level user-item interaction subgraph in the user interest conversation graph, and obtain item features from the bottom-level user-item interaction subgraph in the user interest conversation graph;
[0129] Based on the user interest feature representation and the item feature, a set of user interest feature representations and an item feature set of multiple user interest conversation graphs in the multi-interest hierarchical conversation graph are determined.
[0130] That is to say, a multi-interest hierarchical graph attention network is proposed to extract item features and user interest features from a multi-interest hierarchical session graph. In the feature extraction process, the time intervals between consecutive item groups and the time intervals between items in an item group are simultaneously introduced.
[0131] The specific implementation steps are as follows:
[0132] 1) For the kth user interest conversation graph, from the 1st layer to the Hth layer, extract features from each layer of the user-item interaction subgraph in turn; without loss of generality, for the item group u of the hth layer of the user-item interaction subgraph, first initialize the item group u, that is, the feature representation of the 0th layer of the multi-interest hierarchical graph attention network. Considering the two factors of the item features in the item group and the time interval between the items in the group, its feature representation is shown in formula (6):
[0133]
[0134] in, The superscript (h) indicates that item group u is in the user-item interaction subgraph at level h. The superscript (0) indicates that the item group u is in the 0th layer of the multi-interest hierarchical graph attention network. It represents the feature representation of item group u in the h-th layer of the user-item interaction subgraph at layer 0 of the network model. When h≥2, and are any two consecutive items v in item group u i and v i+1 The feature representation of , there are h-1 continuous item pairs, is the continuous item v in item group u i and v i+1 The embedding representation of the time interval between Represents the product of the corresponding elements of two vectors; when h=1, the feature representation of the item group u is the feature representation of a single item in the item group.
[0135] 2) For each item group in the k-th user interest conversation graph, the graph attention mechanism is used to update the feature representation of the item group; since the item group has in-degree neighbors and out-degree neighbors, it is necessary to update the feature representation of the item group from these two perspectives. First, consider the in-degree neighbors of the item group. Specifically, let the in-degree neighbor set of item group u in the h-th user-item interaction subgraph be N(u). Then the in-degree related feature representation of item group u in the l-th layer of the multi-interest hierarchical graph attention network is updated according to formulas (7) and (8):
[0136]
[0137] in, is the updated entry-related feature representation of item group u, is the correlation between item group p and item group u, is a trainable parameter matrix, and are two trainable parameter vectors, T p,u is the embedding vector of the time interval between item group p and item group u, and exp(·) is the exponential function e x , represents the corresponding element product of two vectors, σ(·) is the tanh activation function, Characterize the feature representation of item group p in the hth layer of the model layer l, Characterize the feature representation of item group u at the hth layer in the model layer l;
[0138] 3) In the same way, considering the out-degree neighboring points of the item group, the graph attention mechanism is used to update the out-degree related feature representation of the item group u in the h-th layer user-item interaction subgraph in the multi-interest hierarchical graph attention network layer l, denoted as Then, the in-degree related features of the average item group u are expressed as And out-degree related feature representation As the feature representation of item group u in the l+1th layer of the multi-interest hierarchical graph attention network model, it is denoted as
[0139] 4) At the same time, the user interest feature representation of the h-th layer user-item interaction subgraph is updated. This update takes into account the user interest feature representation of the h-1-th layer user-item interaction subgraph, thereby forming a step-by-step learning of user interests. Specifically, the feature expression of the h-th layer user interest z is updated according to formulas (9) and (10):
[0140]
[0141] Where p is any item group in the h-th layer user-item interaction subgraph, is the correlation between item group p and user interest z, is a trainable parameter matrix, and are two trainable parameter vectors, Represents the characteristic expression of user interest z in the h-1th user-item interaction subgraph in layer l of the model, Characterize the feature representation of user interest z in the hth layer of the model l+1 layer; Characterize the feature representation of item group p at the hth layer in the model layer l; Characterize the feature representation of user interest z in the hth layer of the model layer l; Characterizes the feature representation of item group j in the hth layer of the model layer l; exp(·) is the exponential function e x , represents the element-wise product of two vectors, and σ(·) is the tanh activation function. For example, please refer to Figure 8 , Figure 8 The hierarchical extraction process of user interest features from the first layer to the third layer of the three-layer user interest session graph generated by the user interest subsession 1 is shown;
[0142] 5) For the kth user interest conversation graph, after the update of the user interest feature representation from the 1st layer to the Hth layer is completed, the feature representation of the item group in the 1st layer user-item interaction subgraph is enhanced and updated by using the obtained user interest features of each layer, that is, the feature representation of all items is enhanced and updated. Specifically, for any item v in the 1st layer user-item interaction subgraph, its feature representation Update according to formulas (11) and (12):
[0143]
[0144] in, is the correlation between item v and user interest z in the h-th user-item interaction subgraph, is a trainable parameter matrix, and is a trainable parameter vector, represents the product of the corresponding elements of two vectors, and σ(·) in formula (12) is the tanh activation function; Characterize the feature representation of item v in the first layer of the model l+1 layer; Characterize the feature representation of user interest z in the hth layer of the model l+1 layer; Represents the feature representation of user interest z in the jth layer of the model l+1 layer.
[0145] 5) After the depth superposition of the multi-interest hierarchical graph attention network model, a high-order user interest feature representation is finally obtained from the top layer of each user-item interaction subgraph, i.e., the Hth layer, which is recorded as At the same time, from the bottom layer of each user-item interaction subgraph, i.e. layer 1, a high-order feature representation set of all items is obtained. g k. Therefore, for K user interest conversation graphs, obtain K user interest feature representation sets, denoted as Get the feature representation set of K groups of items, denoted as {G 1 ,…,G K}.
[0146] The item recommendation model adopts a hierarchical contrastive learning mechanism to learn the user interest features corresponding to each user interest, and generates multiple user session feature representations corresponding to multiple user interests based on the extracted user interest features and item features corresponding to each user interest.
[0147] It should be noted that when training the item recommendation model, the process of extracting user interest features and item features from the user-item interaction sequence is the same. The hierarchical contrastive learning mechanism is used in both the model training process and the specific model prediction process to perform contrastive learning on the features extracted by the multi-interest hierarchical graph attention network in a hierarchical manner.
[0148] The item recommendation model is trained based on the following method:
[0149] Acquire a sample user-item interaction sequence, and construct an enhanced sample user-item interaction sequence based on the sample user-item interaction sequence;
[0150] The item recommendation model to be trained learns and outputs user interest features and item features corresponding to each user interest in the sample user-item interaction sequence, as well as user interest feature representations at different levels, and obtains user interest features and item features corresponding to each user interest in the enhanced sample user-item interaction sequence, as well as user interest feature representations at different levels;
[0151] Based on the user interest feature representation of each layer corresponding to each user interest in the sample user-item interaction sequence and the enhanced sample user sequence, a set of positive samples and a set of negative samples are constructed;
[0152] The item recommendation model to be trained learns the user interest features and item features corresponding to each user interest of the sample user-item interaction sequence, and the user interest feature representations at different levels, and generates multiple user session feature representations corresponding to multiple user interests of the sample user-item interaction sequence respectively;
[0153] Based on the set of positive samples, the set of negative samples and the predefined hierarchical multi-interest loss function, the multi-interest non-orthogonal loss function, as well as the multiple user session feature representations corresponding to the multiple user interests of the sample user-item interaction sequence and the predefined cross-entropy loss function, the item recommendation model learning to be trained is optimized to obtain the trained item recommendation model learning; the hierarchical multi-interest loss function is used to fuse the user interest feature representations of different layers to determine the accuracy of the extracted user interest features; the multi-interest non-orthogonal loss function is used to make different user interest feature representations independent of each other; the cross-entropy loss function is used to characterize the gap between the actual item selected by the user next time and the predicted item selected by the user next time.
[0154] Specifically, a hierarchical contrastive learning mechanism is adopted to compare and learn the user interest features extracted by the multi-interest hierarchical graph attention network in a hierarchical manner. The specific implementation steps are as follows:
[0155] 1) For a length of L s User sessions Random sampling μL s items, and obtain the enhanced session s′ related to the session, where μ is the sampling rate. Sessions s and s′ are input into the model respectively, and two sets of user interest representation sets are obtained through the K user interest session graphs of the session, denoted as and in 1≤k≤K, is the H user interest feature expression obtained from the k-th user interest session graph of session s, denoted as Obtain the user interest feature representation for the h-th layer user-item interaction subgraph. Similarly, are the H user interest feature representations obtained from the k-th user interest session graph of the enhanced session s′.
[0156] 2) For any Construct a positive sample pair 1≤h≤H, at the same time, construct a set of 2K-2 negative samples, denoted as S k,(h) , whose inner element x″ z i,(h) and or Form a negative sample pair or where x″ z i,(h) is the user interest representation from the h-th user-item interaction subgraph of U or U′, where i∈{1,2,…,k-1,k+1,…,K}. Thus, the hierarchical multi-interest loss function of the k-th user interest session graph is constructed. As shown in formula (13):
[0157]
[0158] Where sim(a,b)=a T b / (||a||2||b||2π), π is a tuning parameter. Similarly, considering K hierarchical user interest graphs, let ξ cl is the hierarchical multi-interest loss function, denoted as
[0159] 3) At the same time, define the multi-interest non-orthogonal loss function ξ nol , ensuring that multiple interest feature expressions are independent of each other, as shown in formulas (14), (15), and (16):
[0160]
[0161] in, and yes and The standard normalization of Characterize the feature representation of the i-th user interest in the h-th layer user-item interaction subgraph; Characterize the feature representation of the jth user interest in the hth layer user-item interaction subgraph.
[0162] Specifically, the item recommendation model generates a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest, including:
[0163] For each user interest feature and item feature corresponding to the user interest, adding the location information of the item corresponding to the item feature to the item feature to obtain an updated item feature;
[0164] Based on the user interest feature corresponding to each user interest, the updated item feature, and the contribution of each updated item feature to the user interest, a plurality of user session feature representations corresponding to the plurality of user interests are generated.
[0165] That is to say, multiple user session feature representations are generated based on the item features and user interest features learned by the recommendation model; the specific implementation steps are as follows:
[0166] 1) For the item sequence corresponding to the kth user interest conversation graph, the position information of the item is added to the feature representation of the item to improve the accuracy of the recommendation; specifically, a trainable reverse position matrix P = [p1,…,p n ], n is the number of items in the item sequence. For each item, the feature representation Update according to formula (17):
[0167]
[0168] in, is the item v in the kth user interest session graph i The characteristic representation of is the updated item feature representation, W pos ∈R d×2d is a trainable parameter matrix, b pos ∈R d A trainable bias vector. The feature representation of the item with the item position information added is denoted by G′ k .
[0169] 2) User interest feature representation obtained for the kth user interest conversation graph and the feature representation set G′ of the item k , get the feature representation of the kth user interest conversation graph As shown in formulas (18), (19) and (20):
[0170]
[0171] in, The weighted feature representation that characterizes the k-th user interest conversation graph; i It is the characteristic representation of the item Contribution to the weighted feature representation of the user interest conversation graph, w i,z ∈R 1×d and w j,z ∈R 1×d is a trainable parameter vector, is a trainable parameter matrix, represents the product of the corresponding elements of two vectors, and σ(·) is the tanh activation function. Therefore, for K user interest conversation graphs, the feature expressions of K user interest conversation graphs can be obtained, that is, the feature expressions of multiple user conversations corresponding to multiple user interests, which are recorded as the set
[0172] In the step S106, the item recommendation model screens out target recommended items that match the interests of multiple users from the target candidate items based on the multiple user session feature representations.
[0173] The item recommendation model selects target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations, including:
[0174] Based on the multiple user interests respectively corresponding to the multiple user session feature representations, respectively, the probability of the target candidate item being recommended for each user interest is calculated, and the maximum probability is selected as the probability of the target candidate item being finally recommended;
[0175] From the probabilities of all target candidate items being finally recommended, select the target recommended items whose probabilities of being finally recommended meet the preset recommendation conditions.
[0176] Exemplarily, the probability of each target candidate item being recommended according to each user's interest is ranked, and a preset number of target recommended items ranked first are selected for display based on the ranking result.
[0177] Exemplarily, target recommended items whose probability of being recommended is greater than a preset probability threshold are filtered.
[0178] The item recommendation model screens target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations, and is also applicable to both the training phase and the phase of using the model for prediction.
[0179] The candidate item ratings are predicted based on multiple session feature representations. In the training phase, the model is trained based on the prediction results. After the training is completed, items with higher ratings are selected based on the prediction results to form a list of recommended items. The specific implementation steps are as follows:
[0180] 1) For any item v in the candidate item set i , for K user interests, calculate the probability of the item being recommended, as shown in formula (21):
[0181]
[0182] in, Is an item v i Probability of being recommended; Characterizing itemsv i The corresponding updated item feature representation.
[0183] 2) During the training phase, define the cross entropy loss function ξ ce , used to optimize the model, as shown in formula (22),
[0184]
[0185] Among them, y i Represents the true label value of the target candidate item; Characterizes the predicted selection probability of the target candidate item; V is the number of candidate items; the goal of model training is to minimize the sum of cross entropy loss, hierarchical multi-interest loss and multi-interest non-orthogonal loss ξ, as shown in formula (23):
[0186] ξ=ξ ce +δ cl ξ cl +δ nol ξ nol (twenty three);
[0187] Among them, δ cl is a parameter used to regulate the hierarchical multi-interest loss, δ nol is a parameter used to regulate the multi-interest non-orthogonal loss, ξ cl is the hierarchical multi-interest loss function, ξ nol is a multi-interest non-orthogonal loss function.
[0188] Based on the same inventive concept, an item recommendation device corresponding to the item recommendation method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned item recommendation method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0189] In some embodiments, an item recommendation device is further provided, the device comprising:
[0190] An acquisition module, used to acquire a target user-item interaction sequence, and input the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series;
[0191] A first generating module is used to enable the item recommendation model to generate a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests;
[0192] The second generation module is used to enable the item recommendation model to construct user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and to fuse the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities;
[0193] An extraction module, configured to enable the item recommendation model to combine the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and to extract user interest features and item features corresponding to each user interest using a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph;
[0194] A third generation module is used to enable the item recommendation model to learn the user interest features corresponding to each user interest by adopting a hierarchical contrast learning mechanism, and generate a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest;
[0195] The screening module is used to enable the item recommendation model to screen out target recommended items that match the interests of multiple users from the target candidate items based on the multiple user session feature representations.
[0196] In some embodiments, the item recommendation device further includes:
[0197] A training module, used to obtain a sample user-item interaction sequence, and construct an enhanced sample user-item interaction sequence based on the sample user-item interaction sequence;
[0198] The item recommendation model to be trained learns and outputs user interest features and item features corresponding to each user interest in the sample user-item interaction sequence, as well as user interest feature representations at different levels, and obtains user interest features and item features corresponding to each user interest in the enhanced sample user-item interaction sequence, as well as user interest feature representations at different levels;
[0199] Based on the user interest feature representation of each layer corresponding to each user interest in the sample user-item interaction sequence and the enhanced sample user sequence, a set of positive samples and a set of negative samples are constructed;
[0200] The item recommendation model to be trained learns the user interest features and item features corresponding to each user interest of the sample user-item interaction sequence, and the user interest feature representations at different levels, and generates multiple user session feature representations corresponding to multiple user interests of the sample user-item interaction sequence respectively;
[0201] Based on the set of positive samples, the set of negative samples and the predefined hierarchical multi-interest loss function, the multi-interest non-orthogonal loss function, as well as the multiple user session feature representations corresponding to the multiple user interests of the sample user-item interaction sequence and the predefined cross-entropy loss function, the item recommendation model learning to be trained is optimized to obtain the trained item recommendation model learning; the hierarchical multi-interest loss function is used to fuse the user interest feature representations of different layers to determine the accuracy of the extracted user interest features; the multi-interest non-orthogonal loss function is used to make different user interest feature representations independent of each other; the cross-entropy loss function is used to characterize the gap between the actual item selected by the user next time and the predicted item selected by the user next time.
[0202] In some embodiments, the first generating module in the item recommendation device, when enabling the item recommendation model to generate multiple user interest sub-sessions based on multiple user interests contained in the target user-item interaction sequence, is specifically used to:
[0203] The item recommendation model converts multiple items arranged in time series in the target user-item interaction sequence into item embedding vectors based on the recommendation model embedding layer;
[0204] Constructing multiple user interest spaces, mapping the item embedding vector of each item in the target user-item interaction sequence to the multiple user interest spaces respectively, and generating item feature representations of each item in the user interest space; wherein different user interest spaces correspond to different user interests;
[0205] Determine the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filter out items whose relevance to the user interest does not meet the preset similarity requirement, and generate multiple user interest sub-sessions.
[0206] In some embodiments, the first generation module in the item recommendation device, when determining the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filtering out items whose relevance to the user interest does not meet the preset similarity requirement, and generating multiple user interest sub-sessions, is specifically used to:
[0207] For the user interest space, an attention mechanism is used to generate feature representations of item groups that contain corresponding user interests.
[0208] Calculate the correlation between the item group feature representation of the user's interest space and the item feature representation of each item;
[0209] Filter out items whose relevance is lower than a preset relevance threshold, and generate multiple user interest sub-sessions; wherein the preset relevance threshold is determined based on an average value of the relevance between all item feature representations and item group feature representations.
[0210] In some embodiments, the second generation module in the item recommendation device is specifically used to: construct user-item interaction subgraphs of different granularities in the user interest subsession based on item groups of different granularities for each user interest subsession in the item recommendation model, and fuse the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests.
[0211] The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities; the number of items in the item groups of different granularities is different; and the items in the item groups are continuous items;
[0212] The user-item interaction subgraphs of different granularities corresponding to each user interest subsession are hierarchically used to generate a user interest session graph corresponding to the user interest subsession;
[0213] The user interest conversation graphs corresponding to different user interest sub-conversations are combined in parallel to generate a multi-interest hierarchical conversation graph containing multiple user interests.
[0214] In some embodiments, the extraction module in the item recommendation device, when combining the item recommendation model with the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and extracting user interest features and item features corresponding to each user interest based on the multi-interest hierarchical conversation graph using a multi-interest hierarchical graph attention network, is specifically used to:
[0215] For the user interest session graph in the multi-interest hierarchical session graph, feature extraction is performed on each layer of the user-item interaction subgraph in the user interest session in turn, and the feature representation of the item group in each layer of the user-item interaction subgraph is extracted by combining the time interval between consecutive item groups and the time interval between items in the item group in the user-item interaction subgraph;
[0216] For each item group in each layer of the user-item interaction subgraph of the user interest conversation graph in the multi-interest hierarchical conversation graph, a graph attention mechanism is used to update the feature representation of the item group based on the in-degree neighboring points and the out-degree neighboring points of the item group to obtain an updated feature representation of the item group;
[0217] Extracting user interest feature representations of each layer of user-item interaction subgraphs in the user interest conversation graph of the multi-interest hierarchical conversation graph, and updating user interest feature representations of a higher layer of user-item interaction subgraphs based on the user interest feature representations of a lower layer of user-item interaction subgraphs, to obtain updated user interest feature representations of each layer;
[0218] Based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation, the user interest feature and the item feature corresponding to each user interest are determined.
[0219] In some embodiments, the extraction module in the item recommendation device, when determining the user interest feature and item feature corresponding to each user interest based on the updated feature representation of the item group and the updated user interest feature representation of each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph, is specifically used to:
[0220] The length of the item group in the first-layer user-item interaction subgraph is 1. The feature representation of the item group in the first-layer user-item interaction subgraph is enhanced and updated through the updated user interest features of each layer of the user-item interaction subgraph in the user interest session graph, so as to enhance and update the feature representation of all items and determine the item features of the user interest corresponding to the user interest session graph;
[0221] Obtain high-level user interest feature representation from the top-level user-item interaction subgraph in the user interest conversation graph, and obtain item features from the bottom-level user-item interaction subgraph in the user interest conversation graph;
[0222] Based on the user interest feature representation and the item feature, a set of user interest feature representations and an item feature set of multiple user interest conversation graphs in the multi-interest hierarchical conversation graph are determined.
[0223] In some embodiments, the third generation module in the item recommendation device is specifically used to:
[0224] For each user interest feature and item feature corresponding to the user interest, adding the location information of the item corresponding to the item feature to the item feature to obtain an updated item feature;
[0225] Based on the user interest feature corresponding to each user interest, the updated item feature, and the contribution of each updated item feature to the user interest, a plurality of user session feature representations corresponding to the plurality of user interests are generated.
[0226] In some embodiments, the screening module in the item recommendation device is specifically used to:
[0227] Based on the multiple user interests respectively corresponding to the multiple user session feature representations, respectively, the probability of the target candidate item being recommended for each user interest is calculated, and the maximum probability is selected as the probability of the target candidate item being finally recommended;
[0228] From the probabilities of all target candidate items being finally recommended, select the target recommended items whose probabilities of being finally recommended meet the preset recommendation conditions.
[0229] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0230] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0231] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0232] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0233] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An item recommendation method, characterized in that: The method comprises the following steps: Obtaining a target user-item interaction sequence, and inputting the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series; The item recommendation model generates a plurality of user interest sub-sessions based on a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests; The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities; The item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph to extract user interest features and item features corresponding to each user interest; The item recommendation model adopts a hierarchical contrastive learning mechanism to learn the user interest features corresponding to each user interest, and generates a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest; The item recommendation model screens target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations.
2. The item recommendation method according to claim 1, characterized in that: The item recommendation model is trained based on the following method: Acquire a sample user-item interaction sequence, and construct an enhanced sample user-item interaction sequence based on the sample user-item interaction sequence; The item recommendation model to be trained learns and outputs user interest features and item features corresponding to each user interest in the sample user-item interaction sequence, as well as user interest feature representations at different levels, and obtains user interest features and item features corresponding to each user interest in the enhanced sample user-item interaction sequence, as well as user interest feature representations at different levels; Based on the user interest feature representation of each layer corresponding to each user interest in the sample user-item interaction sequence and the enhanced sample user sequence, a set of positive samples and a set of negative samples are constructed; The item recommendation model to be trained learns the user interest features and item features corresponding to each user interest of the sample user-item interaction sequence, and the user interest feature representations at different levels, and generates multiple user session feature representations corresponding to multiple user interests of the sample user-item interaction sequence respectively; Based on the set of positive samples, the set of negative samples and the predefined hierarchical multi-interest loss function, the multi-interest non-orthogonal loss function, as well as the multiple user session feature representations corresponding to the multiple user interests of the sample user-item interaction sequence and the predefined cross-entropy loss function, the item recommendation model learning to be trained is optimized to obtain the trained item recommendation model learning; the hierarchical multi-interest loss function is used to fuse the user interest feature representations of different layers to determine the accuracy of the extracted user interest features; the multi-interest non-orthogonal loss function is used to make different user interest feature representations independent of each other; the cross-entropy loss function is used to characterize the gap between the actual item selected by the user next time and the predicted item selected by the user next time.
3. The item recommendation method according to claim 1, characterized in that: The item recommendation model generates a plurality of user interest sub-sessions based on a plurality of user interests contained in the target user-item interaction sequence, including: The item recommendation model converts multiple items arranged in time series in the target user-item interaction sequence into item embedding vectors based on the recommendation model embedding layer; Constructing multiple user interest spaces, mapping the item embedding vector of each item in the target user-item interaction sequence to the multiple user interest spaces respectively, and generating item feature representations of each item in the user interest space; wherein different user interest spaces correspond to different user interests; Determine the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filter out items whose relevance to the user interest does not meet the preset similarity requirement, and generate multiple user interest sub-sessions.
4. The item recommendation method according to claim 3, characterized in that: Determine the similarity between the item feature representation of each item in the user interest space and the corresponding user interest, filter out items whose relevance to the user interest does not meet the preset similarity requirement, and generate multiple user interest sub-sessions, including: For the user interest space, an attention mechanism is used to generate feature representations of item groups that contain corresponding user interests. Calculate the correlation between the item group feature representation of the user's interest space and the item feature representation of each item; Filter out items whose relevance is lower than a preset relevance threshold, and generate multiple user interest sub-sessions; wherein the preset relevance threshold is determined based on an average value of the relevance between all item feature representations and item group feature representations.
5. The item recommendation method according to claim 1, characterized in that: The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and fuses the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests, including: The item recommendation model constructs user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities; the number of items in the item groups of different granularities is different; and the items in the item groups are continuous items; The user-item interaction subgraphs of different granularities corresponding to each user interest subsession are hierarchically used to generate a user interest session graph corresponding to the user interest subsession; The user interest conversation graphs corresponding to different user interest sub-conversations are combined in parallel to generate a multi-interest hierarchical conversation graph containing multiple user interests.
6. The item recommendation method according to claim 1, characterized in that: The item recommendation model combines the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and uses a multi-interest hierarchical graph attention network to extract user interest features and item features corresponding to each user interest based on the multi-interest hierarchical conversation graph, including: For the user interest session graph in the multi-interest hierarchical session graph, feature extraction is performed on each layer of the user-item interaction subgraph in the user interest session in turn, and the feature representation of the item group in each layer of the user-item interaction subgraph is extracted by combining the time interval between consecutive item groups and the time interval between items in the item group in the user-item interaction subgraph; For each item group in each layer of the user-item interaction subgraph of the user interest conversation graph in the multi-interest hierarchical conversation graph, a graph attention mechanism is used to update the feature representation of the item group based on the in-degree neighboring points and the out-degree neighboring points of the item group to obtain an updated feature representation of the item group; Extracting user interest feature representations of each layer of user-item interaction subgraphs in the user interest conversation graph of the multi-interest hierarchical conversation graph, and updating user interest feature representations of a higher layer of user-item interaction subgraphs based on the user interest feature representations of a lower layer of user-item interaction subgraphs, to obtain updated user interest feature representations of each layer; Based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation, the user interest feature and the item feature corresponding to each user interest are determined.
7. The item recommendation method according to claim 6, characterized in that: Determining the user interest features and item features corresponding to each user interest based on the updated feature representation of the item group in each layer of the user-item interaction subgraph in the user interest conversation graph in the multi-interest hierarchical conversation graph and the updated user interest feature representation, including: The length of the item group in the first-layer user-item interaction subgraph is 1. The feature representation of the item group in the first-layer user-item interaction subgraph is enhanced and updated through the updated user interest features of each layer of the user-item interaction subgraph in the user interest session graph, so as to enhance and update the feature representation of all items and determine the item features of the user interest corresponding to the user interest session graph; Obtain high-level user interest feature representation from the top-level user-item interaction subgraph in the user interest conversation graph, and obtain item features from the bottom-level user-item interaction subgraph in the user interest conversation graph; Based on the user interest feature representation and the item feature, a set of user interest feature representations and an item feature set of multiple user interest conversation graphs in the multi-interest hierarchical conversation graph are determined.
8. The item recommendation method according to claim 1, characterized in that: The item recommendation model generates a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest, including: For each user interest feature and item feature corresponding to the user interest, adding the location information of the item corresponding to the item feature to the item feature to obtain an updated item feature; Based on the user interest feature corresponding to each user interest, the updated item feature, and the contribution of each updated item feature to the user interest, a plurality of user session feature representations corresponding to the plurality of user interests are generated.
9. The item recommendation method according to claim 1, characterized in that: The item recommendation model selects target recommended items that match the interests of multiple users from target candidate items based on the multiple user session feature representations, including: Based on the multiple user interests respectively corresponding to the multiple user session feature representations, respectively, the probability of the target candidate item being recommended for each user interest is calculated, and the maximum probability is selected as the probability of the target candidate item being finally recommended; From the probabilities of all target candidate items being finally recommended, select the target recommended items whose probabilities of being finally recommended meet the preset recommendation conditions.
10. An item recommendation device, characterized in that: The device comprises: An acquisition module, used to acquire a target user-item interaction sequence, and input the target user-item interaction sequence into a trained item recommendation model; the target user-item interaction sequence includes a plurality of items arranged in a time series; A first generating module is used to enable the item recommendation model to generate a plurality of user interest sub-sessions corresponding to a plurality of user interests contained in the target user-item interaction sequence; the user interest sub-sessions include a plurality of items corresponding to the user interests; The second generation module is used to enable the item recommendation model to construct user-item interaction subgraphs of different granularities in each user interest subsession based on item groups of different granularities, and to fuse the user-item interaction subgraphs of different granularities of each user interest subsession to generate a multi-interest hierarchical session graph containing multiple user interests; different layers of the multi-interest hierarchical session graph correspond to user-item interaction subgraphs of different granularities; An extraction module, configured to enable the item recommendation model to combine the time intervals between consecutive item groups and the time intervals between items in an item group in the user-item interaction subgraph, and to extract user interest features and item features corresponding to each user interest using a multi-interest hierarchical graph attention network based on the multi-interest hierarchical conversation graph; A third generation module is used for the item recommendation model to learn the user interest features corresponding to each user interest by adopting a hierarchical contrast learning mechanism, and to generate a plurality of user session feature representations corresponding to a plurality of user interests respectively based on the extracted user interest features and item features corresponding to each user interest; The screening module is used to enable the item recommendation model to screen out target recommended items that match the interests of multiple users from the target candidate items based on the multiple user session feature representations.