An e-commerce platform conversation-aware recommendation prediction method based on long short-term interest
By constructing a long-term user interest set and combining interest matching and a GRU model, the problem of distinguishing between long-term and short-term interests in recommendation systems is solved, enabling more accurate recommendations for e-commerce platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2022-08-12
- Publication Date
- 2026-07-21
AI Technical Summary
Existing recommendation systems struggle to effectively distinguish between and utilize users' long-term and short-term interests, resulting in insufficient accuracy of recommendation results and information loss due to neglecting short-term transactions.
By constructing a long-term user interest set, performing convolution calculations using multi-scale convolution kernels, combining interest matching and gated recurrent units, predicting users' short-term interests, and recommending items through attention mechanisms and GRU models.
It improves the accuracy of recommendations on e-commerce platforms, enabling more precise mining of short- and long-term interest information in user behavior sequences and enhancing the effectiveness of recommendation systems.
Smart Images

Figure CN115293812B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet application technology, specifically relating to a session-aware recommendation prediction method for e-commerce platforms based on long-term and short-term interests. Background Technology
[0002] In recent years, with the rapid development of artificial intelligence (AI) technology, the "intelligence" factor has made recommendations more interesting and useful. Intelligence is the key core of personalization; it understands user preferences, predicts unknown user tastes, and ultimately provides recommendations that go beyond simple searches by matching queries and content. Recommender system research combines various artificial intelligence (AI) technologies, including machine learning, data mining, user modeling, and case-based reasoning. The idea of having an intelligent system that can think and learn like a human has led to a more human-like technology called computational intelligence (CI). CI is a branch of AI that explores adaptive mechanisms to achieve intelligent operation in complex and ever-changing environments. This intelligent "recommendation" can come from a variety of factors, including users' digital habits, as well as similar users' history, preferences, interests, and behaviors. Recommender systems have rapidly become one of the most important traffic hubs for modern e-commerce websites and any website with a large amount of content and users. In short, a recommender system is a complex filtering system that can predict consumer preferences in a digital environment.
[0003] In the early days of recommender systems, discovering explicit similarities between people and products was relatively easy. However, recommender systems have since adopted a method of examining the similarities of latent attributes through matrix factorization. Simply put, all the attributes of an item or a customer are grouped together in a way that reveals relationships that have not yet been realized. But this method has significant limitations. The emergence of artificial intelligence has enabled recommender systems to discover many more latent attributes and hidden relationships.
[0004] Although numerous scholars have conducted extensive research on conversation-aware recommendation models, which can minimize the information loss caused by existing recommendation models ignoring short-term transactions, some challenges still exist:
[0005] 1. User interests evolve dynamically over time. On e-commerce platforms, user preferences for items are typically dynamic rather than static, undergoing significant or gradual changes over time.
[0006] 2. Users' choices of items depend not only on long-term preferences but also on short-term recent preferences. Both long-term and short-term interests are important, and how to distinguish and utilize these two types of interests simultaneously is clearly a problem.
[0007] 3. Different interests have different impacts. Simply using user interests continuously and equally will make the model lack authenticity and affect the accuracy of the recommendation results. Summary of the Invention
[0008] To address the above issues, this application proposes a conversation-aware recommendation prediction method for e-commerce platforms based on short-term and long-term interests, specifically including the following steps:
[0009] Acquire online data, including basic user information, basic item information, and conversation sequences of user behavior;
[0010] By acquiring online data, user behavior and preferences are extracted, and a long-term set of user interests is constructed.
[0011] By matching interests, we can obtain a user's short-term interests at the current stage from the user's long-term interest set.
[0012] A predictive model is built by taking a user's click sequence in a session (i.e., item input) and the user's short-term interests at the current stage as input. The predictive model outputs predicted items and makes recommendations.
[0013] Furthermore, constructing a user's long-term interest set includes: obtaining the user's historical item matrix based on the session sequence of historical user behavior; performing convolution calculations on the historical item matrix using multiple convolution kernels of different scales; obtaining a user's preference feature mapping for each convolution kernel; concatenating all preferences and passing them through a fully connected layer to transform them into the user's long-term interests; and constructing a long-term interest set from all of the user's sessions.
[0014] Furthermore, if using Each convolution kernel performs a convolution operation on the historical item matrix, and the convolution kernel matrix is represented as follows: Then, the user's long-term interest obtained in the i-th session is represented as:
[0015]
[0016] in, Represents the ReLU activation function; This represents the concatenation operation; H is the historical item matrix, represented as... , Let represent the interactive item vector mapped to the i-th sub-session. This is the weight matrix of the fully connected layer. This is the bias term for the fully connected layer.
[0017] Furthermore, for values in the historical item matrix, a certain probability is used to force the value to be set to 0, and this probability is expressed as:
[0018]
[0019] Where O represents the probability of setting a certain value in the historical item matrix to 0; User vector representation; Items are represented by vectors; This represents the user vector representation learned from the user's interaction with items; This represents the item vector representation learned from user-item interactions.
[0020] Furthermore, the process of learning user and item vector representations through user-item interactions involves gradually reducing the loss function until a set threshold is reached. The loss function is expressed as:
[0021]
[0022] in, The loss function; When y=1, it means that the user has interacted with the current item; when y=0, it means that the user has not interacted with the current item. This indicates that the item vector representation is learned from the user's interaction with the item, and the user stays on the item for a longer period than the average stay time. This indicates that the item vector representation is learned from the user's interaction with the item, and the user's time spent on the item does not exceed the average time spent on it.
[0023] Furthermore, by using interest matching to obtain a user's short-term interests from their long-term interest set at the current stage, it can be represented as:
[0024] ,
[0025] in, For the short-term interest in the nth stage of the s-th session, a user may interact with multiple items in a single session. Here, it is defined that each interaction between the user and an item in this session constitutes a stage. This represents the long-term interest obtained in the i-th session; M represents the number of elements in the long-term interest set. For the number of stages, This represents the weight of short-term interest in the nth stage of the s-th session.
[0026] Furthermore, an attention mechanism is used to compute a vector matched from the user's long-term interest set. right The influence is a vector obtained by matching users' long-term interest sets. Represented as:
[0027]
[0028] in, The embedding vector representing the user's long-term interest set and the session sequence representing the current user's behavior. The difference projected onto the embedding space vector; This represents the long-term interest obtained during the i-th session; Represents the quantized result ; This indicates the inner product. Represents the weighting function; Expressing the request The value is the average value within the set Q; Q represents all preceding actions of the user in the current session.
[0029] Furthermore, a prediction model is constructed based on the gated loop unit, and the output of the gate of the gated loop unit is passed through... The function layer predicts the probability of each item being clicked and recommends items to the user in descending order of probability. This process can be represented as:
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036] in, Input vector for the item; For users' short-term interests, This is an intermediate hidden state. It is in a hidden state. To update the door, To reset the door, This is the output vector; , , This represents the transformation matrix of a GRU cell. , , The weight matrix representing the GRU cell; This represents the sigmoid activation function. This indicates a bitwise multiplication operation; Describes the first item in the set V of items. The probability that an item will be clicked. V represents the number of items in the item set V, and W represents the weight matrix connecting the hidden layer to the output layer.
[0037] This invention can not only effectively mine users' short-term and long-term interest information in user behavior sequences and express users' interest preferences more accurately, but also improve the recommendation accuracy of e-commerce platforms. Attached Figure Description
[0038] Figure 1 This is a flowchart of the conversation-aware recommendation prediction model based on long-term and short-term interests in this invention.
[0039] Figure 2 This is a schematic diagram of the probability model for predicting the purchase of items at each stage of the session in this invention;
[0040] Figure 3 This is a schematic diagram of the CNN convolutional network of the present invention;
[0041] Figure 4 This is a schematic diagram illustrating the SiM algorithm used in this invention to calculate short-term interest preferences.
[0042] Figure 5 This is a schematic diagram of the long-term interest evolution model of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] This invention provides a session-aware recommendation prediction method for e-commerce platforms based on long-term and short-term interests, comprising the following steps:
[0045] Acquire online data, including basic user information, basic item information, and conversation sequences of user behavior;
[0046] By acquiring online data, user behavior and preferences are extracted, and a long-term set of user interests is constructed.
[0047] By matching interests, we can obtain a user's short-term interests at the current stage from the user's long-term interest set.
[0048] A predictive model is built by taking a user's click sequence in a session (i.e., item input) and the user's short-term interests at the current stage as input. The predictive model outputs predicted items and makes recommendations.
[0049] This embodiment provides a specific implementation method. In this embodiment, as shown... Figure 1 The main steps for making recommendations and predictions include:
[0050] S1: Online Data Acquisition. Data can be acquired from publicly available dataset websites or by directly querying real-time sales data from the company's database. The required data includes basic user information, basic item information, and user behavior session sequences. Each session sequence contains multiple elements. The session sequences are then converted to a fixed length, and the data is preprocessed.
[0051] S2: Extract relevant attributes. Relevant attributes are extracted based on the acquired basic user information, item information, and user historical conversation sequences from the e-commerce platform. User preferences are then characterized by fusing features from both long-term and short-term interest perspectives.
[0052] S3: Build the model. Construct a predictive model to predict the sequence of candidate items and push the sequence to the user.
[0053] This embodiment provides a specific method for obtaining a data source, mainly including the following steps:
[0054] S11: Obtain raw data. Raw data can be obtained through real-time queries of the enterprise database or from publicly available dataset websites.
[0055] S12: Simple Data Cleaning. Raw data is often unstructured and cannot be directly used for data analysis. Simple data cleaning can structure most unstructured data. For example, removing duplicate data and cleaning up invalid information.
[0056] S13: Data Storage. After simple data cleaning, the data is stored in a database. The table structure further standardizes the data, and the database also greatly improves data retrieval efficiency and the mapping of relationships between tables.
[0057] In e-commerce platforms, user order placement behavior during marketing campaigns is influenced by various factors, such as user interests, the participation behavior of similar users, and the impact of marketing campaign reward mechanisms on impulsive purchases. Based on this, this embodiment extracts factors influencing user behavior from both internal and external perspectives; that is, it extracts user behavior as an external factor and user preferences as an internal factor. This embodiment provides a specific extraction process, including:
[0058] S21: Extract user behavior.
[0059] S211: User Session Collection
[0060] Each interaction record between a user and an item is associated with a session number. ,use To represent a given user in the first... The collection of all items interacted with within a session, including the current session. All interactive information, including those included, is represented as .
[0061] S212: User Item Interaction Matrix
[0062] The user set and the item set are respectively represented as: and Define an interaction matrix between users and items based on users' implicit feedback to items. That is, if the user Clicked on the item ,So ,otherwise .
[0063] S22: Extract user preferences.
[0064] S221: User Item Attention
[0065] User attention to items can be measured by the time users spend on the item page. Number of clicks The two conditions determine what is determined, denoted as .
[0066] S222: User Long-Term Interest Sets
[0067] Before For each session, we have prepared a long-term interest set for each user. This is used to characterize the user's long-term interests and preferences. Long-term interest set Stored for a user There are n latent preference vectors, denoted as... .
[0068] S223: Short-term user interest
[0069] User at The long-term interest set prior to each session is represented as follows: Users' short-term interests are mediated through the first Each phase within a session Matching user preceding behavior With long-term interest set Obtaining can be defined as .
[0070] The predictive model constructed in this implementation mines and memorizes users' long-term interests, and predicts candidate item sequences based on the evolution of user interests, including the following steps:
[0071] Mine fine-grained long-term user interests from user behavior sequences in the session, and store user behavior sequences into a long-term interest set;
[0072] By designing the SiM (Short-interest Match) interest matching method, we can further match the user's short-term interest dynamic representation from the user's long-term interest set;
[0073] The process of building user interests over time is achieved through GRU;
[0074] A gated recurrent neural network was introduced to model the user's click sequence in a session and predict the sequence of candidate items.
[0075] In the process of acquiring users' long-term interest sets, for each user... A long-term interest set module is defined within each session. Starting from the feature level, features are extracted and stored from historical items that users have interacted with. Each user has a latent interest vector to describe their preference features, such as... Figure 3 Specifically, it includes the following steps:
[0076] The historical item matrix is obtained by inputting the user's historical session sequence into the embedding layer. ,in Multiple convolution kernels In the matrix Convolutional calculations are performed on the kernel, and each convolutional kernel yields a user's preference feature mapping. ,Right now:
[0077]
[0078] in, Represents the convolution kernel Subscript elements, Represents the first in the matrix Line number Column elements, This refers to the bias term of the above function; The dimension of the embedded vector; Let L represent the interactive item vector of the i-th sub-session mapping. This vector includes L features, each of which is an element in the vector.
[0079] By using multiple convolutional kernels to generate different user preference feature maps, let... and Given the convolution kernel matrix and its number, we can obtain the following based on the number of convolution kernels: User preference feature mapping These are then concatenated and transformed into the user's long-term interests through a fully connected layer, calculated as follows:
[0080]
[0081] in and These represent convolution calculation and vector concatenation operation, respectively. It is the weight matrix of the fully connected layer. For the bias term of the fully connected layer, It represents a user's long-term interests. Convolutional neural networks can capture the global relationships between features of the same dimension in user behavior, and can effectively extract users' long-term interests.
[0082] Since a user's long-term interests grow with the accumulation of user behavior data, we write user preference features after each session to further enrich the accuracy of the recommendation system. Simultaneously, to prevent overfitting, this embodiment introduces Dropout to reduce the model's sensitivity to noise. For example, users may accidentally click on items they are not interested in, and the model may overfit due to this noisy data. Specifically, this involves forcibly setting the input item features to 0 with a certain probability, expressed as:
[0083]
[0084] in, It is the user vector representation learned by the model. It is the item vector representation learned by the model. and These are the user and item vector representations, respectively, which are external inputs and serve as supervision signals; To predict the user's vector; The vector for predicting the item; The probability of a user clicking; The probability that an item will be clicked; Indicates the range of values that the user can take; The value range of the item is indicated by T; T represents the operation of transposing the matrix rows and columns.
[0085] To simplify the training process, this embodiment uses the interaction duration between users and items as a supervision signal. If a user's dwell time on an item exceeds the average time, that user and item constitute a positive sample; those whose dwell time does not exceed the average time are constructed as negative samples. Through the design of the loss function, the model can learn the long-term user interests of positive samples more accurately. The loss function is as follows:
[0086]
[0087] in, The loss function; When y=1, it means that the user has interacted with the current item; when y=0, it means that the user has not interacted with the current item. This indicates that the item vector representation is learned from the user's interaction with the item, and the user stays on the item for a longer period than the average stay time. This indicates that the item vector representation is learned from the user's interaction with the item, and the user's time spent on the item does not exceed the average time spent on it. This indicates items for which users spend more time than the average time. This indicates items for which users did not spend more time than the average time.
[0088] Introducing a user's long-term interest set serves two purposes: one is that at each stage of a session, the long-term interest set can be used to match the user's short-term interests through SiM. The matched short-term interest vectors will be combined with the user's current hidden state to describe the user's current behavior in a more granular way. The other is that after a session ends, the long-term interest set will store the user's information in that session and use the sequence learning capability of recurrent neural networks to model the evolution of the user's long-term interests.
[0089] During the interaction between users and the platform, users convey a very focused and clear intent to the model through the currently clicked item, so the recommended results should not be generalized arbitrarily; however, at the same time, excessive aggregation will reduce the efficiency of distribution and cause users to feel fatigued during browsing. Therefore, the strategy of "clear intent, moderate divergence" should be followed.
[0090] Given a user in the first Long-term interest set within a session The task of this embodiment is to extract the user's short-term interests at this stage from the long-term interest set through the preceding behaviors within the session, and to abstract this operation into a matching operation:
[0091]
[0092] in, This indicates that the user is in the [number]th [month]. The first in the first session Short-term interests at each stage. A common practice is to average the user's interest vectors:
[0093]
[0094] in, This represents the number of stages, and also the number of times the item is interacted with in the current session.
[0095] Using averages results in short-term interests that remain static throughout the session. To more realistically simulate user preferences in real-world scenarios, we need finer-grained short-term interest preferences. Therefore, we designed a module in the model that matches user short-term interests with long-term interests, processing the user's preceding behavior sequence... Long-term interest set of users Perform efficient vector similarity search (ScaNN), i.e. Figure 4 The operation shown includes the following steps:
[0096] First Map to the embedding space, and then in all Find the embedding vector that is closest to the query vector among the embedding vectors; the vector lookup process is as follows:
[0097] Suppose there are two embedding vectors and Quantize each to one of the two centers or ;
[0098] Each Quantified as So that the inner product As close as possible to the original inner product This process can be visualized as making exist The projection amplitude on is as similar as possible to exist Projection amplitude on;
[0099] In traditional quantization methods, for each Choosing the nearest center will result in an incorrect relative ranking of the two points: Greater than But in reality Less than Therefore, anisotropic vector quantization is used to... Assigned , will Assigned This reduces inner product error and improves accuracy, as shown below:
[0100]
[0101] in, , express The scale parameters; express and Parallel residuals; express and orthogonal residuals; The table calculates the vector magnitude.
[0102] In this embodiment, As an embedding vector, As the difference, we find the user interest vector that best matches the long-term interest set, i.e., we find the difference. The smallest vector, express:
[0103]
[0104] Finally, use As an attention function, and Use a function to calculate the effect of normalization:
[0105]
[0106] Attention function Read a vector obtained by matching from the user's long-term interest set. and As input, and output the influence value between them. A higher value indicates that the interest will have a more significant impact on the user at the current stage. A user's short-term interests can be represented as follows: Value-weighted average:
[0107]
[0108] A user's interests typically change between different sessions. To simulate this phenomenon of interest evolution, an interest evolution module is proposed. Its advantage is that it can provide more historical information for the final interest representation, and the trend of interest evolution can be used to better predict the sequence of items clicked by the user.
[0109] Because users' long-term interests exhibit two characteristics during evolution: firstly, as the diversity of interests increases, user interests drift, and this drift can influence user behavior; secondly, although user interests may influence each other, each interest has its own evolutionary process. Therefore, this embodiment only focuses on the development process related to the target project. Figure 5 In the interest evolution module, an attention mechanism is used to overcome the phenomenon of interest drift, represented as:
[0110]
[0111] in, Let be the vector representation of the candidate item. It is the weight matrix, calculated as follows. Weight values for candidate items based on different interests; nH is the embedding dimension, i.e., the size of the item vector; nH is the degree of the hidden layer.
[0112] After adding the Attention mechanism, the weights of the update gates are controlled by the Attention Score. This preserves the original update direction while adjusting the update intensity of the hidden state based on its relevance to the candidate item. By accurately controlling when, how much, and in what direction to update, this approach solves the information loss problem caused by directly multiplying the Attention Score by each interest vector as input to the next layer of a standard GRU. This can be expressed as:
[0113]
[0114]
[0115] The update factor is calculated in AUGRU. Need to be multiplied by one Weighting factor, as the final update factor .in , This is the hidden state of AUGRU. It is a bitwise multiplication operation.
[0116] In this model, GRU is chosen as the implementation of the RNN to model the user's click sequence within a session. Due to its unique gate unit design, GRU is an RNN structure that can efficiently extract information from time series with long-range dependencies. Specifically, it includes:
[0117] Defined in the input sequence Each stage ( =1,2,…, The GRU unit of ) is: item input User short-term interest input intermediate hidden state Hidden state , update door Reset the door Output vector , where the gate vector and The value range of is [1, 0]. The transfer equation of the GRU cell is as follows:
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] in , , This represents the transformation matrix of a GRU cell. , and It is a matrix used to calculate the output value; It is the sigmoid activation function. It is a bitwise multiplication operation.
[0124] like Figure 2 The GRU unit used in this embodiment differs from the traditional GRU unit in three ways, specifically including the following:
[0125] GRU initial state values It is assigned by the interest evolution module, which contains the user's interest information in the previous session, i.e., the long-term interest set, thus alleviating the cold start problem of traditional GRU;
[0126] Each GRU unit has an additional input supervision signal, which refers to the user's short-term interest input. ;
[0127] Unlike traditional GRUs that directly output hidden states, this one uses additional... and To construct the output vector;
[0128] Experimental results show that, compared with traditional models, the proposed model can effectively improve model performance after the above improvements.
[0129] After obtaining the number Output value of each stage Then, use one The function layer calculates the predicted probability values for all candidate items:
[0130]
[0131] in, The number of items in the item set V; It refers to the items in the nth stage of the predicted s-th session. The probability of being clicked is used to rank items in descending order, and then the items are recommended to the user accordingly.
[0132] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A conversation-aware recommendation prediction method for e-commerce platforms based on short-term and long-term interests, characterized in that, Includes the following steps: Acquire online data, including basic user information, basic item information, and conversation sequences of user behavior; By acquiring online data, user behavior and preferences are extracted, and a long-term interest set for users is constructed. A historical item matrix is obtained based on the session sequences of historical user behavior. This historical item matrix is then convolved using multiple convolutional kernels of different scales. Each convolutional kernel corresponds to a user's preference feature map. All preferences are concatenated and then passed through a fully connected layer to transform them into the user's long-term interests. The long-term interests obtained from all user sessions constitute a long-term interest set. If... Each convolution kernel performs a convolution operation on the historical item matrix, and the convolution kernel matrix is represented as follows: Then, the user's long-term interest obtained in the i-th session is represented as: in, Represents the ReLU activation function; This represents the concatenation operation; H is the historical item matrix, represented as... , Let represent the interactive item vector mapped to the i-th sub-session. This is the weight matrix of the fully connected layer. For bias terms of fully connected layers; For a value in the historical item matrix, there is a certain probability that the value will be forcibly set to 0, and this probability is expressed as: Where O represents the probability of setting a certain value in the historical item matrix to 0; User vector representation; Items are represented by vectors; This represents the user vector representation learned from the user's interaction with items; This represents the item vector representation learned from user-item interactions; The process of learning user and item vector representations through user-item interaction involves gradually reducing the loss function until a set threshold is reached. The loss function is expressed as: in, The loss function; When y=1, it means that the user has interacted with the current item; when y=0, it means that the user has not interacted with the current item. This indicates that the item vector representation is learned from the user's interaction with the item, and the user stays on the item for a longer period than the average stay time. This indicates that the item vector representation is learned from the user's interaction with the item, and the user's time spent on the item does not exceed the average time spent on it. Interest matching is used to obtain a user's short-term interests at the current stage from the user's long-term interest set, which can be represented as: , in, For the short-term interests in the nth stage of the s-th session; This represents the long-term interest obtained in the i-th session; M represents the number of elements in the long-term interest set. For the number of stages, This represents the weight of short-term interests in the nth stage of the s-th session. A vector is calculated by using an attention mechanism and matched from the user's long-term interest set. right The influence is a vector obtained by matching users' long-term interest sets. Represented as: in, The embedding vector representing the user's long-term interest set and the session sequence representing the current user's behavior. The difference projected onto the embedding space vector; This represents the long-term interest obtained during the i-th session; Represents the quantized result ; This indicates the inner product. Represents the weighting function; Expressing the request The value is the average value within the set Q; Q represents all preceding actions of the user in the current session; A predictive model is constructed, taking the user's click sequence within a session (item input) and the user's short-term interests at the current stage as input. The predictive model outputs predicted items and makes recommendations. A predictive model is also constructed based on a gated loop unit, where the output of the gated loop unit is passed through... The function layer predicts the probability of each item being clicked and recommends items to the user in descending order of probability. This process can be represented as: in, Input vector for the item; For users' short-term interests, This is an intermediate hidden state. It is in a hidden state. To update the door, To reset the door, This is the output vector; , , This represents the transformation matrix of a GRU cell. , , The weight matrix representing the GRU cell; This represents the sigmoid activation function. This indicates a bitwise multiplication operation; Describes the first item in the set V of items. The probability that an item will be clicked. V represents the number of items in the item set V, and W represents the weight matrix connecting the hidden layer to the output layer.