A method for analyzing user level intention from space-time angle in session recommendation
Patent Information
- Application Number
- CN202410682797.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2044-05-29
AI Technical Summary
[0022]尽管现有的工作已经初步探索了挖掘和利用用户意图信息的方法,还不足以建模真实场景中用户的复杂意图
[0027] The beneficial effect of this invention is that by decoupling time intent, the user's long-term and short-term intents are decoupled from the original session, avoiding mutual interference between them during the learning process. Cross-scale contrastive learning innovatively brings the current session representation, representing small-scale intents, closer to relevant large-scale intents in the representation space, while simultaneously distancing it from irrelevant large-scale intents. This not only enriches the information content of the current session representation but also prevents irrelevant items from being included in the recommendation list. Fully mining user intents can achieve the best recommendation effect in the current session recommendation citation.
Smart Images

Figure CN118673129B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to user digital data processing technology, and particularly to recommendation technology based on user sessions. Background Technology
[0002] In the information age, the ever-increasing flow of information has made people's lives more convenient, but it has also brought about the problem of information overload. The sheer volume of information often exceeds the limits of what individuals or systems can accept and process. Therefore, how to effectively filter out the information that users truly need from this massive amount of data has always been a hot topic of discussion in academia and industry. Based on this, recommender systems have emerged. They are mainly based on modeling user profiles and historical preferences to recommend information that is truly valuable and of interest to users. Currently, recommender systems are widely used in e-commerce, news feeds, streaming media platforms, and other fields.
[0003] However, in real-world scenarios, users are often anonymous, such as logged-out guest users, and may only generate a limited amount of interaction information on the platform. To address these issues, the industry has proposed the concept of session recommendation. Session recommendation aims to generate K recommendation results for anonymous users based on their short-term interaction sequences. Interactions include clicking on item links, adding items to favorites, etc. A short-term interaction sequence is a sequence of items that the user interacted with within a set time period from the current time to the previous time, also referred to as a session in this application. Anonymous users refer to users whose privacy data is not extracted. Recommendation results refer to the recommended item information displayed in the user's interactive interface. The item information is anonymized data, represented by numbers. That is, session-based anonymous user recommendation predicts and outputs items that the user may be interested in based on the item information in the user's historical sessions.
[0004] The basic steps of conversation recommendation are as follows:
[0005] Obtain the embedding representation E of the item set V.
[0006] Based on the embedded representation of the items, obtain the user interaction session S. u The embedding representation of E u , where u is the session ID.
[0007] According to the embedding representation E u Learn the representation R of the current session u .
[0008] Calculate the current session representation R u And all items embedded in the representation E u Similarity score Y = f(R) u E u ), where f is the scoring function.
[0009] Based on the similarity score Y, sort and recommend items, and output the items that rank highest.
[0010] The main challenge in building a recommender system lies in effectively modeling the complex relationships between individual items in a session. Past work has often focused on building different model architectures to better capture the complex dependencies between items. Broadly speaking, we categorize these into sequence-based methods and graph-based methods.
[0011] 1. Sequence-based methods
[0012] 1.1 Recurrent Neural Networks (RNNs): RNN-based methods often emphasize the temporal nature of session data, modeling the sequential transfer of interactive items from a temporal perspective. Specifically, the RNN network sequentially accepts each item as input and predicts the next item, while maintaining a memory pool to store information about previous items. This learning model is beneficial for uncovering potential temporal dependencies in the data. However, due to the forgetting nature of RNNs, this type of work cannot effectively model longer sessions.
[0013] 1.2 Attention-based methods: Attention-based methods abandon the strict exploration of temporal relationships and instead explore semantic dependencies between items. Specifically, the attention network calculates the similarity between an item and the remaining items in a session, using similarity as weights to combine feature information from other items to enhance the feature representation of the current item. This method abandons the temporal assumptions of RNNs, which is beneficial for associating items that are far apart in a session, thus overcoming the information forgetting drawback of traditional RNN networks.
[0014] 2. Graph-based methods
[0015] 2.1 Single-channel graph-based methods: Single-channel graph-based methods typically construct a graph of the original session from a single perspective and extract features using graph neural networks (GNNs). Specifically, these methods treat a session as a graph, using items in the session as vertices and item transformation relationships as edges. Compared to sequence-based methods, single-channel graph-based methods are better able to capture item transformation relationships at a higher dimension.
[0016] 2.2 Dual-channel graph-based methods: Dual-channel graph-based methods often model the original session from different perspectives. By extracting and fusing information from different perspectives, more complex feature information can be learned. Specifically, these works often treat the current session as a local graph and sample from the global session to construct a global graph. Through the complementary fusion of local and global graphs, the model can learn richer item feature information.
[0017] The methods described above have made significant contributions to extracting better item features; however, they often treat only individual items as the basic unit of consideration, which limits the amount of information the model can utilize. Recently, researchers have discovered that items with high dependencies tend to exhibit similar information, and considering them together may be able to model general user behavior patterns. These behavioral patterns essentially reflect user intent. By mining user intent information from session data, recommendation models can gain two advantages: accuracy and generalization.
[0018] Accuracy: Unlike previous models that only considered individual items as the basic unit, introducing the concept of user intent allows recommendation models to consider combinations of multiple similar items simultaneously. This makes it easier to discover general user behavior patterns, thus limiting recommendations to items related to that intent. This will improve the accuracy of recommendations.
[0019] Generalization: By considering user intent with more granular information, the recommendation model avoids focusing too much on small-scale, single-item information. This can increase the model's generalization ability to some extent and prevent it from falling into the problem of overfitting.
[0020] Based on the above advantages, many recent studies have focused on exploring how intent information helps with conversation recommendation, and have proposed intent-based mining methods.
[0021] An intent is a set of items with similar characteristics; therefore, the essence of intent mining is to explore which items in a session might share similar characteristics. Existing methods often consider this from a temporal perspective, treating the n most recently interacted items in a sequential order as an intent unit. These intents are often used to enhance the information in the original data, identify dynamic changes in user intent, and refine session representations.
[0022] While existing work has explored methods for mining and utilizing user intent information, it is still insufficient to model the complex intents of users in real-world scenarios. For example, given an anonymous user's session sequence: "mouse—computer—headphones—phone—phone," if we only consider the n most recently interacted items as intent units from a temporal perspective, the model might classify the anonymous user as a phone enthusiast, ignoring the possibility that the user is also an electronics enthusiast. Furthermore, this approach to intent consideration can only obtain intent information from the current session, leaving the recommendation model with relatively limited available information. Summary of the Invention
[0023] Current methods for mining user intent information are limited to temporal discovery. This temporal-only analysis restricts the model from recommending more relevant items to users. Furthermore, current intent mining can only extract intent information from the current session, ignoring the possibility of similar intents across interactions between different anonymous users. The technical problem this invention aims to solve is to address these limitations by providing a method that enhances the representation of intent within the current session, thereby increasing the amount of information available to the model and providing users with a better recommendation experience.
[0024] The technical solution adopted by this invention to solve the above-mentioned technical problems is a method for parsing user hierarchical intent from a spatiotemporal perspective in conversation recommendation, comprising the following steps:
[0025] In this invention, the "hierarchical intent" refers to both temporal and spatial levels. Compared to traditional conversational recommendation models, this invention innovatively introduces the concept of hierarchical intent, analyzing user intent in the recommendation domain from both temporal and spatial perspectives. It also proposes that temporal intents are "mutually exclusive" and spatial intents are "compatible."
[0026] Based on this theoretical foundation, this patent proposes a novel hierarchical intent-aware contrastive learning framework, abbreviated as HearInt. Specifically, HearInt proposes a temporal intent decoupling module to decouple long-term and short-term intents from the original session, thereby avoiding mutual interference between them during the learning process. Secondly, to utilize the compatibility of spatial dimension intents, HearInt also proposes a cross-scale contrastive learning loss calculation method, which is beneficial for the model to integrate large-scale intent information into small-scale intents during intent perception, thereby enriching the information content of small-scale intents.
[0027] The beneficial effect of this invention is that by decoupling time intent, the user's long-term and short-term intents are decoupled from the original session, avoiding mutual interference between them during the learning process. Cross-scale contrastive learning innovatively brings the current session representation, representing small-scale intents, closer to relevant large-scale intents in the representation space, while simultaneously distancing it from irrelevant large-scale intents. This not only enriches the information content of the current session representation but also prevents irrelevant items from being included in the recommendation list. Fully mining user intents can achieve the best recommendation effect in the current session recommendation citation. Attached Figure Description
[0028] Figure 1 A schematic diagram for analyzing user hierarchical intent from a spatiotemporal perspective;
[0029] Figure 2 Example of building from a direction-aware map.
[0030] Figure 3Example of constructing a frequency-aware graph. Detailed Implementation
[0031] This invention proposes a method for parsing user hierarchical intent from a spatiotemporal perspective (Hierarchical IntentPerceiving Contrastive Learning Framework), abbreviated as HeatInt.
[0032] The implementation of this method mainly involves the following three core modules:
[0033] 1. Intent Perciving Module
[0034] Previous work has only treated several adjacent items as a single intent unit within the current session. However, intent itself is a broad probability, and considering only the current session limits the amount of information it represents. Therefore, this invention proposes to perform unsupervised clustering across all item sets to explore the similarities between items, and to treat sets of items of the same category as a single intent. That is, in this invention, intent is equivalent to the category to which an item belongs (the cluster it is assigned to during clustering). This strategy extends intent mining from a single session to the entire session, enriching the information content of intent representation. Existing clustering methods can be used.
[0035] 2. Temporal Intent Decoupling Module
[0036] From a temporal perspective, a user's interactive behavior session can be represented by long-term and short-term intentions. Generally, since short-term intentions can evolve rapidly based on external factors, long-term and short-term intentions are often mutually exclusive, a phenomenon known as the mutual exclusivity of intentions from a temporal perspective. Based on this, this invention proposes a temporal intention decoupling module to decouple short-term intentions from the original session within a long-term intention. These short-term intentions are then fed into the model for feature transformation, thereby avoiding mutual interference during the learning process.
[0037] 3. Cross-scale Contrastive Learning Module
[0038] To avoid the limitations of considering intent solely from a temporal perspective, this invention introduces the concept of space. The temporal intent decoupling module is used to mine the properties of clustered intents from a temporal perspective, namely, mutual exclusivity. From a spatial perspective, in the feature space, this invention divides intents into large-scale intents corresponding to clusters and small-scale intents corresponding to single items, based on the number of items included. It is evident that large-scale intents are composed of many small-scale intents; therefore, this invention proposes that intents possess "compatibility" from a spatial perspective. Thus, to utilize information from large-scale intents to enhance small-scale intents, a cross-scale contrastive learning module is proposed. Specifically, when training the session recommendation model, the current session representation and the cluster corresponding to the item in the next interaction are considered as two positive samples, and contrastive learning is used to narrow their distance in the feature space. For other clusters in the feature space, their similarity to the current session representation is minimized to avoid recommending irrelevant items.
[0039] Thanks to these three design features, HearInt has achieved the best recommendation performance in the field of conversation recommendation.
[0040] The embodiment provides a method for parsing user-level intent from a spatiotemporal perspective for the conversation recommendation task, such as... Figure 1 As shown, the training steps for parsing user-level intent were completed using the following methods:
[0041] 1) Intent-aware step: Receive all item embeddings in the dataset as input, and classify the items in the feature space using unsupervised clustering. Subsequently, the resulting clusters are considered intent units, and the representation of the cluster center is considered the intent.
[0042] This step is implemented using an Intent Perciving Module. Unsupervised clustering is performed on all items in the dataset within the feature space, and the cluster center representations are considered as intent representations. Let V = {v1, v2, ..., v...} N} represents all items in the dataset, and N is the total number of items. For the clustering method, the example simply uses the K-means algorithm. The K-means algorithm first needs to determine the number of data clusters K, that is, there are K cluster centers, which are generated in the initial item data. After determining the cluster centers, the cluster centers are calculated for item v. i The distance from the feature space to each cluster. Here, Euclidean distance is used as the metric:
[0043] C i =argmin j ||v i -μ j || 2 ,
[0044] Where i represents the item serial number, with a value ranging from 1 to N, j represents the cluster serial number, with a value ranging from 1 to K, and C i Indicates the relationship between the item v i The nearest cluster, i.e., item v i The cluster to which it belongs; μ j Let |j| be the cluster center of the j-th cluster, and ||·| denote the L2 norm;
[0045]
[0046] Where L{*} represents the set of distances;
[0047] Based on the principle of shortest distance, place item v i Each item is assigned to a cluster, and this process is repeated multiple times until all items are categorized. Through this process, we can obtain the user intent represented by the interactive items.
[0048] 2) Temporal Intent Decoupling Steps: Receive the anonymous user's session input, and decouple the session at the item level under the guidance of intent, thereby separating long-term intents and short-term intents from the session.
[0049] The Temporal Intent Decoupling Module is used to implement this step, mitigating the mutual interference between long-term and short-term intents in the current session, and performing decoupling operations under the guidance of user intents. Given the current session S = {v s,1 ,v s,2 , ..., v s,t} This can be vectorized as S={e s,1 ,e s,2 , ..., e s,t}, e s,i For the embedded representation of items, variables i = 1, 2, ..., t. Using the embedded representation of intent. Replace the embedded representation of the corresponding item e s,i To obtain the current session represented by the intent. Subsequently, we put forward our long-term intentions. and short-term intentions definition:
[0050]
[0051]
[0052] Where t represents the preset session duration, padded with 0s when the actual session duration is insufficient. s,tThis represents the item code at time t in session s. The embedding representation obtained by vectorization is a multi-dimensional code obtained by randomly initializing and expanding the dimensions of the item code. The example expands the dimensions to 100. The embedding representation of the intent is a multi-dimensional code obtained by randomly initializing and expanding the dimensions of the item category code corresponding to the intent.
[0053] For the current session S represented by the intent c Medium- to long-term intentions With short-term intentions Calculate its relationship with S c The cosine similarity of all intents is used to obtain a similarity score. Then, under the constraints of a threshold α∈(0,1) and a mask probability β∈(0,1), items corresponding to intents with a cosine similarity lower than α are discarded in the session with probability β, thus achieving a session that retains as few long- or short-term intents as possible. and by For example, this process can be written as:
[0054]
[0055]
[0056] in, For S c The corresponding long-term intention, For S c The embedding representation of the i-th intention in β' i for The probabilities are randomly generated, ⊙ is the Hadamard product, and M is a mask sequence where the i-th element is m. i .
[0057] Then obtain S in the same way. 短 This completes the session S, which represents the input intent. c Decoupled into two sub-sessions and
[0058] 3) Feature transformation step: This involves transforming the decoupled long-term intent representation of the session. Conversations expressing short-term intentions Perform feature transformations separately. Specifically, first, for... A self-attention mechanism was used for the transformation. Then, for The graph is reconstructed into two graphs: the existing direction-aware graph and the proposed frequency-aware graph. Then, feature transformations are performed on the direction-aware graph and the frequency-aware graph using existing edge-aware graph attention networks. Finally, a gating mechanism is used to fuse the graphs. Transformation representation of S 短 and Transformation representation of S 长 Obtain the merged session.
[0059] The Feature Transformation Module is used to implement this step. It transforms the features of the two sub-sessions obtained from the temporal intent decoupling module, thereby learning higher-quality item feature representations. The entire process is divided into: short-term intent learning, long-term intent learning, and intent fusion.
[0060] a. Short-term intention learning
[0061] Using self-attention mechanism Each item undergoes feature transformation. First, we randomly initialize a learnable location code P, and then perform feature transformation on P and... The result is obtained by performing a step-by-step addition operation between them. Next, we model the semantic relationships between items using a Scaled Dot-product Attention Network, followed by introducing non-linearity into the model using a feed-forward network. This process can be mathematically expressed as follows:
[0062]
[0063]
[0064] Where Q is the query matrix, K is the key matrix, V is the value matrix, W1 and W2 are learnable weight matrices, b1 and b2 are learnable bias vectors, and d k is the dimension representing the item, softmax is the activation function, and SELU is the activation function. (Settings are missing from the original text.)
[0065] After the self-attention mechanism, we take The representation of the last interacted item is used as the representation of the current sub-session, and it is denoted as session S of the short-term intent transformation representation. 短 .
[0066] b. Long-term intention learning
[0067] To take into account long-term intentions, given We construct the map based on two aspects: direction perception and frequency perception, such as Figure 2 As shown. Figure 3 To illustrate the construction of a frequency-aware graph, only a subgraph constructed in Session 1 with vertex v2 as the center is given here as an example.
[0068] (i) Direction-aware graph: The direction-aware graph is an existing perception graph. Based on the different item transformation relationships in the conversation, four different edges are constructed: in, out, self-loop, and bi-direction.
[0069] (ii) Frequency-aware graph: As proposed in this invention, for each item v in the session... i We first treat each item as a node and construct an undirected weighted subgraph based on the connectivity of items in the current session. To determine the edge weights, we first search for the first-order neighbor items of the current item across all sessions in the dataset and count the frequency of the item appearing with these neighbors. We then treat these counts as the weights of the undirected weighted subgraph and perform normalization. Finally, based on the normalization results, we refine the edges into four categories: low-frequency edges, medium-frequency edges, high-frequency edges, and ultra-high-frequency edges. We then perform the above operation for each item in the current session, thus obtaining the frequency-aware graph of the current session. This process is then applied to the current sub-session. After reconstructing the graph into two graphs, we use two edge-aware attention networks to transform their features respectively.
[0070] Specifically, we assigned different learnable parameters to different types of edges and used an attention mechanism to learn the weights between adjacent items. The calculation of the learnable parameters is represented as follows:
[0071]
[0072] Where i, j, and k are all item serial numbers, and item v j Item v k All are items v i α, the first-order neighbor ij For item v j To item v i The correlation weights, LeakyReLU is the activation function LeakyReLU, r ij For item v iand v j The edge type between them Is to assign edge r ij Learnable parameters In the current sub-session Item v i The first-order neighbor set, e s,i Indicates the current sub-session S 长 The i-th element, i.e., item v i The embedded representation, with the superscript T indicating transpose.
[0073] Next, the current sub-session is updated by performing a weighted sum of neighboring items. Each item v i Embedded representations s i :
[0074]
[0075] The above update method is used to update both the direction-aware map and the frequency-aware map for the current sub-session. For each element in the orientation-aware map and frequency-aware map, the learnable parameter α is... ij Different, therefore The update results for each element will differ. This is based on the α determined from the direction-aware map and the frequency-aware map. ij Sessions updated separately Then, the sub-session is obtained. Direction perception map representation Frequency-aware diagram representation
[0076] Then, a gate mechanism is used to... and By merging, we obtain
[0077]
[0078]
[0079] Where θ is the fusion coefficient, || represents data concatenation, sigmoid represents the sigmoid activation function, and W3 represents the learnable weight matrix. To distinguish and summarize the contribution of each item to the current sub-session, based on... We employ a soft-attention mechanism to learn the final representation S of the sub-session. 长 :
[0080]
[0081]
[0082] Where, γ i This represents the attention weights, where n is... The number of elements in express The i-th element for The items in the average represent, for The feature transformation representation of the items in p i ∈P, where P is a randomly initialized learnable positional code; W4, W5, and W6 represent learnable weight matrices, and b3 and b4 are learnable bias vectors. The final obtained S 长 A session that transforms the representation of long-term intentions.
[0083] c. Intent fusion
[0084] S was obtained 短 and S 长 Then, we use a gate mechanism to fuse them to obtain the fused session representation R:
[0085] δ=sigmoid(W7[S 长 ||S 短 ]),
[0086] R=(1-δ)⊙S 长 +δ⊙S 短 ,
[0087] Where W7 is a learnable parameter, δ is a fusion coefficient, and R is the current session representation learned by the final model.
[0088] 4) Next item prediction step: Calculate the similarity between the fused session R and the embedding representations of all items in the dataset, sort them by similarity, output the recommended items, and calculate the cross-entropy loss between the embedding representation of the recommended items and the embedding representation of the actual items for the next interaction.
[0089] The Feature Transformation Module is used to implement this step. After receiving the input session representation R, it multiplies it with the embedding representation of the candidate items and applies softmax to calculate the probability that each candidate item will be the next recommendation.
[0090]
[0091] Where e j Let j be the embedding representation of the j-th item in the item set, and let each candidate item be recommended according to its probability. High-order sorting, recommending the one with the highest probability. The corresponding item is output as the final recommended item.
[0092] Next, during the training process, the cross-entropy loss also needs to be calculated:
[0093]
[0094] Where y is the one-hot code of the actual target item, that is, the true probability to be predicted. This is the loss function.
[0095] 5) Cross-scale contrastive learning steps: The embedded representations of the categories of the fused conversation and the real next interactive item (i.e. target intent information) are regarded as positive sample pairs for contrastive learning, and the embedded representations of other categories are regarded as negative samples to calculate the cross-scale contrastive loss.
[0096] The cross-scale contrastive learning task module is used to complete the step (Cross-scale Contrastive Learning Task). To enhance the compatibility between spatial intentions, this invention designs a cross-scale contrastive learning task. Unlike typical same-scale contrastive learning, here we use two samples with different scales, namely, the representation of the category of the next item. The session is represented as a positive sample pair R, while other classes C are considered as negative samples e. k Next, we use InfoNCE to construct a cross-scale contrastive loss function.
[0097]
[0098] Where τ is the temperature coefficient that controls the degree of discrimination of negative samples, and is a hyperparameter.
[0099] To incorporate cross-scale contrastive learning into the next item prediction training, a scheme of fusing two loss functions is adopted, and a hyperparameter λ is introduced to control the magnitude of the cross-scale contrastive loss.
[0100] The total learning loss of the final session S Represented as:
[0101]
[0102] 6) Parameter update steps: Combine the cross-entropy loss and cross-scale contrast loss to obtain the total learning loss. Use the total learning loss to obtain the gradient information for parameter update. After completing the parameter update for this iteration, return to step 2) to start a new round of iterative training.
[0103] Once the conversation recommendation model is trained, the conversations obtained based on the user's historical interaction items are input into the conversation recommendation model, and the conversation recommendation model outputs recommended items to the user's human-computer interaction interface to complete the recommendation.
[0104] Extensive experiments were conducted on three public datasets, and the results show that the method of this invention has reached the state-of-the-art level.
[0105] Dataset:
[0106] Tmall originated from the IJCAI-15 competition and consists of shopping logs from numerous unnamed users on the Tmall online shopping platform.
[0107] Diginetica, from the 2016 CIKM Cup, describes users' music listening behavior.
[0108] RetailRocket is a tool launched by an e-commerce company for Kaggle competitions, containing user browsing activity.
[0109] The data format of the dataset parameters is shown in Table 1:
[0110] Training Session 351,268 433,643 719,470 Test session 25,898 15,132 60,858 #thing 40,728 36,968 43,097 average length 6.69 5.43 5.12
[0111] Table 1
[0112] Evaluation indicators:
[0113] P@K: The P@K score is widely used to measure the prediction accuracy in the context of conversational recommendation. P@K represents the proportion of correctly recommended items in a test case that rank within the top K positions in the ranking table.
[0114] MRR@K: The MRR@K score emphasizes the position of the user's desired item in the model's recommendation list; the higher the position, the better the score.
[0115] Comparison method:
[0116] NARM: NARM uses RNN and attention mechanisms to extract users' general interests.
[0117] STAMP: STAMP emphasizes short-term memory by utilizing attention mechanisms.
[0118] SR-GNN: SR-GNN uses GNN to learn the embeddings of items and learns the representation of the conversation through a soft attention mechanism.
[0119] GCE-GNN: GCE-GNN considers extracting spatial information of session data from global and local views.
[0120] DHCN: DHCN uses a hypergraph to generate two distinct views from the original session, treating them as self-supervised signals to enhance the session representation.
[0121] COTREC: COTREC forms two independent session representations and uses joint training to generate positive and negative samples related to the last click from candidate items.
[0122] HIDE: HIDE decouples the intent in the original session in a micro and macro manner to capture the user's dynamic intent and avoid noise signals.
[0123] AttenMixer: AttenMixer treats the combination of the last few items in a session as different intentions and implements a multi-level inference component of GNN.
[0124]
[0125] Table 2
[0126] Table 2 shows the results of our proposed method compared with baseline methods of different types. On these two or three datasets, HearInt exhibits the best performance in the vast majority of cases. This demonstrates the practicality of the proposed hierarchical intent. Compared with existing models, hierarchical intent benefits the model primarily in two aspects: (i) the designed temporal intent decoupling module enables HearInt to avoid introducing irrelevant information into long-term intents and to add relevant information (such as semantically similar items) into short-term intents, thus resulting in better learned conversation representations. (ii) combining a cross-scale contrastive learning task makes the semantic relevance between conversation representations and the next click closer during training. These modules enable HearInt to obtain conversation representations containing more relevant information, thereby improving the relevance of the recommendation results.
Claims
1. A method for parsing user hierarchical intent from a spatiotemporal perspective in conversation recommendation, characterized in that, Including the following steps: Training steps: 1) Intent-aware step: Receive the embedded representations of all items in the dataset, and classify the items in the feature space through unsupervised clustering; each classified category is considered an intent. 2) Steps for decoupling time intentions: The user session receives input and, guided by intent, performs item-level decoupling of the session, separating long-term and short-term intents from the session; the user session is a sequence representation of items that the user has interacted with within a set time period. Specifically, the decoupling involves replacing the embedding representation of each item in the vectorized user session S with the embedding representation of the intent corresponding to that item to obtain the current session S represented by the intent. c Then from S c Extracting long-term intentions and short-term intentions The long-term intention is S c The embedding representation of the intent that appears most frequently in the short term, S. c The embedded representation of the intent of the last interaction; then, by calculating the long-term intent. With S c The cosine similarity score of the embedding representations of all intents is used to discard the embedding representations of intents with a probability β, thereby obtaining the session's long-term intent representation. Then calculate short-term intentions With S c The cosine similarity score of the embedding representations of all intents is used to discard the embedding representations of intents with a probability β, thereby obtaining the session's short-term intent representation. 3) Feature transformation step: This involves transforming the decoupled long-term intent representation of the session. Conversations expressing short-term intentions The self-attention mechanism was used to perform feature transformations to obtain... Transformation representation of S 长 and Transformation representation of S 短 Then, a gate mechanism is used to process S. 长 and S 短 The fusion process is performed to obtain the fused session; 4) Next item prediction step: Calculate the similarity between the fused session and the embedding representations of all items in the dataset, sort them by similarity, output the recommended items, and calculate the cross-entropy loss between the embedding representation of the recommended items and the embedding representation of the real next interaction item. 5) Cross-scale contrastive learning steps: The embedded representations of the categories of the fused conversation and the real next interactive item are used as positive sample pairs for contrastive learning, and the embedded representations of other categories are used as negative samples to calculate and construct the cross-scale contrastive loss. 6) Parameter update step: Combine cross-entropy loss and cross-scale contrast loss to obtain the total learning loss. Use the total learning loss to obtain the gradient information for parameter update and complete the parameter update for this iteration of training. Then return to step 2) to start a new round of iterative training until training is completed. Test steps: Once the conversation recommendation model is trained, the conversations obtained based on the user's historical interaction items are input into the conversation recommendation model, and the conversation recommendation model outputs recommended items to the user's human-computer interaction interface to complete the recommendation.
2. The method as described in claim 1, characterized in that, Sessions that obtain long-term intent representations The specific method is as follows: in, For S c The embedding representation of the i-th intention in β' i for The probability of random generation, ⊙ is the Hadamard product, M 长 It is a mask sequence, where the i-th element is m. 长,i ; Sessions that receive short-term intent representations The specific method is as follows: M 短 It is a mask sequence, where the i-th element is m. 短,i .
3. The method as described in claim 1, characterized in that, get Transformation representation of S 短 The specific method is as follows: First, randomly initialize the learnable positional encoding P, then in P and The result is obtained by performing a step-by-step addition operation between them. [+] indicates item-by-item addition; subsequently, feature extraction using a self-attention mechanism is performed with the query matrix Q, key matrix K, value matrix V, learnable weight matrices W1 and W2, learnable bias vectors b1 and b2, and activation function SELU. Among them, when performing feature extraction for the self-attention mechanism d k For the dimension representing an item, · T Indicates transpose; softmax is the activation function softmax; Finally, take The representation of the last interacted item in session S as a short-term intent transformation representation. 短 .
4. The method as described in claim 1, characterized in that, get Transformation representation of S 长 The specific method is as follows: 1) From the perspectives of direction perception and frequency perception To compose a picture; Direction perception map is based on Each item is a node, and the transformation relationships between items are constructed using four edges: in (in), out (out), self-loop (self-loop), and bi-direction (bi-direction). Direction perception map Frequency-aware graphs use each item in a conversation as a node, and are arranged according to... An undirected weighted subgraph is constructed based on the connections between items in the graph. The weight of each edge is the number of times the current item and its first-order neighbor items appear together. These counts are then normalized. Based on the normalization result, the edges in the frequency-aware graph are categorized into four types: low-frequency edges, medium-frequency edges, high-frequency edges, and ultra-high-frequency edges. Then, the... Perform the above operation on each item to obtain... Frequency perception map; 2) Two edge-aware graph attention networks are used to respectively... Direction perception map and Frequency sensing maps are obtained by feature transformation. Direction perception map representation Frequency-aware diagram representation 3) Then use a gate mechanism to... and The fusion is performed to obtain the fused long-term intention transformation representation. 4) Based on A soft attention mechanism is used to learn the final representation of the sub-session. Transformation representation of S 长 .
5. The method as described in claim 1, characterized in that, Cross-scale contrast loss The specific calculation method is as follows: Where τ is the temperature coefficient controlling the degree of discrimination of negative samples, and is a hyperparameter. e is an embedded representation of the category of the actual next interactive item. k Let C be the set of embedding representations for other categories.
6. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.