A Recommendation Method Based on Popularity Data-Enhanced Long-Short Session Interest Sequences
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU LUTE DIGITAL TECH CO LTD
- Filing Date
- 2025-12-01
- Publication Date
- 2026-05-26
Smart Images

Figure CN122087199A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for recommending long- and short-term conversation interest sequences based on popularity data augmentation, belonging to the field of natural language processing and text mining technology. Background Technology
[0002] With the widespread adoption of mobile internet technology and social media platforms, these have become indispensable parts of modern people's social interactions and daily lives, transforming traditional communication models. These platforms have significantly promoted information dissemination and social connection; however, the massive amount of content generated by these platforms has led to "information overload," posing a challenge to users' ability to efficiently filter and find personalized information. In this context, recommender systems have become a key technological solution. By analyzing users' historical behavior and preferences, recommender systems can push relevant social content and information based on users' interests, thereby improving the overall user experience. While recommender systems have demonstrated significant value in driving user satisfaction, they also face a series of challenges. Continuing to deepen the exploration and research into the fundamental theories of recommender systems, and enhancing their intelligence and user experience, is a direction that should be continuously focused on and pursued.
[0003] Current sequence-based recommendation strategies have made progress in capturing the correlation between user preferences and time / popularity by introducing session popularity calculation methods. However, this method still faces some challenges in practical applications. First, although analyzing user behavior sequences according to sessions improves the sensitivity to interests in different time periods, it may also exacerbate the inherent sparsity problem of the data, especially when the user interaction sequence is short or the number of interactive items in the segmented sessions is small. This hinders the model's ability to provide high-precision recommendations. Second, user preference learning mainly relies on self-attention mechanisms to model the sequence as a whole, without explicitly distinguishing between users' long-term and short-term session interests, which also limits the interpretability of the model. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings and deficiencies of the existing technologies by proposing a long-short-term conversation interest sequence recommendation method based on popularity data augmentation. This method is based on popularity data augmentation methods (Pop-Insert and Pop-Substitute), combined with a contrastive learning framework to alleviate the data sparsity problem, and adopts a long-short-term conversation interest recommendation model. It is expected to overcome the sparsity problem while achieving more accurate, reasonable, and more interpretable sequence recommendations.
[0005] The technical solution adopted by this invention to solve its technical problem is: a method for recommending long- and short-term conversation interest sequences based on popularity data augmentation, which includes the following steps:
[0006] Step 1: Pop-Insert based on popularity
[0007] First, the present invention determines the number of items to be inserted by selecting μ positions from the original sequence for inserting items, where μ = γn, n is the sequence length, γ is the insertion ratio, and γ ∈ [0,1].
[0008] Then, the present invention in the original sequence Find locations with significant time differences and insert items. Time difference sequence. Select the top μ largest interaction time differences as the target area for inserting projects:
[0009] (p1,p2,…,p μ = max_Time Difference(D u (4.1)
[0010] This invention targets the region (p1, p2, ..., p) μ Perform a random insertion in each of the following arrays, and the final insertion position will be (p′1, p′2, ..., p′). μ ).
[0011] Finally, the present invention is in (p′1,p′2,…,p′) μ Insert relevant items to generate the enhanced sequence. Insertion positions (p′1, p′2, ..., p′) μ ) may exist In different sessions of the sequence, this invention assumes (p′1, p′2, ..., p′) μ Any insertion position p′ in ) i , p′ i The current session is conversation The popularity of the project is Calculate the average popularity of this session:
[0012]
[0013] in It is a conversation The length of the session. Based on average session popularity. Select the items with the closest popularity from those that user u has not interacted with. The m items are selected as the candidate insertion item set C = (c1, c2, ..., c m ).
[0014] For candidate item c in the candidate insertion item set i Calculate the cosine similarity between the inserted item and the item preceding and following it. The vector of the preceding item is represented as e. prevThe vector representation of the second item is e. next Candidate project c i Vector representation is The formula for cosine similarity is:
[0015]
[0016] According to candidate project c i cosine similarity sim with the vector of the item preceding the insertion position prev The cosine similarity sim with the vector of the next item. next The candidate item with the highest sum of cosine similarities to the preceding and following items is selected as the insertion item. The resulting enhanced sequence is then obtained.
[0017] Step 2: Pop-Substitute
[0018] The Pop-Substitute operator requires determining the number of replacement items, h, where h = ρn. The parameter ρ specifies the replacement ratio, ρ ∈ [0, 1]. To determine the replacement items, the time difference sequence is... Using a sliding window of size 2, starting from the first element of the sequence, the sum of two elements within the window is calculated each time. in, After obtaining the sum d of all interaction time differences between preceding and following items, select the h items with the smallest sum of interaction time differences between preceding and following items as the items to be replaced:
[0019] (item1,item2,…,item h )=min_TimeDifferenceSum(d) (4.4)
[0020] sequentially for (item1, item2, ..., item) h The items in the sequence are replaced. For the selection of replacements, the same method as the Pop-Insert operator is used: first, the average popularity of the session is considered, then the cosine similarity metric between items is calculated. The h candidate items that are most relevant to the preceding and following items in terms of both popularity and similarity are selected as replacements, resulting in the enhanced sequence.
[0021] Beneficial effects:
[0022] 1. This invention can effectively alleviate data sparsity. It includes two operators, Pop-Insert and Pop-Substitute, and strategically generates semantically coherent augmented sequences based on item popularity and contextual information. Combined with a contrastive learning framework, the model can make full use of augmented data to improve robustness and achieve the effect of regularization.
[0023] 2. This invention significantly improves accuracy and interpretability, and clearly distinguishes between users' long-term interests based on historical multi-sessions and short-term interests based on recent sessions. By modeling the interests at both time scales through independent network modules, it achieves dynamic adaptive fusion of a learnable gating mechanism.
[0024] 3. Experimental results show that the PDLS-SR of this invention demonstrates outstanding performance, especially when dealing with larger and sparser datasets, reflecting the effectiveness of the popularity data augmentation method. Attached Figure Description
[0025] Figure 1 This is a diagram of the PDLS-SR model of the present invention.
[0026] Figure 2 This invention relates to the Pop-Insert and Pop-Substitute popularity enhancement operators.
[0027] Figure 3 This is a schematic diagram of the experimental results of parameters α and β in MovieLens 100K of this invention.
[0028] Figure 4 This is a schematic diagram of the experimental results of parameters α and β in MovieLens 1M of the present invention.
[0029] Figure 5 This is a schematic diagram of the ablation experiment results using MovieLens 100K according to the present invention.
[0030] Figure 6 This is a schematic diagram of the ablation experiment results using MovieLens 1M according to the present invention.
[0031] Figure 7 This is a schematic diagram of the ablation experiment results of Goodreads Spoilers according to the present invention. Detailed Implementation
[0032] The invention will now be described in further detail with reference to the accompanying drawings.
[0033] like Figure 1 As shown, this invention uses a popularity-based data augmentation method (Pop-Insert and Pop-Substitute) and a contrastive learning framework to alleviate the data sparsity problem. It also employs a long-short-term conversation interest recommendation model to solve the sparsity problem while achieving more accurate, reasonable, and logically interpretable sequence recommendations.
[0034] This invention first defines basic concepts. Formally, let U = {u1, u2, ..., u, ...} and I = {i1, i2, ..., i, ...} represent the user set and item set, respectively. For each user u ∈ U, this invention divides the user interaction sequence into multiple sessions. Its sequence behavior is represented as Where t is the current session, Let represent the i-th session in a user sequence. Each session represents a user's behavior within a short period. Clearly, a session... The items recently purchased by user u reflect their short-term interests during session t. Furthermore, the long-term behavioral sequence of user u in session (1,t-1) (before time t) is denoted as... This demonstrates the long-term preference for u. The present invention will respectively... and These are referred to as long-term and short-term behaviors relative to the t-th segment of the session.
[0035] (1) Popularity-based data augmentation operators Data augmentation methods used in sequence recommendation include common operators such as cropping, masking, reordering, inserting, and substituting, which are widely used in recommender systems.
[0037] These data augmentation methods select random positions within the sequence to augment the original sequence, ignoring the inherent temporal structure and semantic relationships. For example, rearrangement operators may disrupt the temporal order and contextual dependencies of the original sequence, making it difficult for the model to accurately grasp the changing patterns of user interests over time, thus interfering with the judgment of recommended items. Pruning and masking operators have the potential to further shorten the already short original sequence, easily exacerbating the data sparsity problem and making it difficult for the model to learn effective sequence representations. To overcome the limitations of the above augmentation methods that ignore the correlation between the sequence and ensure that the data augmentation process maintains the inherent logic of changes in user interests, this invention proposes data augmentation operators that combine interaction time difference and popularity. These operators do not perform augmentation operations randomly, but rather strategically determine the position of the augmentation operation by leveraging the inherent temporal characteristics of the sequence, such as interaction time difference. The popularity-based similarity metric proposed in this invention is used to select candidate items for augmentation. The goal of this process is to ensure that the inserted or replaced items are related to the context in terms of popularity features and item attributes, thereby preserving the core preference patterns contained in the user's historical behavior sequence. The augmented sequences generated in this way are not only more reasonable in terms of context dependency, but also provide higher-quality and more informative feature representations for subsequent contrastive learning. The Pop-Insert and Pop-Substitute augmentation operators are illustrated below. Figure 2 As shown.
[0038] (1) Popularity-Insert
[0039] First, the present invention determines the number of items to be inserted by selecting μ positions from the original sequence for inserting items, where μ = γn, n is the sequence length, γ is the insertion ratio, and γ ∈ [0,1].
[0040] Then, the present invention in the original sequence Find locations with significant time differences and insert items. Time difference sequence. Select the top μ largest interaction time differences as the target area for inserting projects:
[0041] (p1,p2,…,p μ = max_Time Difference(D u (4.1)
[0042] This invention targets the region (p1, p2, ..., p) μ Perform a random insertion in each of the following arrays, and the final insertion position will be (p′1, p′2, ..., p′). μ ).
[0043] Finally, the present invention is in (p1′,p2′,…,p′) μ Insert relevant items to generate the enhanced sequence. Insertion positions (p1′, p2′, ..., p′) μ ) may exist In different sessions of the sequence, this invention assumes (p1′,p2′,…,p′) μ Any insertion position p in ) i ′, p i The current session is conversation The popularity of the project is Calculate the average popularity of this session:
[0044]
[0045] in It is a conversation The length of the session. Based on average session popularity. Select the items with the closest popularity from those that user u has not interacted with. The m items are selected as the candidate insertion item set C = (c1, c2, ..., c m ).
[0046] For candidate item c in the candidate insertion item set iCalculate the cosine similarity between the inserted item and the item preceding and following it. The vector of the preceding item is represented as e. prev The vector representation of the second item is e. next Candidate project c i Vector representation is The formula for cosine similarity is:
[0047]
[0048] According to candidate project c i cosine similarity sim with the vector of the item preceding the insertion position prev The cosine similarity sim with the vector of the next item. next The candidate item with the highest sum of cosine similarities to the preceding and following items is selected as the insertion item. The resulting enhanced sequence is then obtained.
[0049] (2) Popularity-Substitute
[0050] The Pop-Substitute operator requires determining the number of replacement items, h, where h = ρn. The parameter ρ specifies the replacement ratio, ρ ∈ [0, 1]. To determine the replacement items, the time difference sequence is... Using a sliding window of size 2, starting from the first element of the sequence, the sum of two elements within the window is calculated each time. Where i = 1, 2, ..., |L u -2. After obtaining the sum d of the interaction time differences between all preceding and following items, select the h items with the smallest sum of interaction time differences as the items to be replaced:
[0051] (item1,item2,…,item h )=min_TimeDifferenceSum(d) (4.4)
[0052] sequentially for (item1, item2, ..., item) h The items in the sequence are replaced. For the selection of replacements, the same method as the Pop-Insert operator is used: first, the average popularity of the session is considered, then the cosine similarity metric between items is calculated. The h candidate items that are most relevant to the preceding and following items in terms of both popularity and similarity are selected as replacements, resulting in the enhanced sequence.
[0053] The Pop-Insert and Pop-Substitute data augmentation operators differ significantly in their target location selection strategies. The Pop-Insert operator primarily focuses on regions with large interaction time differences within the user interaction sequence. Excessive interaction time differences often indicate data sparsity or information gaps; directly introducing new interaction information at these locations can alleviate data sparsity, prevent learning biases that may arise from prolonged periods of inactivity, and promote the normalization of the sequence's distribution over time. The Pop-Substitute operator, on the other hand, is mainly applied to dense regions within the sequence with small interaction time differences. Its design aims to overcome the limitations of traditional random substitution operators, such as disrupting the sequence's contextual integrity and losing user preference information.
[0054] By referencing the average popularity of the session and cosine similarity to select items for insertion or replacement, the problem of amplified popularity bias and model overfitting caused by inserting or replacing items with high popularity similar to those in the context can be avoided. It also prevents the introduction of items completely disconnected from the semantic context, which could disrupt the inherent coherence of user behavior sequences. This data augmentation method, which balances contextual adaptability and preference coherence, is unprecedented.
[0055] (2) Contrastive learning loss function
[0056] Contrastive learning loss functions are widely used in self-supervised learning and representation learning. Their fundamental goal is to construct a structured embedding space by learning the relative relationships between data points in the absence of explicit labels, capturing the inherent semantic structure of the data and generating representations that can effectively distinguish different instances or entities. Specifically, semantically similar positive sample pairs are placed close to each other in the embedding space, while semantically dissimilar negative sample pairs are placed far apart, guiding the model to learn representations that are not only meaningful but also highly discriminative, capturing the essential features of the data.
[0057] To ensure the model accurately identifies whether the two generated augmented representations originate from the same user's historical sequence interaction representations, this invention optimizes the encoder by maximizing the consistency between positive sample pairs. When processing small batches of data, for a set of user behavior sequences {L} u} N For u∈{1,2,...,N}, this invention uses the Pop-Insert and Pop-Substitute enhancement operators to generate 2N enhancement sequences {L}. 1 ,L 2 ,...,L 2u-1 ,L 2u ,...,L 2N-1 ,L 2N}. This invention will generate (L) for each user u2u -1 ,L 2u ) are considered as a pair of positive samples, L 2u-1 For the enhanced sequence obtained by the Pop-Insert operator, L 2u The boosted sequence is obtained by the Pop-Substitute operator. The other 2(N-1) boosted sequences are used as negative samples for this pair of positive samples. {L 1 ,L 2 ,...,L 2u-1 ,L 2u ,...,L 2N-1 ,L 2N The sequence will pass through an embedding layer, resulting in an embedded representation of the enhanced sequence as {e1, e2, ..., e...}. 2u-1 ,e 2u ,...,e 2N-1 ,e 2N}. Comparative learning loss function Optimization methods.
[0058]
[0059] Here, sim is used to measure the similarity between two enhanced sequence representations. It is an indicator function. z Used to measure the similarity between different augmented sequence representations. sim(e 2u-1 ,e z The calculation is e. 2u-1 Compared with all other augmented sequence representations (including e) 2u Other negative sample augmentation sequence representations e z The similarity between samples (z≠2u-1). τ is a temperature coefficient that can change the distribution range and shape of the similarity distribution, thereby adjusting the similarity calculation between samples and affecting the model's ability to distinguish between positive and negative samples. As an additional structural constraint, the model is restricted from arbitrarily adjusting its representation simply to optimize the prediction of the next item, thereby reducing noise in the training data and preventing overfitting during model training.
[0060] This invention includes a long-short session interest sequence recommendation framework. This framework relies on session segmentation, dividing a user's historical behavior sequence into two parts: long-term behavior spanning multiple sessions and short-term behavior from the most recent session. Independent network modules are used to learn interest representations at these two different time scales, and then the two interest representations are fused. This mechanism of separating and fusing long-short-term interests improves the accuracy of sequence recommendations and lays a clearer foundation for understanding user decisions.
[0061] (1) Embedding layer Most existing methods implicitly group users, such as user-based collaborative filtering (CF) and user community algorithms, which cannot explicitly model the correlation between item categories. Furthermore, some studies have captured the association between user preferences and items by explicitly incorporating user category information as user features through category embedding.
[0063] To further explore the potential relationships between users and projects, this invention uses user interaction vector e. I With user preference vector e pref Location embedding and interaction time difference embedding are not used in this invention, but will be handled in detail in the historical session representation extraction layer.
[0064] User interaction vector e I With user preference vector e pref Establish a connection.
[0065] e u =e I +e pref (4.6)
[0066] The comprehensive embedding vector e is obtained u .
[0067] For the augmented sequence {L} obtained by the augmentation operators Pop-Insert and Pop-Substitute 1 ,L 2 ,...,L 2u -1 ,L 2u ,...,L 2N-1 ,L 2N}, respectively using a learnable embedding matrix M ins M sub By retrieving the position embedding matrix, the embedding representation of the enhanced sequence {e1,e2,...,e...} is obtained. 2u-1 ,e 2u ,...,e 2N-1 ,e 2N} is used to calculate the contrastive learning loss function.
[0068] (2) Historical Conversation Representation Extraction Layer
[0069] To capture long-term user behavior information, this invention proposes a session-based location embedding method. This method can deeply mine changes in user preferences across different sessions, better characterizing users' long-term interests.
[0070] This invention relates to the long-term behavior sequence of user u. Each session Allocate a position to embed pos i Position embedding pos i It is trainable and user-specific. This is because different users exhibit significant differences in behavioral patterns and interests across different sessions; through trainable location embeddings, the model can learn the unique behavioral patterns of each user. Let s i It is a conversation The embedded representation. This invention embeds the position into pos. i With s i Calculate and obtain the user's session-based historical representation hist i .
[0071]
[0072] Here, ⊙ represents the element-wise product operation, and α is a globally trainable parameter used to adjust the influence of positional embedding. In this way, the historical session representation of user u is obtained, denoted as: This invention can dynamically weaken or strengthen the impact of long-term behavior in order to better capture users' long-term interests and preferences.
[0073] (3) Long-term interest evolution layer
[0074] In fact, user behavior sequences always contain a large amount of temporal information. To effectively capture long-term user preferences, this invention constructs a long-term interest evolution layer, which integrates self-attention mechanisms and GRUs (Gated Recurrent Units) to mine long-term user behavior patterns. This invention is based on user historical representation H... t u -1 Consider the long-term interests of the first (t-1) sessions in the user interaction sequence.
[0075] GRU is a variant of LSTM with a simpler gate structure. Compared to LSTM, GRU not only solves the long-term dependency problem of RNN, but also has fewer parameters, reducing the computational cost of LSTM.
[0076] The formula for calculating the GRU gated unit is as follows:
[0077] z i =ρ(W z hist i +U z h i-1 b z (4.8)
[0078] r i =ρ(W r hist i +U r h i-1b r (4.9)
[0079]
[0080] h i =(1-z) i )⊙h i-1 +z i ⊙h i (4.11)
[0081] Where ρ(.) is the Sigmoid activation function, ⊙ is the element-wise product operation, and W z U z W r U r W h and U h It is the weight parameter matrix, b z With b r It is the bias vector, hist i It is a historical representation of conversation i, h i-1 It is the long-term preference output from the previous session. It is a candidate hidden state, h i It is the output vector.
[0082] This invention calculates attention scores. Furthermore, normalization was performed, and the attention mechanism was introduced into the GRU network to obtain a new GRU network that incorporates the attention mechanism.
[0083]
[0084] Then the present invention will obtain the attention score As the weights of the update gates in the interest evolution layer:
[0085]
[0086] The calculations are performed sequentially on the user sequence, and the output vector h of session (t-1) is finally obtained. t-1 This is used as the long-term interest vector u of user u. t-1 .
[0087] (4) Short-term interest extraction layer
[0088] Users' long-term preferences can be inferred from their long-term behavioral records, but these preferences do not accurately reflect their recent interests. For the next recommendation task, short-term interests are generally more important than users' long-term preferences, especially on sparse datasets. Therefore, this invention separates short-term behavior to emphasize the role of users' recent behavior. The first (t-1) sessions in the user sequence have been considered by the long-term interest evolution layer, and the last t-th session of the sequence... Such behavior becomes the focus of attention in the short term.
[0089] This invention defines a short session as the last session t in a user interaction sequence, without using time information and location embedding, in order to highlight short-term interests and reduce model complexity.
[0090]
[0091] Where e u It is the composite embedding vector obtained from the embedding layer. ⊙ represents element-wise addition, and ⊙ represents element-wise product. W3, U3, W4, and U4 are weight parameter matrices, and b3 and b4 are bias vectors. i e j It is a conversation The embedding representation of the items in the middle. Finally, the short-term interest vector u of the user in session t is obtained. t .
[0092] (5) Integration of short-term and long-term interests
[0093] In sequence recommendation systems, fusing users' long-term and short-term interests is crucial for accurately predicting recommended items. Most current methods rely on static fusion strategies, such as using fixed weighting coefficients or simple vector concatenation. These non-adaptive methods ignore the fluctuating relative importance of long-term and short-term interests across different prediction scenarios, making it difficult to accurately capture the dynamic changes in users' needs in real time. To overcome this limitation, this invention introduces a learnable gating mechanism. This mechanism dynamically adjusts the contribution values of long-term and short-term interest representations in preference formation. Based on the current sequence context, a set of adaptive fusion weights is generated. These weights can be used to weight and synthesize the separately learned long-term and short-term interest vectors to obtain a comprehensive preference vector that matches the user's current context.
[0094] gate = [u t |u t-1 ]·W gate +b gate (4.17)
[0095] gate = softmax(gate) (4.18)
[0096] Among them, u t-1 Represents the long-term interest vector, u t W represents the short-term interest vector, [·|·] represents the concatenation operation. gate It is a learnable weight matrix, b gate It is the bias vector. Using formulas (4.18) and (4.19), a linear transformation and normalization are performed on the concatenated vector to obtain a new vector `gate`, which includes two elements `g`. L ∈[0,1]、g S ∈[0,1], representing the influence weights of long-term and short-term interests on determining the user's current preferences, respectively.
[0097] By W gate and b gate The parameterized gating mechanism learns to assign appropriate weights to short- and long-term interests based on the current context of the user sequence. This is based on relative weights. For the long-term interest vector u t-1 and short-term interest vector u t Weighted fusion yields the fused user current preference vector p. t .
[0098] (4.19) (6) Network training This invention trains a Long Short-Term Interest Network (LSI) using interaction sequences from all users in the training set, and then predicts items in the test set. Specifically, the closer the predicted items are to the actual items, the more effective the model. In this invention, it is only necessary to predict whether the next item will be interacted with. Therefore, this invention chooses the sigmoid cross-entropy loss function to optimize the model. (4.20) in, Represents the sorting function. and It uses L2 loss weights. Labels are used. express, This represents the sigmoid function.
[0103] To avoid the possibility that models might find "shortcuts" or memorize certain patterns in the training data to achieve low loss in cases of sparse data, this invention incorporates a contrastive learning loss function. As a regularization term, on the one hand, it alleviates the data sparsity problem by contrastively learning two enhanced sequences; on the other hand, it imposes structural constraints on the representation space, enabling the model to learn smoother and more robust feature representations, reducing the possibility that the model only fits specific or accidental patterns in the training data, and avoiding model overfitting.
[0104]
[0105] Here, θ serves as a weighting coefficient, used to adjust the contrastive learning loss function. Its influence.
[0106] The simulation experiments and performance analysis of this invention specifically include:
[0107] 1) Experimental setup
[0108] This invention used three real-world datasets: MovieLens 100k, MovieLens 1M, and Goodreads Spoilers. Statistical data for each dataset are shown in Table 1.
[0109] Table 1 Data Statistics
[0110]
[0111] 2) Parameter settings
[0112] The main parameters of the network model were obtained through gridded search to obtain relatively optimal values. The main parameters of the network model are shown in Table 2.
[0113] Table 2 Network Model Parameters
[0114]
[0115] 3) Hyperparameter experiments
[0116] (1) The effect of different insertion ratios β and replacement ratios α
[0117] In the parametric experiments, this invention investigated the impact of the insertion ratio β and replacement ratio α on model performance using the MovieLens 100K and MovieLens 1M datasets. The evaluation metric used was Precision@10. The experimental results are as follows: Figure 3 As shown.
[0118] In MovieLens 100K, with the insertion ratio β fixed at 0.1, the NDCG@10 metric increased by 3.6% as the replacement ratio α increased from 0.1 to 0.2, showing an upward trend. This indicates that at this insertion ratio, moderately increasing the replacement ratio helps improve model performance. However, when α continued to increase from 0.2 to 0.5, the NDCG@10 metric continuously decreased by approximately 14%. This suggests that at an insertion ratio of 0.1, an excessively high replacement ratio can negatively impact model performance, possibly because excessive replacement operations alter the features of the original sequence, making it difficult for the model to accurately learn user interests. When the insertion ratio β was 0.2, the NDCG@10 metric decreased by 7.5% when α decreased from 0.1 to 0.2. Subsequently, when α increased from 0.2 to 0.3, the metric rebounded by 4.2%. Afterward, when α increased from 0.3 to 0.4 and 0.5, the metric remained essentially unchanged. This shows that at this insertion ratio, the impact of changes in the replacement ratio on model performance is complex. A replacement ratio that is too small or too large is detrimental to model performance. There exists a relatively suitable range for the replacement ratio, allowing the model to better learn user interest features and optimize recommendation results. When the insertion ratio β is 0.3, as α increases from 0.1 to 0.2, the NDCG@10 index rises by 4.5%. When α increases from 0.2 to 0.3, the index reaches its highest value of approximately 0.0975. Subsequently, as α increases from 0.3 to 0.5, the index gradually decreases by 6.7%. This indicates that at this insertion ratio, moderately increasing the replacement ratio can improve model performance. However, exceeding a certain threshold will cause model performance to decline due to an excessively high replacement ratio. In other words, excessive replacement interferes with the model's learning of effective information, affecting the accuracy of recommendations.
[0119] (2) The influence of weights θ of different contrastive learning loss functions
[0120] Experiments were conducted on the contrastive learning loss function weights θ in the PDLS-SR model on the MovieLens 100K and MovieLens 1M datasets to explore the modulating effect of the contrastive learning loss function on model performance. The experimental results are shown in Tables 3.3 and 3.4.
[0121] Table 3 shows the optimal values of θ in MovieLens 100K.
[0122]
[0123] Table 4 shows the optimal values of θ in MovieLens 1M.
[0124]
[0125] By analyzing the experimental data with different contrastive learning loss function weights θ in Tables 3 and 4, we can clearly understand their impact on the performance of the PDLS-SR model, providing a basis for model optimization. These two tables show the changes in the Precision@10 and NDCG@10 metrics of the model on the MovieLens 100K and MovieLens 1M datasets when the contrastive learning loss function weights are 0.1, 0.5, 1.0, 1.5, and 2.0, respectively. It is important to note that the larger the θ value, the lower the contrastive learning loss... In total losses The greater the proportion of contrastive learning loss, the better. It can be observed that on both datasets, when θ is 0.1, P@10 reaches its optimal value for both datasets; when θ is 0.2, NDCG@10 reaches its optimal value for both datasets. However, when θ exceeds a certain threshold, model performance drops significantly. This observation suggests that when contrastive learning loss dominates the learning process, it may reduce the performance of sequence prediction tasks. However, as an additional structural constraint, it can prevent overfitting during model training, limit the model from focusing solely on optimizing the prediction of the next item, and effectively integrate augmented information into the model, alleviating data sparsity.
[0126] 4.3.4 Ablation Test To further explore the roles of different modules in the PDLS-SR model, this invention conducts ablation experiments. Three variants were designed and tested on the MovieLens 100K, MovieLens 1M, and Goodreads Spoilers datasets. The performance changes of the model were observed, and the experimental results are shown below. Figure 5 , Figure 6 .
[0128] PDLS-SR(-PA): This variant does not use popularity data augmentation methods.
[0129] PDLS-SR(-Long): This variant does not use user long-term interests in the long-term interest evolution layer.
[0130] PDLS-SR(-Short): This variant does not use user short-term interests in the short-term interest extraction layer.
[0131] As can be seen from the figure, PDLS-SR(-PA) outperforms PDLS-SR on all three datasets. For example, in the MovieLens100K dataset, after removing the popularity data augmentation method, HR@10 decreased by 7.6% and NDCG@10 decreased by 5.3%. This indicates that the Pop-Insert and Pop-Substitute operators proposed in the popularity data augmentation method optimize the sequence from different perspectives. The former supplements sparse region information, while the latter enhances the diversity of the sequence. By comparing the learning loss, the augmented information can be effectively integrated into the model, learning more effective user interest features, increasing the richness and diversity of the data, and alleviating the data sparsity problem.
[0132] PDLS-SR(-Long) and PDLS-SR(-Short) also outperformed PDLS-SR because they do not utilize users' long-term and short-term interests, respectively. This indicates that the long-term interest evolution layer and the short-term interest extraction layer model users' long-term and short-term interests, respectively, complementing each other. The long-term interest evolution layer captures users' long-term behavioral trends and preferences, providing a stable foundation for recommendations; while the short-term interest extraction layer focuses on recent behavioral changes, making recommendations more aligned with users' current needs. Removing either layer prevents the model from comprehensively capturing user interests, leading to a decline in recommendation performance.
[0133] 4.3.5 Comparative Experiment
[0134] To compare the recommendation performance differences among BPR, CoSeRec, SASR, CL4Rec, ContrastVAE, and PDLS-SR, this invention validated the above models on three datasets, and the results are shown in Tables 3, 4, and 5.
[0135] CL4Rec: It was the first method to apply contrastive learning to sequence recommendation. It uses data augmentation to generate positive samples.
[0136] ContrastVAE: A two-branch VAE model with contrast regularization, as an implementation of ContrastELBO for sequential recommendation.
[0137] Table 5 shows the performance of PDLS-SR on MovieLens 100k.
[0138]
[0139] Table 6 shows the performance of PDLS-SR on MovieLens 1M.
[0140]
[0141] Table 7. Effects of PDLS-SR on Goodreads Spoilers
[0142]
[0143] This study compares PDLS-SR with models such as BPR, CoSeRec, SASRec, CL4Rec, and ContrastVAE on three datasets: MovieLens100k, MovieLens 1M, and Goodreads Spoilers. The main evaluation metrics are NDCG@5, NDCG@10, Precision@5, and Precision@10. On the MovieLens 100k dataset, PDLS-SR achieves an NDCG@5 of 0.0388, an improvement of approximately 8.08% compared to ContrastVAE. This indicates that PDLS-SR performs better in ranking the recommended list, placing more relevant items higher up the list, better meeting users' actual needs. On the MovieLens 1M dataset, PDLS-SR's Precision@5 is approximately 9.29% higher than CL4Rec, demonstrating a significant advantage in recommendation accuracy when the recommended list is short, allowing for more precise recommendations of items that users may be interested in. On the Goodreads Spoilers dataset, PDLS-SR improves upon SASRec by approximately 10.31%, demonstrating that even as the recommendation list length increases to 20, PDLS-SR maintains good recommendation ranking quality, providing users with more interest-based recommendation sorting.
[0144] This invention synthesizes experimental results from three datasets. PDLS-SR performs the worst on the Goodreads Spoilers dataset, indicating that when faced with large amounts of data, the recommendation performance of PDLS-SR is significantly reduced, and it can simplify the computational complexity of the model.
[0145] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for recommending long- and short-term conversation interest sequences based on popularity data augmentation, characterized in that, The method includes the following steps: Step 1: Pop-Insert; Determine the number of items to be inserted, and select μ positions from the original sequence for inserting items, where μ = γn, n is the sequence length, γ is the insertion ratio, and γ ∈ [0,1]. In the original sequence Find locations with significant interaction time differences to insert items; time difference sequence Select the top μ largest interaction time differences as the target area for inserting projects: (p1,p2,…,p μ )=max_Time Difference(D u ) (4.1) In the target region (p1, p2, ..., p μ Perform a random insertion in each of the following arrays, and the final insertion position will be (p1′, p2′, ..., p′). μ ); In (p1′,p2′,…,p′) μ Insert relevant items to generate the enhanced sequence, with insertion positions (p1′, p2′, ..., p′). μ ) may exist In different sessions of the sequence, this invention assumes (p1′,p2′,…,pμ′) μ Any insertion position p in ) i ′, p i The current session is conversation The popularity of the project is Calculate the average popularity of this session: in It is a conversation The length, based on the average popularity of the session. Select the items with the closest popularity from those that user u has not interacted with. The m items are selected as the candidate insertion item set C = (c1, c2, ..., c m ); For candidate item c in the candidate insertion item set i Calculate the cosine similarity between the item and the item preceding and following the insertion position, where the vector of the preceding item is represented as e. prev The vector representation of the second item is e. next Candidate project c i Vector representation is The formula for cosine similarity is: According to candidate project c i cosine similarity sim with the vector of the item preceding the insertion position prev The cosine similarity sim with the vector of the next item. next The candidate item with the highest sum of cosine similarity to the preceding and following items is selected as the insertion item, thus obtaining the enhanced sequence. Step 2: Pop-Substitute; The Pop-Substitute operator requires determining the number of replacement items, h, where h = ρn. The parameter ρ specifies the replacement ratio, ρ ∈ [0,1]. To determine the items to be replaced, the time difference sequence is... Using a sliding window of size 2, starting from the first element of the sequence, the sum of two elements within the window is calculated each time. Where i = 1, 2, ..., |L u |-2, after obtaining the sum of all interaction time differences d between the preceding and following items, select the h items with the smallest sum of interaction time differences between the preceding and following items as the items to be replaced: (item1,item2,…,item h )=min_TimeDifferenceSum(d) (4.4) sequentially for (item1, item2, ..., item) h The process involves replacing items in the sequence. For replacement selection, the same method as the Pop-Insert operator is used: first, the average popularity of the session is considered, then the cosine similarity between items is calculated. The h most relevant candidate items in terms of both popularity and similarity to the preceding and following items are selected as replacements, resulting in the enhanced sequence.
2. The method for recommending long- and short-term conversation interest sequences based on popularity data augmentation according to claim 1, characterized in that, The method includes a long-short-term session interest sequence recommendation framework. This framework relies on session segmentation, dividing the user's historical behavior sequence into two parts: long-term behavior across multiple sessions and short-term behavior from the most recent session. Independent network modules are used to learn interest representations at these two different time scales, and the two interest representations are then fused, including: (1) Embedded layer User interaction vector e I With user preference vector e pref Location embedding and interaction time difference embedding are not used in this invention, but will be handled in the historical session representation extraction layer. User interaction vector e I With user preference vector e pref Connect: And u =and I +e pref (4.6) The comprehensive embedding vector e is obtained u ; For the augmented sequence {L} obtained by the augmentation operators Pop-Insert and Pop-Substitute 1 ,L 2 ,...,L 2u-1 ,L 2u ,...,L 2N-1 ,L 2N }, respectively using a learnable embedding matrix M ins M sub By retrieving the position embedding matrix, the embedding representation of the enhanced sequence {e1,e2,...,e} is obtained. 2u-1 ,e 2u ,...,e 2N-1 ,e 2N } is used to calculate the contrastive learning loss function; (2) Historical conversation representation extraction layer; Long-term behavior sequence of user u Each session Allocate a position to embed pos i Position embedded in pos i It is trainable and relevant to user u because different users exhibit significant differences in behavioral patterns and interest preferences across different sessions. Through trainable location embeddings, the model can learn the unique behavioral patterns of each user. Let s i It is a conversation The embedding representation embeds the position into pos. i With s i Calculate and obtain the user's session-based historical representation hist i : hist i =α⊙pos i ⊙s i (4.7) Here, ⊙ represents the element-wise product operation, and α, as a globally trainable parameter, is used to adjust the degree of influence of position embedding. In this way, the historical session representation of user u is obtained, expressed as: (3) Long-term interest evolution layer; A long-term interest evolution layer was constructed, which integrates self-attention mechanism and GRU (Gated Recurrent Unit) to mine long-term user behavior patterns based on user historical representations. Consider the long-term interests of the first (t-1) sessions in the user interaction sequence; GRU is a variant of LSTM with a simpler gate structure. Compared with LSTM, GRU not only solves the long-term dependency problem of RNN, but also has fewer parameters, reducing the computational cost of LSTM. The formula for calculating the GRU gated unit is as follows: With i =ρ(W z hist i +U z h i-1 b z ) (4.8) r i =ρ(W r hist i +U r h i-1 b r ) (4.9) h i =(1-z i )⊙h i-1 +z i ⊙h i (4.11) Where ρ(.) is the Sigmoid activation function, ⊙ is the element-wise product operation, and W z U z W r U r W h and U h It is the weight parameter matrix, b z With b r It is the bias vector, hist i It is a historical representation of conversation i, h i-1 It is the long-term preference output from the previous session. It is a candidate hidden state, h i It is the output vector; By calculating attention scores Furthermore, normalization was performed, and an attention mechanism was introduced into the GRU network to obtain a new GRU network that incorporates the attention mechanism: The obtained attention score As the weights of the update gates in the interest evolution layer: The calculations are performed sequentially on the user sequence, and the output vector h of session (t-1) is finally obtained. t-1 This is used as the long-term interest vector u of user u. t-1 ; (4) Short-term interest extraction layer; Short-term behavior is separated to emphasize the role of recent user behavior. The first (t-1) sessions in the user sequence have been considered by the long-term interest evolution layer, and the last t-th session of the sequence... Such behavior becomes the focus of attention in the short term.
3. The method for recommending long- and short-term conversation interest sequences based on popularity data augmentation according to claim 2, characterized in that, A short session is defined as the last session t in a user interaction sequence. Temporal information and location embeddings are not used here to highlight short-term interests and reduce model complexity. Where e u It is the composite embedding vector obtained from the embedding layer. It is element-wise addition, ⊙ is element-wise product operation, W3, U3, W4, U4 are weight parameter matrices, b3, b4 are bias vectors, e i e j It is a conversation The embedding representation of the items in the middle ultimately yields the user's short-term interest vector u in session t. t ; (5) A layer that integrates short-term and long-term interests; A learnable gating mechanism is introduced, which dynamically adjusts the contribution values of long-term and short-term interest representations in preference formation. Based on the current sequence context, a set of adaptive fusion weights is generated. These weights can be used to weight and synthesize the separately learned long-term and short-term interest vectors to obtain a comprehensive preference vector that conforms to the user's current context. gate=[u t |u t-1 ]·W gate +b gate (4.17) gate = softmax(gate) (4.18) Among them, u t-1 Represents the long-term interest vector, u t W represents the short-term interest vector, [·|·] represents the concatenation operation. gate It is a learnable weight matrix, b gate The bias vector is used to perform a linear transformation and normalization on the concatenated vectors using formulas (4.18) and (4.19) to obtain a new vector `gate`, which includes two elements `g`. L ∈[0,1]、g S ∈[0,1], representing the influence weights of long-term and short-term interests on determining the user's current preferences, respectively. By W gate and b gate The parameterized gating mechanism learns to assign appropriate weights to short-term and long-term interests based on the current context of the user sequence, and according to the relative weights... For the long-term interest vector u t-1 and short-term interest vector u t Weighted fusion yields the fused user current preference vector p. t : (6) Network Training We only need to predict whether the next item will be interacted with, and choose the sigmoid cross-entropy loss function to optimize the model: Where f(.) represents the sorting function, and Θ={U,I,W * ,b * } and λ are the L2 loss weights, the labels are represented by y∈{0,1}, and σ(.) represents the sigmoid function. Using contrastive learning loss function As a regularization term, on the one hand, it alleviates the data sparsity problem by contrastively learning two augmentation sequences; on the other hand, it imposes structural constraints on the representation space, enabling the model to learn smoother and more robust feature representations, reducing the possibility that the model only fits specific or accidental patterns in the training data, and avoiding overfitting. Here, θ serves as a weighting coefficient, used to adjust the contrastive learning loss function. Its influence.