A long short-term interest fusion user preference prediction method and device
By using a user preference prediction method that integrates long-term and short-term interests, the long-term and short-term interest characteristics of users are learned separately, which solves the problem of interest heterogeneity, improves the flexibility and prediction accuracy of the model, and reduces the training complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2024-08-05
- Publication Date
- 2026-07-24
AI Technical Summary
Existing interest and preference prediction methods fail to fully consider the heterogeneity between users' long-term and short-term interests, and most studies ignore the impact of short-term interests on user preference prediction, resulting in insufficient model flexibility and accuracy.
A user preference prediction method that integrates short-term and long-term interests is adopted. Different feature interactions are learned through short-term interest capture module and long-term interest capture module respectively. Combined with multi-granular temporal builder and feature co-enhancement layer, the length of short-term interest is automatically adjusted, and high-quality long-term interest features are generated through feature screening.
It improves the accuracy and flexibility of user preference prediction, reduces training complexity, and achieves more accurate user preference prediction.
Smart Images

Figure CN119004366B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to a method and apparatus for predicting user preferences by fusing long-term and short-term interests. Background Technology
[0002] Recommender systems effectively filter information resources and improve information utilization efficiency when dealing with massive amounts of data and unclear user needs. As a decision support system, recommender systems predict users' interests in specific items, utilize historical behavior and preferences to help users select content they are interested in, intelligently mine user interests, and pre-deploy predicted content to edge servers near users to provide targeted services. Faced with the challenges of massive data and personalized user needs, how to accurately predict user preferences has become a research focus. Machine learning and deep learning methods in artificial intelligence analyze information such as users' historical requests and content characteristics to provide personalized content recommendation services.
[0003] Deep learning technology has been prominently applied in interest prediction, with models such as Deep Neural Networks (DNNs), Convolutional Neural Networks (CNNs), and Recurrent Neural Networks (RNNs) demonstrating powerful capabilities in capturing user behavior patterns and learning latent data features. DNNs are widely used in user preference prediction models, often for mining high-order feature interactions and learning latent data patterns. Deep learning models can better capture the correlations and long-term dependencies between user behavior sequences, thereby improving the accuracy and effectiveness of interest prediction. Combinatorial models such as Wide&Deep and DeepFM enhance the model's feature learning ability by learning feature interactions, effectively learning complex relationships between features. However, they all learn high-order feature interactions implicitly, lacking good model interpretability. Models such as AutoInt and FiBiNet utilize attention mechanisms to select more effective features, allowing the model to focus on more important information and reducing the impact of data noise on the results. However, these methods focus on capturing users' long-term interests, neglecting the impact of short-term interests and the order of user behavior on user preference prediction. Recurrent Neural Networks (RNNs) and their variants, Gated Recurrent Units (GRUs) or Long Short-Term Memory (LSTMs), can be used to process time-series data. They can learn user preference shifts based on user session behavior and predict the content a user might request next. However, RNNs are prone to degradation when dealing with long sequences, suffering from vanishing and exploding gradient problems.
[0004] As mentioned earlier, existing interest and preference prediction methods suffer from the following problems. First, they fail to fully consider the impact of the heterogeneity between users' long-term and short-term interests on user preference prediction. Second, most studies employ LSTM and GRU methods, which, while capable of handling short-term interest sequences, are insensitive to the order of the input sequence due to the nature of self-attention. Furthermore, the length of the short-term interest sequence is usually pre-set, making it impossible to automatically adapt to different recommendation tasks and scenarios, thus limiting the model's flexibility and directly affecting the accuracy of preference prediction. Finally, in long-term interest extraction, the search space is mostly limited to the feature domain, which is too coarse to identify subtle features, thus retaining redundant features and reducing model performance. Summary of the Invention
[0005] To address the problems existing in the background art, one aspect of the present invention provides a user preference prediction method that integrates long-term and short-term interests, comprising:
[0006] S1: Obtain and preprocess a dataset from a social media platform. The dataset includes user data, video data, and historical interaction data between users and videos.
[0007] S2: Extract the user's short-term historical interaction behavior sequence based on the user's interaction data with the video within a short period of time T, and input it into the short-term interest capture module to obtain the user's short-term interest characteristics;
[0008] S3: Input the user's long-term interest capture module with a sequence composed of user data, video data, and historical interaction data between the user and video data according to the feature domain to extract the user's long-term interest features;
[0009] S4: The user's short-term interest features and long-term interest features are concatenated and then input into the prediction module to obtain the user's video preference results.
[0010] Preferably, preprocessing the dataset obtained from the social platform includes: removing missing values from the features and performing one-hot encoding.
[0011] Preferably, the user data includes: multiple user features, each user feature including one of the following: user ID, number of followers, number of accounts followed, and number of days since the user registered;
[0012] The video data includes multiple video features, each of which includes one of the following: video ID, video author ID, video visibility status, and video duration.
[0013] The historical interaction data between the user and the video includes multiple interaction features. Each interaction feature includes one of the following: the interaction time between the user and the video, whether the user commented on the video, whether the user saved the video, whether the user liked the video, and whether the user shared the video. Each user feature, video feature, and interaction feature is treated as a feature domain, and n feature domains are constructed.
[0014] Preferably, the user's short-term historical interaction behavior sequence includes:
[0015]
[0016] Among them, S u This represents the short-term historical sequence of user u's interactions. This represents the video interaction of user u at time t, where T represents the length of the user's short-term historical interaction sequence.
[0017] Preferably, the short-term interest capture module includes: an embedding layer, a fully connected (FC) layer, a multi-granularity temporal builder, a feature co-enhancement layer, and a multi-granularity temporal optimization layer;
[0018] The embedding layer uses a lookup table to retrieve each video. All corresponding video features, and related to the video All users interacting with the video For each user in the interaction, all user features are further searched. All the searched video features and user features are then converted into low-dimensional dense embedding vectors through a linear layer. Finally, all the embedding vectors are concatenated to obtain the video. First intermediate feature c t , is represented as:
[0019]
[0020] Where D represents the dimension of the first intermediate feature;
[0021] The FC layer fuses the first intermediate features of the video of user u interacting at T different times into an embedding table of size T×D, obtaining the second intermediate feature C, represented as:
[0022]
[0023] The multi-granularity time series builder is based on M predefined candidate sequence lengths {J1, J2, ..., J...} a ,...,J M In the time dimension T, M third intermediate features are obtained by extracting features corresponding to the candidate sequence length from the second intermediate features, as shown below:
[0024]
[0025] in, J represents the a-th third intermediate feature. a J represents the length of the a-th candidate sequence. a It is an integer greater than or equal to 1 and less than T;
[0026] The feature co-enhancement layer includes: a first multilayer perceptron (MLP) and a second multilayer perceptron (MLP); the feature co-enhancement layer first inputs the transposed M third intermediate features into the first multilayer perceptron (MLP) for processing to obtain M fourth intermediate features, represented as follows:
[0027]
[0028]
[0029]
[0030]
[0031] in, W represents the a-th fourth intermediate feature. 11 and W 12 The weight parameters of the first multilayer perceptron (MLP) are represented by g1, which represents the nonlinear activation function; LayerNorm1 represents the layer normalization process.
[0032] Next, the M transposed fourth intermediate features are input into the second multilayer perceptron (MLP) for processing to obtain M fifth intermediate features, represented as follows:
[0033]
[0034]
[0035]
[0036]
[0037] Among them, W 21 and W 22 This represents the weight parameters of the second multilayer perceptron (MLP). Let g1 represent the a-th fifth intermediate feature, g2 represent the non-linear activation function, and LayerNorm2 represent the layer normalization process.
[0038] The multi-granularity temporal optimization layer assigns a weight parameter to each of the M fifth intermediate features. After multiplying each fifth intermediate feature with its corresponding weight parameter, the result is input into Softmax to predict the probability that the fifth intermediate feature is the optimal feature. The fifth intermediate feature with the highest probability is selected as the user's short-term interest feature.
[0039] Preferably, the input sequence z of the long-term interest capture module is represented as:
[0040] z = [z1, z2, ..., z i ,…z n ] T
[0041]
[0042] Among them, z i The i-th feature domain is represented by x; n represents the number of feature domains; x ik Let m represent the k-th eigenvalue in the i-th feature domain. i Let T represent the number of eigenvalues in the i-th eigendomain, and T represent the matrix transpose.
[0043] Preferably, the long-term interest capture module includes: an embedding layer, a feature optimization layer, a feature collaborative enhancement layer, and a feature fusion layer;
[0044] The embedding layer is used to linearly transform the input sequence z into a low-dimensional dense vector space to obtain the first long-term feature, represented as:
[0045] e i =z i ×E i
[0046] e = [e1, e2, ..., e n ]
[0047] in, Indicates the first long-term characteristic, D represents the embedded table, and D represents the embedded dimension.
[0048] The feature optimization layer consists of each feature e in the first long-term features. i Assign a learnable binary gate from feature e i Selecting some feature elements as high-level features
[0049] The feature co-enhancement layer inputs the selected high-level features into the third multilayer perceptron (MLP) for processing to obtain the second long-term feature, represented as:
[0050]
[0051]
[0052] Among them, W 31 and W 32 This represents the weight parameters of the third multilayer perceptron (MLP). g3 represents the second long-term feature; LayerNorm3 represents the layer normalization process.
[0053] The feature fusion layer is used to concatenate the second long-term feature and the optimal feature to obtain the user's long-term interest feature, represented as:
[0054]
[0055] in, This indicates the user's long-term interest characteristics.
[0056] Preferably, the prediction module employs a fourth multilayer perceptron (MLP) and an output layer;
[0057] The fourth multilayer perceptron (MLP) is used to interactively learn the concatenated features of the user's short-term and long-term interests to obtain the first comprehensive feature, which is represented as:
[0058]
[0059] Where h represents the first comprehensive feature, This indicates the user's short-term interest characteristics; This represents the user's long-term interest characteristics; W 0 b represents the learnable weights. 0 It is a bias parameter;
[0060] The output layer is used to process the first comprehensive feature input activation function sigmoid to obtain the user's preference result for the video, expressed as:
[0061]
[0062] in, This indicates the user's preference for videos; w T σ represents the transpose of matrix w; w represents the weight parameter matrix; b is the bias parameter; σ represents the sigmoid activation function.
[0063] Another aspect of the present invention provides a user preference prediction apparatus that integrates long-term and short-term interests, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor is configured to implement the aforementioned user preference prediction method that integrates long-term and short-term interests when executing the computer program.
[0064] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the aforementioned user preference prediction method that integrates long-term and short-term interests.
[0065] The present invention has at least the following beneficial effects
[0066] This invention addresses the heterogeneity issue of long-term and short-term interest features by proposing separate long-term and short-term interest capture modules that learn different feature interactions. For short-term interest prediction, an automated and adaptive short-term interest length search algorithm is employed, using an end-to-end optimization method to obtain the optimal short-term interest behavior sequence and predict short-term interest preferences. Simultaneously, for long-term interests, a feature selection method is proposed to generate high-quality feature representations, improving the accuracy of user preference prediction while reducing training complexity, thus achieving effective user preference prediction.
[0067] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0068] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0069] Figure 2 This is a schematic diagram of the method framework of the present invention. Detailed Implementation
[0070] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0071] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures, and should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0072] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0073] Please see Figure 1 and Figure 2 This invention provides a method for predicting user preferences by fusing long-term and short-term interests, comprising:
[0074] S1: Obtain and preprocess a dataset from a social media platform. The dataset includes user data, video data, and historical interaction data between users and videos.
[0075] S2: Extract the user's short-term historical interaction behavior sequence based on the user's interaction data with the video within a short period of time T, and input it into the short-term interest capture module to obtain the user's short-term interest characteristics;
[0076] S3: Input the user's long-term interest capture module with a sequence composed of user data, video data, and historical interaction data between the user and video data according to the feature domain to extract the user's long-term interest features;
[0077] S4: The user's short-term interest features and long-term interest features are concatenated and then input into the prediction module to obtain the user's video preference results.
[0078] In this embodiment, the dataset used is the kuairand dataset. The kuairand dataset records 12 types of user feedback (such as whether they clicked, the viewing duration, whether they liked it, etc.) for all recommended videos in 15 recommendation scenarios (different pages). The kuairand dataset includes user data such as user ID, number of followers, number of accounts followed, and number of days since registration; video data such as video ID, video author ID, video visibility status, and video duration; and historical user-video interaction data such as interaction time, whether the user commented on the video, whether the user saved the video, whether the user liked the video, and whether the user shared the video. The label used in training is whether the user clicked the video 'is_click'. In actual use of this method, assuming that the dataset contains P video data, according to step S4, the probability of each user's preference for each of the P videos is predicted, and the L videos with the highest probability can be selected for recommendation to the user. This will not be elaborated further in this embodiment.
[0079] Preferably, preprocessing the dataset obtained from the social platform includes: removing missing values from the features and performing one-hot encoding.
[0080] Preferably, the user data includes: multiple user features, each user feature including one of the following: user ID, number of followers, number of accounts followed, and number of days since the user registered;
[0081] In this embodiment, the number of followers is represented by the number of bloggers followed by the user, and the number of days the user has been registered is represented by the number of days the user has been registered on the platform.
[0082] The video data includes multiple video features, each of which includes one of the following: video ID, video author ID, video visibility status, and video duration.
[0083] In this embodiment, the visibility state of the video is represented by its public state, such as the video being viewable by everyone or hidden and visible only to the user. A value of 1 indicates the video is visible to everyone, while a value of 0 indicates it is visible only to the user. Of course, those skilled in the art can define their own markers based on experience. This will not be elaborated upon further in this document.
[0084] The historical interaction data between the user and the video includes multiple interaction features. Each interaction feature includes one of the following: the interaction time between the user and the video, whether the user commented on the video, whether the user saved the video, whether the user liked the video, and whether the user shared the video. Each user feature, video feature, and interaction feature is treated as a feature domain, and n feature domains are constructed.
[0085] In this embodiment, whether a user comments on a video is defined as 1 when the user comments on the video and 0 when there is no comment. Similarly, whether a user favorites a video, likes a video, or shares a video is defined. Of course, those skilled in the art can also define their own markers based on experience. Each feature domain represents a user feature, video feature, or interaction feature. The n feature domains include at least one user feature, at least one video feature, and at least one interaction feature.
[0086] Preferably, the user's short-term historical interaction behavior sequence includes:
[0087]
[0088] Among them, S u This represents the short-term historical sequence of user u's interactions. This represents the video interaction of user u at time t, where T represents the length of the user's short-term historical interaction sequence.
[0089] Preferably, the short-term interest capture module includes: an embedding layer, a fully connected (FC) layer, a multi-granularity temporal builder, a feature co-enhancement layer, and a multi-granularity temporal optimization layer;
[0090] The embedding layer uses a lookup table to retrieve each video. All corresponding video features, and related to the video All users interacting with the video For each user interacting with the video, all user features are further searched. All the searched video and user features are then converted into low-dimensional dense embedding vectors using a linear layer. Finally, all the embedding vectors are concatenated to obtain the video embedding. First intermediate feature c t , is represented as:
[0091]
[0092] Where D represents the dimension of the first intermediate feature;
[0093] The FC layer fuses the first intermediate features of the video of user u interacting at T different times into an embedding table of size T×D, obtaining the second intermediate feature C, represented as:
[0094]
[0095] The multi-granularity time series builder is based on M predefined candidate sequence lengths {J1, J2, ..., J...} a ,...,J M In the time dimension T, M third intermediate features are obtained by extracting features corresponding to the candidate sequence length from the second intermediate features, as shown below:
[0096]
[0097] in, J represents the a-th third intermediate feature. a J represents the length of the a-th candidate sequence. a It is an integer greater than or equal to 1 and less than T;
[0098] The feature co-enhancement layer includes: a first multilayer perceptron (MLP) and a second multilayer perceptron (MLP); the feature co-enhancement layer first inputs the transposed M third intermediate features into the first multilayer perceptron (MLP) for processing to obtain M fourth intermediate features, represented as follows:
[0099]
[0100]
[0101]
[0102]
[0103] in, W represents the a-th fourth intermediate feature. 11 and W 12 The weight parameters of the first multilayer perceptron (MLP) are represented by g1, which represents the nonlinear activation function; LayerNorm1 represents the layer normalization process.
[0104] Next, the M transposed fourth intermediate features are input into the second multilayer perceptron (MLP) for processing to obtain M fifth intermediate features, represented as follows:
[0105]
[0106]
[0107]
[0108]
[0109] Among them, W 21 and W 22 This represents the weight parameters of the second multilayer perceptron (MLP). Let g1 represent the a-th fifth intermediate feature, g2 represent the non-linear activation function, and LayerNorm2 represent the layer normalization process.
[0110] The multi-granularity temporal optimization layer assigns a weight parameter to each of the M fifth intermediate features. After multiplying each fifth intermediate feature with its corresponding weight parameter, the result is input into Softmax to predict the probability that the fifth intermediate feature is the optimal feature. The fifth intermediate feature with the highest probability is selected as the user's short-term interest feature.
[0111] In this embodiment, the optimal sequence length for short-term interest prediction is determined. In the multi-granularity temporal optimization layer, the length of the candidate sequence after feature enhancement is J. a Assign a learnable architectural weight α a α a The process is dynamically adjusted during training. To ensure the search space is continuous and the time-series length optimization is efficient, a softmax operation is used to transform it into a probability distribution, represented as:
[0112]
[0113] To select the fifth intermediate feature with the highest probability as the user's short-term interest feature, while improving the model's performance in predicting user preferences and maintaining the model's generalization ability, a loss function is defined. This optimizes the architecture weights of the short-term prediction module. The loss function, which includes training loss and a regularization term, can be expressed as:
[0114]
[0115] Where W represents the weight parameters of the multilayer perceptron (MLP) in the feature collaboration enhancement layer, and α = [α1, α2, ..., α...]. M ] represents the architectural weights of the M fifth intermediate features. Let W represent the cross-entropy loss function, and λ represent the regularization parameter, with L2 regularization applied. A two-stage optimization technique is used, with alternating optimizations: the optimization of W is an external optimization process, and the optimization of the architecture weights α is an internal optimization process, expressed as:
[0116]
[0117] Among them, W * (α) represents the optimal weight parameter in the feature collaboration enhancement layer based on the architecture weight α. Let represent the loss gradient with respect to W, and η represent the learning rate. The architecture weights are optimized based on the optimal weight parameters, expressed as:
[0118]
[0119] in, Let α represent the loss gradient with respect to the architecture weights α, and η represent the learning rate.
[0120] In this embodiment, to more effectively model users' short-term interests, stacked embedding vectors are input into a feature co-enhancement layer, which analyzes the embedding vectors from multiple perspectives using nonlinear techniques. This layer consists of only a multilayer perceptron, aiming to maintain linear time and space complexity. The first multilayer perceptron focuses on the time series dimension T, capturing the temporal dependencies in the user interaction sequence and fusing sequence information into each embedding vector through feature learning; the second multilayer perceptron targets the feature embedding dimension D, learning the correlation between each content feature vector and fusing feature information into each embedding vector to generate high-quality feature representations, better uncovering users' short-term preferences.
[0121] Preferably, the input sequence z of the long-term interest capture module is represented as:
[0122] z = [z1, z2, ..., z i ,...z n ] T
[0123]
[0124] Among them, z i The i-th feature domain is represented by x; n represents the number of feature domains; x ik Let m represent the k-th eigenvalue in the i-th feature domain. i Let T represent the number of eigenvalues in the i-th eigendomain, and T represent the matrix transpose.
[0125] Preferably, the long-term interest capture module includes: an embedding layer, a feature optimization layer, a feature collaborative enhancement layer, and a feature fusion layer;
[0126] The embedding layer is used to linearly transform the input sequence z into a low-dimensional dense vector space to obtain the first long-term feature, represented as:
[0127] e i =z i ×E i
[0128] e = [e1, e2, ..., e n ]
[0129] in, Indicates the first long-term characteristic, This represents the embedded table, and D represents the embedded dimension.
[0130] The feature optimization layer consists of each feature e in the first long-term features. i Assign a learnable binary gate from feature e i Selecting some feature elements as high-level features
[0131] In this embodiment, considering that the search space of the feature domain is too coarse and contains many subtle redundant features, the feature optimization layer delves into the feature level, using optimal loss as a metric for each feature. Assign a learnable door when At that time, retain feature elements Remove feature elements Obtain the optimal high-level features
[0132]
[0133] The feature co-enhancement layer inputs the selected high-level features into the third multilayer perceptron (MLP) for processing to obtain the second long-term feature, represented as:
[0134]
[0135]
[0136] Among them, W 31 and W 32 This represents the weight parameters of the third multilayer perceptron (MLP). g3 represents the second long-term feature; LayerNorm3 represents the layer normalization process.
[0137] The feature fusion layer is used to concatenate the second long-term feature and the optimal feature to obtain the user's long-term interest feature, represented as:
[0138]
[0139] in, This indicates the user's long-term interest characteristics.
[0140] In this embodiment, the long-term interest capture module proposes a feature selection method to generate high-quality feature representations, which improves the accuracy of user preference prediction while reducing training complexity.
[0141] Preferably, the prediction module employs a fourth multilayer perceptron (MLP) and an output layer;
[0142] The fourth multilayer perceptron (MLP) is used to interactively learn the concatenated features of the user's short-term and long-term interests to obtain the first comprehensive feature, which is represented as:
[0143]
[0144] Where h represents the first comprehensive feature, This indicates the user's short-term interest characteristics; This represents the user's long-term interest characteristics; W0 b represents the learnable weights. 0 It is a bias parameter;
[0145] The output layer is used to process the first comprehensive feature input activation function sigmoid to obtain the user's preference result for the video, expressed as:
[0146]
[0147] in, This indicates the user's preference for videos; w T σ represents the transpose of matrix w; w represents the weight parameter matrix; b is the bias parameter; σ represents the sigmoid activation function.
[0148] In this embodiment, the preference prediction model consists of a short-term interest capture module, a long-term interest capture module, and a prediction module. The cross-entropy loss function is used to optimize the preference prediction model. The cross-entropy loss function is expressed as:
[0149]
[0150] Where N is the number of training samples, and y represents the true label of user preference. This represents the preference prediction results from the preference prediction model.
[0151] Another aspect of the present invention provides a user preference prediction apparatus that integrates long-term and short-term interests, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor is configured to implement the aforementioned user preference prediction method that integrates long-term and short-term interests when executing the computer program.
[0152] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the aforementioned user preference prediction method that integrates long-term and short-term interests.
[0153] In summary, this invention addresses the heterogeneity issue of long-term and short-term interest features by proposing separate long-term and short-term interest capture modules that learn different feature interactions. For short-term interest prediction, an automated and adaptive short-term interest length search algorithm is employed, using an end-to-end optimization method to obtain the optimal short-term interest behavior sequence and predict short-term interest preferences. Simultaneously, for long-term interests, a feature selection method is proposed to generate high-quality feature representations, improving the accuracy of user preference prediction while reducing training complexity, thus achieving effective user preference prediction.
[0154] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A user preference prediction method that integrates long-term and short-term interests, characterized in that, include: S1: Obtain and preprocess a dataset from a social media platform. The dataset includes user data, video data, and historical interaction data between users and videos. S2: Extract the user's short-term historical interaction behavior sequence based on the user's interaction data with the video within a short period of time T, and input it into the short-term interest capture module to obtain the user's short-term interest characteristics; The user's short-term historical interaction behavior sequence includes: in, Indicates user The short-term historical interaction behavior sequence, Indicates user exist Interactive videos in real time Indicates the length of a user's short-term historical interaction sequence; The short-term interest capture module includes: an embedding layer, a fully connected (FC) layer, a multi-granularity temporal builder, a feature collaborative enhancement layer, and a multi-granularity temporal optimization layer; The embedding layer uses a lookup table to retrieve each video. All corresponding video features, and related to the video All users interacting with the video For each user in the interaction, all user features are further searched. All the searched video features and user features are then converted into low-dimensional dense embedding vectors through a linear layer. Finally, all the embedding vectors are concatenated to obtain the video. First intermediate feature , is represented as: Where D represents the dimension of the first intermediate feature; The FC layer will connect the user exist The first intermediate features of the videos interacting at different times are fused together into a size of [size missing]. The embedding table is used to obtain the second intermediate feature. , is represented as: The multi-granularity time series builder is based on the predefined lengths of M candidate sequences. M third intermediate features are obtained by extracting features corresponding to the candidate sequence length from the second intermediate features along the time dimension T, denoted as follows: in, Indicates the first The third intermediate feature, Indicates the first The length of each candidate sequence It is an integer greater than or equal to 1 and less than T; The feature co-enhancement layer includes: a first multilayer perceptron (MLP) and a second multilayer perceptron (MLP); the feature co-enhancement layer first inputs the transposed M third intermediate features into the first multilayer perceptron (MLP) for processing to obtain M fourth intermediate features, represented as follows: in, Indicates the first The fourth intermediate feature, and These represent the weight parameters of the first multilayer perceptron (MLP). Represents a nonlinear activation function; Presentation layer normalization processing; Next, the M transposed fourth intermediate features are input into the second multilayer perceptron (MLP) for processing to obtain M fifth intermediate features, represented as follows: in, and This represents the weight parameters of the second multilayer perceptron (MLP). Indicates the first The fifth intermediate feature, Represents a nonlinear activation function; Presentation layer normalization processing; The multi-granularity temporal optimization layer assigns a weight parameter to each of the M fifth intermediate features. After multiplying each fifth intermediate feature with its corresponding weight parameter, the result is input into Softmax to predict the probability that the fifth intermediate feature is the optimal feature. The fifth intermediate feature with the highest probability is selected as the user's short-term interest feature. S3: Input the user's long-term interest capture module with a sequence composed of user data, video data, and historical interaction data between the user and video data according to the feature domain to extract the user's long-term interest features; S4: The user's short-term interest features and long-term interest features are concatenated and then input into the prediction module to obtain the user's video preference results.
2. The user preference prediction method that integrates long-term and short-term interests according to claim 1, characterized in that, Preprocessing of datasets obtained from social media platforms includes: removing missing values from features and performing one-hot encoding.
3. The user preference prediction method that integrates long-term and short-term interests according to claim 1, characterized in that, The user data includes: multiple user features, each of which includes one of the following: user ID, number of followers, number of accounts followed, and number of days since the user registered. The video data includes multiple video features, each of which includes one of the following: video ID, video author ID, video visibility status, and video duration. The historical interaction data between users and videos includes multiple interaction features. Each interaction feature includes one of the following: the user's interaction time with the video, whether the user commented on the video, whether the user saved the video, whether the user liked the video, and whether the user shared the video. Each user feature, video feature, and interaction feature is treated as a feature domain to construct... Each feature domain.
4. The user preference prediction method that integrates long-term and short-term interests according to claim 3, characterized in that, Input sequence of the long-term interest capture module Represented as: in, Indicates the first Each feature domain; Indicates the number of feature domains; Indicates The first feature domain 1 eigenvalue, Indicates the first The number of eigenvalues in each feature domain, where T represents the matrix transpose.
5. The user preference prediction method that integrates long-term and short-term interests according to claim 4, characterized in that, The long-term interest capture module includes: an embedding layer, a feature optimization layer, a feature collaborative enhancement layer, and a feature fusion layer; The embedding layer is used to process the input sequence The first long-term feature is obtained by linear transformation to a low-dimensional dense vector space, expressed as: in, Indicates the first long-term characteristic, Indicates an embedded table. Indicates the embedding dimension; The feature optimization layer consists of each feature in the first long-term features. Assign a learnable binary gate from the features Selecting some feature elements as high-level features ; The feature co-enhancement layer inputs the selected high-level features into the third multilayer perceptron (MLP) for processing to obtain the second long-term feature, represented as: in, and This represents the weight parameters of the third multilayer perceptron (MLP). Indicates the second long-term characteristic. Represents a nonlinear activation function; Presentation layer normalization processing; The feature fusion layer is used to concatenate the second long-term feature and the optimal feature to obtain the user's long-term interest feature, represented as: in, This indicates the user's long-term interest characteristics.
6. The user preference prediction method that integrates long-term and short-term interests according to claim 2, characterized in that, The prediction module employs a fourth multilayer perceptron (MLP) and an output layer. The fourth multilayer perceptron (MLP) is used to interactively learn the concatenated features of the user's short-term and long-term interests to obtain the first comprehensive feature, which is represented as: in, Indicates the first comprehensive feature, This indicates the user's short-term interest characteristics; This indicates the user's long-term interest characteristics; Represents the learnable weights. It is a bias parameter; The output layer is used to process the first comprehensive feature input activation function sigmoid to obtain the user's preference result for the video, expressed as: in, This indicates the user's preference for videos; Representation matrix transpose; Represents the weight parameter matrix; It is a bias parameter; This represents the sigmoid activation function.
7. A user preference prediction device that fuses long-term and short-term interests, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, The processor is configured to implement, when executing the computer program, a user preference prediction method based on the fusion of long-term and short-term interests as described in any one of claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it can implement the user preference prediction method of long-term and short-term interest fusion as described in any one of claims 1-6.