A sequence recommendation method and apparatus based on user popularity preferences
Patent Information
- Application Number
- CN202310752863.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-06-25
AI Technical Summary
[0004]综上,虽然用户流行偏好已经得到了广泛的研究,但是现有的方法不能全面的涵盖的用户的各种流行偏好
[0038]1.本发明提出了一个序列流行度感知模块来全面的提取用户流行度偏好的类型和演变规律,因此,可以给出和用户流行度偏好一致的推荐。
Smart Images

Figure CN116861076B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of popularity prediction technology, and in particular relates to a sequence recommendation method and apparatus based on user popularity preferences. Background Technology
[0002] In recent years, sequence recommendation has attracted academic attention due to its excellent performance and has been widely applied in industry, such as e-commerce recommendations, news recommendations, and music recommendations. Sequence recommendation combines the user's interaction history with the time of these interactions to analyze and obtain trends in user interests over time, thereby more accurately predicting future user interests and providing more suitable recommendations. For example, a Chinese patent (application number: CN202110589775.7, publication number: CN113313381A) implements a user interaction-sensitive dynamic graph sequence recommendation system. This system first collects timestamped rating data of users for products and user attribute data. Then, the sequence graph modeling module obtains the dependencies and similarities between products by merging similar points from the collected data and transforms the relationships into a graph. The dynamic environment modeling module adds the user's interaction sequence as fixed-point information to the graph. The environment state representation module uses a graph attention neural network to learn the user's real-time interests in products from the graph, thereby assisting the intelligent agent decision-making model in making personalized recommendations. Chinese patent (application number: CN202010283469.6, publication number: CN111582492A) uses a deconstructed self-supervised learning method to enhance sequence recommendation. This method first constructs a sequence of items interacted with by each user in chronological order, then builds an encoder to learn user intent and deconstruct it. Next, the method decomposes the sequence into an input sequence and a label sequence. Then, self-supervised learning is performed by predicting the label sequence using the input sequence. Through the aforementioned user intent deconstruction and self-supervised framework, this method has stronger resistance to noise, thus achieving a higher signal-to-noise ratio. Furthermore, this method can more accurately and comprehensively capture multiple user intents and make recommendations.
[0003] However, in recommendation systems, different users exhibit different types of popularity preferences. Many users are highly sensitive to whether an item is popular. For example, some users prefer best-selling items, while others prefer less popular items to showcase their taste and personality. Other users are less sensitive to popularity, focusing more on features such as price and appearance. Furthermore, users' popularity preferences are not static but vary over time. For instance, a user's attitude towards brand names may change with age. Because diverse and personalized user popularity preferences reveal what items users like, comprehensively identifying user popularity preferences is crucial for making accurate and personalized recommendations.
[0004] In summary, while user popularity preferences have been extensively studied, existing methods cannot comprehensively cover all user preferences. Some methods only consider users who like popular items, while others ignore these users, and still others ignore users who like items with low to medium popularity. Furthermore, most methods fail to capture dynamic user popularity preferences. Therefore, existing methods may misidentify the popularity preferences of some users, leading to inappropriate recommendations. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes a sequence recommendation method and apparatus based on user popularity preferences, in order to comprehensively capture diverse and dynamic user popularity preferences.
[0006] The technical solution of the present invention includes:
[0007] A sequence recommendation method based on user popularity preferences, the method comprising:
[0008] Based on the user-item interaction data in the training set, construct a user behavior sequence in chronological order;
[0009] Based on the sequence recommendation model, user feature sequences are obtained from the user behavior sequences, and combined with the corresponding item tags in the training set, the basic loss of the sequence recommendation model is calculated.
[0010] The user behavior sequence is divided into multiple consecutive subsequences, and the corresponding popularity preference labels are statistically derived from the training set. The popularity preference G, obtained based on the feature representations of each subsequence, is used to derive the denoising loss of the sequence recommendation model; wherein the features of each subsequence are derived based on the corresponding user feature sequences.
[0011] Similar users in a batch of training samples are treated as positive samples, and dissimilar users are treated as negative samples. Contrastive learning is used to bring positive samples closer and push negative samples further apart to obtain the contrastive learning loss of the sequence recommendation model; wherein, the similar users are the popularity preference labels corresponding to the training samples. The difference is less than the first set value, and the cos similarity of the corresponding user popularity preference feature user-item interaction sequence feature representation is greater than the second set value for user pairs;
[0012] The sequence recommendation model is trained and optimized based on the base loss, denoising loss, and contrastive learning loss, thereby obtaining the recommendation results of the user-item interaction sequence to be detected.
[0013] Furthermore, the user behavior sequence is divided into multiple consecutive subsequences, and the subsequences are determined based on the labels of the corresponding popularity preference sets statistically obtained from the training set. The guide is based on the popularity preference G obtained from the feature representations of each subsequence, to obtain the denoising loss of the sequence recommendation model, including:
[0014] The user behavior sequence is divided into multiple sub-sequences;
[0015] Based on the feature extraction module in the sequence recommendation model, the user feature sequences corresponding to the sub-sequences are averaged to obtain the sub-sequence features; the sub-sequence features also include: sub-sequence position feature representation;
[0016] Fully connected layers are used to extract user popularity preference features for the corresponding time period from subsequence features.
[0017] The average popularity preference feature representation of users is calculated based on the popularity preference feature representation of each time period, and the user's popularity preference G is predicted based on the average feature representation.
[0018] Labels from the corresponding popularity preference set in the training set. The popularity preference G is used to guide the denoising loss of the sequence recommendation model. Among them, prediction error α p q represents the first set value, and q represents the summation index.
[0019] Furthermore, the popularity preference label It is obtained based on the mean and variance of the popularity preference set corresponding to the user.
[0020] Furthermore, the contrastive learning loss Where u represents a user in a training batch, and i represents the set φ of positive samples belonging to user u in the training batch. posIn the training batch, j represents another user, φ neg Let τ represent the set of negative samples belonging to user u in the training batch, and let τ represent the temperature coefficient.
[0021] Furthermore, the similar users are the tags. The difference is less than the first set value, including:
[0022] calculate in, This represents the popularity preference label for user t in a training batch. This represents the popularity preference label corresponding to user u in a training batch.
[0023] exist In the case where user t and user u satisfy the first condition that they are similar users; where α p Indicates the first set value;
[0024] exist In the case of user t and user u, it is determined that user t and user u do not meet the first condition of being similar users.
[0025] Furthermore, the cosine similarity of the feature representation of the corresponding user-item interaction sequence is less than a second preset value, including:
[0026] Calculate cos(B) l-1,t B l-1,u ); where B l-1,t B represents the feature representation obtained after the (l-1)th training accumulation of the user behavior sequence corresponding to user t. l-1,u This represents the feature representation obtained after the (l-1)th training accumulation of the user behavior sequence corresponding to user u. The training accumulation process is as follows: β is the weighting coefficient. This represents the user's global characteristics. It is obtained by averaging the corresponding user feature sequences;
[0027] In cos(B) l-1,t B l-1,u )>α s In the case where user t and user u satisfy the second condition that they are similar users; where α s Indicates the second set value;
[0028] In cos(B) l-1,t B l-1,u )<α s In the case of [the user t], it is determined that user t and user u do not satisfy the second condition of being similar users.
[0029] A sequence recommendation device based on user popularity preferences, the device comprising:
[0030] The data preprocessing module is used to construct a user behavior sequence in chronological order based on the user-item interaction data in the training set.
[0031] The base model is used to obtain the user's popularity preference features from the user behavior sequence based on the sequence recommendation model, and combine them with the corresponding item tags in the training set to calculate the base loss of the sequence recommendation model.
[0032] The sequence popularity awareness module is used to obtain user feature sequences from the user behavior sequences based on the sequence recommendation model, and calculate the basic loss of the sequence recommendation model by combining the corresponding item tags in the training set.
[0033] The contrastive learning module is used to treat similar users in a batch of training samples as positive samples and dissimilar users as negative samples. Through contrastive learning, it brings positive samples closer together and pushes negative samples further apart to obtain the contrastive learning loss of the sequence recommendation model. Here, the similar users are the popularity preference tags corresponding to the training samples. The difference is less than the first set value, and the cos similarity of the corresponding user popularity preference feature user-item interaction sequence feature representation is greater than the second set value for user pairs;
[0034] The training and prediction module is used to train and optimize the sequence recommendation model based on the base loss, denoising loss and contrastive learning loss, so as to obtain the recommendation results of the user-item interaction sequence to be detected.
[0035] A computer device includes: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the sequence recommendation method based on user popularity preferences as described above.
[0036] A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the sequence recommendation method based on user popularity preferences as described above.
[0037] Compared with existing methods, the present invention has at least the following advantages:
[0038] 1. This invention proposes a sequence popularity perception module to comprehensively extract the type and evolution pattern of user popularity preferences, thus providing recommendations consistent with user popularity preferences.
[0039] 2. This invention proposes a popularity-based contrastive learning module that clusters similar users based on popularity preferences and general characteristics, thus enabling more accurate capture of user interests. Attached Figure Description
[0040] Figure 1 Architecture diagram of a sequence recommendation method based on user popularity preferences.
[0041] Figure 2 A flowchart illustrating a sequence recommendation method based on user popularity preferences. Detailed Implementation
[0042] The present invention will now be described in detail with reference to the embodiments and accompanying drawings. The following embodiments only represent one possible implementation of the present invention and are not intended to limit the present invention.
[0043] The sequence recommendation method based on user popularity preferences of this invention provides a complete recommendation system architecture, such as... Figure 1 As shown, it mainly consists of three parts: a basic model, a sequence popularity perception module, and a popularity-based contrastive learning module.
[0044] First, the base model extracts users' serialized features from user behavior sequences. Then, the sequence popularity perception module perceives the type and evolution pattern of users' popularity preferences. Finally, the popularity-based contrastive learning module groups users with similar popularity preferences together through contrastive learning. The model of this invention provides more personalized recommendations by comprehensively capturing users' popularity preferences.
[0045] According to the design scheme provided by this invention: a sequence recommendation method based on user popularity preferences, specifically includes the following steps:
[0046] 1. Data Preprocessing Module
[0047] The data preprocessing stage arranges the user's historical records in chronological order and extracts the timestamp information of the historical records. Let represent the sets of users and items, respectively. A user behavior sequence for user u is then represented as... The corresponding timestamp sequence is represented as To facilitate training, the user's history records are trimmed into a fixed-length sequence of length n. For sequences shorter than n, blank placeholders are added, and for sequences longer than n, redundant records at the beginning of the sequence are removed.
[0048] 2. Basic Model.
[0049] To capture dynamic user interests, this invention employs a conventional sequence recommendation method as its basic model. Existing sequence recommendation methods typically include the following steps.
[0050] 1) Using user behavior sequence S u For input.
[0051] 2) These methods generate feature representations H∈R of sequences using neural networks (such as RNNs and attention mechanisms). n×d Where d represents the embedding length, H i This represents the user's interest at the moment of the i-th item in the user interaction sequence.
[0052] 3) Based on user characteristics H i The final recommendation is given based on the characteristics of the items.
[0053] The method of this invention only requires the basic model to generate the sequence feature representation H. i Regardless of the type of neural network used in the base model, and regardless of whether it has other inputs and outputs, it can serve as the base model for this invention. Since the above steps are very common in sequence recommendation, this ensures the versatility of the model of this invention.
[0054] In one embodiment, the base model loss is obtained by inputting the feature representation H into the base model and then applying the cross-entropy loss.
[0055] 3. Sequence Popularity Awareness Module
[0056] To perceive the evolving trends of user popularity preferences, this invention requires analyzing user popularity preferences across different time periods. This invention uses user behavior sequences S... u The sequence is divided into L fixed-length subsequences. The feature representation of each subsequence is obtained by averaging the user sequence features. Furthermore, this invention adds a new positional feature representation to each subsequence to learn the order information between the subsequences.
[0057] Next, this invention combines user feature representations from different time periods through two fully connected layers to predict user popularity preferences. This invention uses the mean and variance of the user popularity preference set as training labels for the prediction and applies a denoising-based loss function (hereinafter referred to as the denoising loss function), thereby enabling the user sequence features and the prediction neural network to perceive user popularity preferences. Furthermore, this invention obtains the final prediction model structure through sub-sequences, allowing the model to capture the evolution process of user popularity preferences. Specifically, it averages user popularity preferences across different time periods and then passes this averaged over a fully connected layer to accurately perceive user popularity preferences.
[0058] 4. Popularity-based comparative learning module
[0059] This module groups similar users together to more accurately capture user interests. If two users share the same popularity preferences and common characteristics, this invention identifies them as similar users. Common characteristics refer to features obtained using regular sequence recommendations, i.e., user behavior sequences S. u The feature representation H is obtained from the input base model. For a user, this invention treats similar users in the same batch as positive samples and other users as negative samples. Then, contrastive learning is used to bring positive samples closer together and push negative samples further apart, and the contrastive learning loss is calculated. In this way, contrastive learning makes similar users closer together in the feature space, thereby enabling a more accurate acquisition of user interests.
[0060] 5. Training and Prediction Module
[0061] During training, this invention performs end-to-end training on the sequence recommendation model based on base loss, denoising loss, and contrastive learning loss. After training, the user-item interaction sequence to be detected is input into the trained model to obtain the recommendation result for that interaction sequence.
[0062] The invention will be further explained below using an example of N users and M items. Figure 2 As shown, the present invention includes the following steps.
[0063] Step 1. Construct a sequence of user behaviors in chronological order based on the user-item interaction data in the training set.
[0064] The data preprocessing stage arranges the user's historical records in chronological order and extracts the timestamp information of the historical records. Let represent the sets of users and items, respectively. The historical sequence of a user u is represented as . The corresponding timestamp sequence is represented as To facilitate training, the user's history records are trimmed into a fixed-length sequence of length n. For sequences shorter than n, blank placeholders are added, and for sequences longer than n, redundant records at the beginning of the sequence are removed.
[0065] Step 2. Calculate the basic loss of the sequence recommendation model.
[0066] Given a sequence of user data, the base model generates a feature representation H of the user sequence. i Then, by combining the corresponding item labels in the training set, the basic loss of the sequence recommendation model can be calculated.
[0067] Step 3. Calculate the denoising loss for the sequence recommendation model.
[0068] This module expects H iIt possesses the ability to perceive user popularity preferences. First, the user behavior sequence is segmented into multiple subsequences, and the features of each subsequence are derived from averaged user features: Where φ i It is the set of user behaviors in the i-th subsequence, O i This is a representation of the subsequence position features. Then, this invention uses fully connected layers to generate user feature representations for each time period: Subsequently, the present invention averages user features across different time periods and adds another fully connected layer to predict user popularity preferences G based on the average feature representation E of all subsequences: G = GELU(EW3 + b3)W4 + b4. Finally, to guide G, this invention uses the mean and variance of the user popularity preference set as the predicted label. A denoising loss function was applied for training. Prediction error W and b represent the parameters of the fully connected layer, and q represents the summation index.
[0069] Step 4. Calculate the contrastive learning loss for the sequence recommendation model.
[0070] To cluster similar users, this invention first learns the similarity of users. For users t and u, their similarity is: in, E is a matrix representing the user's popularity characteristics.
[0071] To train the aforementioned similarity, this invention treats users who meet the following two conditions as positive samples and other users as negative samples. The first condition requires that the difference between the mean and variance of the popularity preferences of users t and u is less than a set value α. p It can be represented as: The second condition is that the cosine similarity of the regular features of users t and u is less than the set value α. s It can be represented as: cos(B) l-1,t B l-1,u )<α s This utilizes user-defined routine features that accumulate with training. These are user features that accumulate during training. Finally, this invention uses contrastive learning for training: This allows similar users to cluster in the feature space. Here, Pos represents the set of positive samples, neg represents the set of negative samples, and τ represents the temperature coefficient.
[0072] 5. The sequence recommendation model is trained and optimized based on the base loss, denoising loss and contrastive learning loss, and then the recommendation results of the user-item interaction sequence to be detected are obtained.
[0073] During training, this invention performs end-to-end training on the sequence recommendation model based on base loss, denoising loss, and contrastive learning loss. After training, the user-item interaction sequence to be detected is input into the trained model to obtain the recommendation result for that interaction sequence.
[0074] In summary, to comprehensively cover various popular user preferences, this invention first defines an item's popularity as the number of users who have interacted with it, and then constructs a set of the popularity of items interacted with by a single user. Next, this invention analyzes these sets to understand user popularity preferences. 1) To determine whether users prefer items with high, medium, or low popularity, this invention calculates the average value of the popularity sets. 2) This invention uses the standard deviation of the popularity sets to measure the magnitude of change in user popularity preferences. 3) To obtain the evolutionary patterns of popularity preferences, this invention divides the popularity sets according to time periods, thereby capturing user popularity preferences across different time periods. Through the above analysis, this invention can more accurately obtain user popularity preferences and predict future user popularity preferences, thus providing appropriate recommendations.
[0075] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The embodiments are considered exemplary only, and this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A sequence recommendation method based on user popularity preferences, characterized in that, The method includes: Based on the user-item interaction data in the training set, construct a user behavior sequence in chronological order; Based on the sequence recommendation model, user feature sequences are obtained from the user behavior sequences, and combined with the corresponding item tags in the training set, the basic loss of the sequence recommendation model is calculated. The user behavior sequence is divided into multiple consecutive subsequences, and the corresponding popularity preference labels are statistically derived from the training set. The popularity preference G, obtained based on the feature representation of each subsequence, is used to obtain the denoising loss of the sequence recommendation model; wherein, the features of the subsequence are derived based on the corresponding user feature sequence; Similar users in a batch of training samples are treated as positive samples, and dissimilar users are treated as negative samples. Contrastive learning is used to bring positive samples closer and push negative samples further apart to obtain the contrastive learning loss of the sequence recommendation model; wherein, the similar users are the popularity preference labels corresponding to the training samples. The difference is less than the first set value, and the cos similarity of the feature representation of the corresponding user-item interaction sequence of the user is greater than the second set value for the user pair; The sequence recommendation model is trained and optimized based on the base loss, denoising loss and contrastive learning loss, and then the recommendation results of the user-item interaction sequence to be detected are obtained. Specifically, the user behavior sequence is divided into multiple consecutive subsequences, and the corresponding popularity preference labels are statistically derived from the training set. The popularity preference G, derived from the feature representations of each subsequence, is used to obtain the denoising loss of the sequence recommendation model, including: The user behavior sequence is divided into multiple sub-sequences; Based on the feature extraction module in the sequence recommendation model, the user feature sequences corresponding to the sub-sequences are averaged to obtain the sub-sequence features; the sub-sequence features also include: sub-sequence position feature representation; Use fully connected layers to extract user popularity preference features from subsequence features for the corresponding time period; The average popularity preference feature representation of users is calculated based on the popularity preference feature representation of each time period, and the popularity preference G of users is predicted based on the average popularity preference feature representation. Use the popularity preference labels from the training set. Guide the popularity preference To obtain the denoising loss of the sequence recommendation model. Among them, prediction error , This represents the first set value. Indicates the subscript for summation.
2. The method as described in claim 1, characterized in that, Popularity preference tags It is obtained based on the mean and variance of the popularity preference set corresponding to the user.
3. The method as described in claim 1, characterized in that, The contrastive learning loss ;in, This represents a user in a training batch. This indicates that the training batch belongs to the user. positive sample set In the training batch, j represents another user, Φ neg This indicates that the training batch belongs to the user. The negative sample set, This represents the temperature coefficient.
4. The method as described in claim 1, characterized in that, The similar users are the tags. The difference is less than the first set value, including: calculate ;in, Indicates users in a training batch Corresponding popularity preference tags , Indicates users in a training batch Corresponding popularity preference tags ; exist In the case of the user, it is determined that With the user Meeting certain criteria is the first condition for similar users; among which, Indicates the first set value; exist In the case of the user, it is determined that With the user Not meeting the criteria is the first condition for similar users.
5. The method as described in claim 1, characterized in that, The cosine similarity of the feature representation of the corresponding user-item interaction sequence is less than a second preset value, including: calculate ;in, Indicates user Perform the first step according to the user behavior sequence The feature representation obtained after training iterations is accumulated. Indicates user The corresponding user behavior sequence is performed at the first The feature representation obtained after training accumulation is as follows: , These are the weighting coefficients. This represents the user's global characteristics. It is obtained by averaging the corresponding user feature sequences; exist In the case of the user, it is determined that With the user Meeting this condition is the second condition for similar users; among which, Indicates the second set value; exist In the case of the user, it is determined that With the user The second condition for similar users is not met.
6. A sequence recommendation device based on user popularity preferences, characterized in that, The device includes: The data preprocessing module is used to construct a user behavior sequence in chronological order based on the user-item interaction data in the training set. The base model is used to obtain user feature sequences from the user behavior sequences based on the sequence recommendation model, and combine them with the corresponding item tags in the training set to calculate the base loss of the sequence recommendation model. The sequence popularity awareness module is used to segment the user behavior sequence into multiple consecutive sub-sequences and, based on the corresponding popularity preference labels statistically obtained from the training set,... The popularity preference G, obtained based on the feature representation of each subsequence, is used to obtain the denoising loss of the sequence recommendation model; wherein, the features of the subsequence are derived based on the corresponding user feature sequence; The contrastive learning module is used to treat similar users in a batch of training samples as positive samples and dissimilar users as negative samples. Through contrastive learning, it brings positive samples closer together and pushes negative samples further apart to obtain the contrastive learning loss of the sequence recommendation model. Here, the similar users are the popularity preference tags corresponding to the training samples. The difference is less than the first set value, and the cos similarity of the feature representation of the corresponding user-item interaction sequence of the user is greater than the second set value for the user pair; The training and prediction module is used to train and optimize the sequence recommendation model based on the base loss, denoising loss and contrastive learning loss, so as to obtain the recommendation results of the user-item interaction sequence to be detected. Specifically, the user behavior sequence is divided into multiple consecutive subsequences, and the corresponding popularity preference tags are statistically analyzed from the training set. The popularity preference G, derived from the feature representations of each subsequence, is used to obtain the denoising loss of the sequence recommendation model, including: The user behavior sequence is divided into multiple sub-sequences; Based on the feature extraction module in the sequence recommendation model, the user feature sequences corresponding to the sub-sequences are averaged to obtain the sub-sequence features; the sub-sequence features also include: sub-sequence position feature representation; Use fully connected layers to extract user popularity preference features from subsequence features for the corresponding time period; The average popularity preference feature representation of users is calculated based on the popularity preference feature representation of each time period, and the popularity preference G of users is predicted based on the average popularity preference feature representation. Use the popularity preference labels from the training set. Guide the popularity preference To obtain the denoising loss of the sequence recommendation model. Among them, prediction error , This represents the first set value. Indicates the subscript for summation.
7. A computer device, characterized in that, The computer device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the sequence recommendation method based on user popularity preference as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the sequence recommendation method based on user popularity preferences as described in any one of claims 1-5.
Citation Information
Patent Citations
Dissociation self-supervised learning method and device for sequence recommendation model
CN111582492A
Dynamic graph sequence recommendation system sensitive to user interaction
CN113313381A
Recommending method for mining depth user similarity based on interactive sequence data
CN109522474A
Personalized interest recommendation method based on self-supervised learning and graph neural network
CN115329211A