Session intention-based interaction item recommendation method and device, equipment and medium
By processing cross-session graphs through graph attention networks and heterogeneous graph attention networks, a multi-granularity heterogeneous session graph of intent units is constructed, which solves the problem of low accuracy in intent recognition and recommendation in traditional systems and achieves higher accuracy in intent recognition and item recommendation.
Patent Information
- Application Number
- CN202511811486.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-03
AI Technical Summary
Traditional customer management systems lack the ability to proactively perceive customers' implicit needs, resulting in low accuracy in intent recognition and project recommendations.
By using graph attention networks to process cross-session graphs and current session representation vectors, a heterogeneous session graph with multi-granularity intent units is constructed. Global and local representation vectors are obtained through heterogeneous graph attention network analysis and fused to determine the target recommended items.
It improves the accuracy of intent recognition, thereby improving the accuracy of item recommendation. By integrating the local behavioral intent, overall preferences, and historical group behavior patterns of the user's current session, it captures the complex dependencies between items in the session.
Smart Images

Figure CN121598962A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to an interactive item recommendation method, apparatus, device, and medium based on conversational intent. Background Technology
[0002] With the deepening of digitalization, the financial and insurance product system is becoming increasingly diversified, covering auto insurance, non-auto insurance, and various innovative insurance types. Online medical services are also emerging, such as recommendations for physical examination items. Simultaneously, the user base continues to expand, posing a serious challenge to the traditional sales and service model that relies on human agents. Currently, insurance companies and medical institutions generally adopt a list-based management model, where agents make outbound calls or communicate online with assigned customers or patients to complete tasks such as demand identification, product recommendations, and follow-up on issues. However, while traditional customer management systems or outbound call platforms have basic information display and call recording functions, they lack the ability to proactively perceive customers' implicit needs. Customer behavior data during conversations is not effectively collected and utilized, resulting in low accuracy in intent recognition, and consequently, low accuracy in recommended items. Therefore, how to improve the accuracy of intent recognition, and thus improve the accuracy of interactive item recommendations, has become an urgent problem to be solved. Summary of the Invention
[0003] This application provides a method, apparatus, device, and medium for interactive item recommendation based on session intent, in order to improve the accuracy of intent recognition and thus improve the accuracy of interactive item recommendation.
[0004] Firstly, this application provides an interactive item recommendation method based on conversational intent, the method comprising: Get the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph and the current session representation vector are processed using a graph attention network to obtain the cross-session representation vector; Based on the current session, a multi-granularity intent unit heterogeneous session graph is constructed, and the multi-granularity intent unit heterogeneous session graph is analyzed based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level; The cross-session representation vector, the global representation vector at each granularity level, and the local representation vector are fused to obtain the target session representation vector at each granularity level. Based on the target session representation vector, the candidate items are ranked according to intent to determine the target recommended items.
[0005] Secondly, this application also provides an interactive item recommendation device based on conversation intent, the device comprising: The relevant data acquisition module is used to acquire the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph processing module is used to process the cross-session graph and the current session representation vector based on a graph attention network to obtain the cross-session representation vector; The heterogeneous session graph processing module is used to construct a multi-granularity intention unit heterogeneous session graph based on the current session, and analyze the multi-granularity intention unit heterogeneous session graph based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level. The recommended item determination module is used to fuse the cross-session representation vector, the global representation vector at each granularity level, and the local representation vector to obtain the target session representation vector at each granularity level, and based on the target session representation vector, to sort the candidate items by intent and determine the target recommended items.
[0006] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the interactive item recommendation method based on session intent as described above.
[0007] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the session intent-based interactive item recommendation method described above.
[0008] This application discloses a method, apparatus, device, and medium for interactive item recommendation based on session intent. The method involves obtaining the current session, the current session representation vector, and a cross-session graph corresponding to historical sessions; processing the cross-session graph and the current session representation vector using a graph attention network to obtain a cross-session representation vector; constructing a multi-granularity intent unit heterogeneous session graph based on the current session, and analyzing the multi-granularity intent unit heterogeneous session graph using a heterogeneous graph attention network to obtain global and local representation vectors at each granularity level; fusing the cross-session representation vector, the global representation vectors at each granularity level, and the local representation vectors to obtain target session representation vectors at each granularity level; and ranking candidate items based on the target session representation vectors to determine the target recommended items. This application utilizes graph attention networks to process cross-session graphs to obtain cross-session representation vectors, and constructs heterogeneous session graphs with multi-granularity intent units to obtain global and local representation vectors. The cross-session representation vectors, global and local representation vectors are fused to obtain target session representation vectors at each granularity level. This fusion incorporates local behavioral intents (local representation vectors), overall preferences (global representation vectors), and historical group behavior patterns (cross-session representation vectors) in the user's current session, thereby obtaining complex dependencies between items in the session, improving the accuracy of intent recognition, and thus improving the accuracy of item recommendation. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a first schematic flowchart of an interactive item recommendation method based on conversation intent provided in an embodiment of this application; Figure 2 This is a flowchart illustrating an implementation of an interactive item recommendation method based on conversational intent, provided in an embodiment of this application. Figure 3 This is a second schematic flowchart of an interactive item recommendation method based on conversation intent provided in an embodiment of this application; Figure 4 This is a third schematic flowchart of an interactive item recommendation method based on conversation intent provided in an embodiment of this application; Figure 5 A schematic block diagram of an interactive item recommendation device based on conversation intent provided for embodiments of this application; Figure 6A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0013] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0014] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0015] This application provides a method, apparatus, device, and medium for interactive item recommendation based on session intent. The session intent-based interactive item recommendation method can be applied to a server. It utilizes a graph attention network to process cross-session graphs to obtain cross-session representation vectors, and constructs a heterogeneous session graph with multi-granularity intent units to obtain global and local representation vectors. The cross-session representation vectors, global and local representation vectors are fused to obtain target session representation vectors at each granularity level. This fusion incorporates local behavioral intents (local representation vectors), overall preferences (global representation vectors), and historical group behavior patterns (cross-session representation vectors) within the user's current session, revealing complex dependencies between items in the session. This improves the accuracy of intent recognition and consequently, the accuracy of item recommendation. The server can be a standalone server or a server cluster.
[0016] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0017] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating an interactive item recommendation method based on session intent, provided in an embodiment of this application. This session intent-based interactive item recommendation method can be applied to a server. It utilizes a graph attention network to process cross-session graphs to obtain cross-session representation vectors, constructs a heterogeneous session graph with multi-granularity intent units, obtains global and local representation vectors, and fuses the cross-session representation vectors, global and local representation vectors to obtain target session representation vectors at each granularity level. It integrates the user's local behavioral intent (local representation vector), overall preferences (global representation vector), and historical group behavior patterns (cross-session representation vector) within the current session, obtaining the complex dependencies between items in the session, improving the accuracy of intent recognition, and thus improving the accuracy of item recommendation.
[0018] like Figure 1 As shown, the interactive item recommendation method based on conversation intent specifically includes steps S101 to S104.
[0019] S101. Obtain the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; In one embodiment, the current session refers to the user's current session, such as an ongoing session involving insurance product consultation, insurance claims communication, or telemedicine services.
[0020] Current Session Representation Vector ,in, This represents the item (e.g., medical insurance, property insurance) clicked by the user at position n, with a session length of M. For example, if the sequence of consecutive clicks in the user's current session is {car insurance details page, third-party liability insurance terms page, car insurance quote page, accident insurance overview page}, then by representing the car insurance details page, third-party liability insurance terms page, car insurance quote page, and accident insurance overview page using vectors, the current session representation vector is generated.
[0021] In one embodiment, the cross-session graph is a global graph built based on all historical sessions. Nodes are items that the user has interacted with (clicked) in all sessions, edges represent the co-occurrence relationships of items in different sessions, and edge weights represent the co-occurrence frequency. For example, if the car insurance details page and the third-party liability insurance terms page frequently co-occur, their edge weights will be higher.
[0022] Further, obtaining the cross-session graph corresponding to the historical sessions includes: obtaining at least two historical sessions, identifying interactive items in each historical session to obtain a set of interactive items; searching for adjacent items corresponding to each interactive item in the set of interactive items in each historical session to obtain at least one pair of nearest neighbor items; obtaining the edges of the cross-session graph based on each pair of nearest neighbor items, taking the two interactive items in each pair of nearest neighbor items as nodes of the cross-session graph, and constructing the cross-session graph based on each edge and each node.
[0023] In one embodiment, the cross-session graph is based on one of all sessions. A graph constructed from adjacent itemsets of order. It is a hyperparameter used to control the range of neighboring items.
[0024] Specifically, the interaction items in all historical sessions are identified to obtain a set of interaction items. . |I| represents the items that have been interacted with in the session, and |I| represents the sum of all interacted items.
[0025] For example, suppose the historical sessions include Session 1 (S1): [v1, v3, v2, v5] (User 1 clicked on items v1, v3, v2, v5); Session 2 (S2): [v3, v1, v4]; Session 3 (S3): [v2, v3, v4, v6]. From these three sessions, the set of interactive items is identified as: Vc = {v1, v2, v3, v4, v5, v6}.
[0026] For the conversation any one of the projects In all other sessions Searching for and Establish the nearest neighbor project of the edge, project The project itself and the found neighboring projects form a pair of neighboring projects. nearest neighbor set In the context of In step size Items that users have interacted with within the specified scope. Session nodes The nearest neighbor set can be represented as:
[0027] in, It is a conversation The item in the sequence position i, It is a conversation Medium-sized projects In the conversation The order of positions, for In the conversation middle Projects within the neighborhood, It is a hyperparameter that controls the modeling of transitions between projects. If the range is exceeded, the captured cross-session item conversion information will be noisy.
[0028] Establish an edge between each pair of nearest neighbors, with each pair of nearest neighbors as the two nodes of the edge. Specifically, let... For cross-session graphs, where, This represents the set of all clicked items (i.e., interactive items) in a session. Describe the set of edges. Represents a node and The edges between, each edge For each pair of nearest neighbor items in all sessions, , .
[0029] In another embodiment, the already discussed parts of the current dialogue can also be combined with historical dialogues to construct a cross-conversation graph, such as... Figure 2 The middle class uses Session 1 as the already-dialed part of the current session and Session 2 as the historical session, together constructing a cross-session graph.
[0030] In another implementation, the total frequency of each edge across all sessions is calculated. Example: Suppose edge (v3, v1) appears 15 times in the Y-order neighborhood search across all sessions, while edge (v3, v2) appears 8 times. Therefore, the weight of edge (v3, v1) is greater than the weight of edge (v3, v2). A higher weight indicates a stronger association between the two items.
[0031] To improve the efficiency of cross-session graph construction and avoid the graph becoming too large and dense, for each node... It retains the top N edges by weight among the edges connected to it, and filters out minor connections with low weight. N is a custom value.
[0032] Understandably, due to The order-adjacent item sets are undirected, and the cross-session graph is an undirected weighted graph.
[0033] In the above embodiments, a cross-session graph is constructed through historical sessions, which establishes the dependencies between items in all historical sessions, captures the complex dependencies between items in the session, and improves the accuracy of intent recognition.
[0034] S102. Process the cross-session graph and the current session representation vector based on a graph attention network to obtain the cross-session representation vector; In one embodiment, the current session representation vector is used as a guiding signal and transmitted to a graph attention network. The graph attention network finds the set of neighboring items for each item in the current session from across the session graph and generates a neighboring item fusion vector for that set of neighboring items.
[0035] For each item, its own representation vector is aggregated with the fusion vector of its corresponding neighboring items in multiple layers to generate a new vector containing cross-session information, namely the cross-session representation vector.
[0036] like Figure 3 As shown, step S102 of the interactive item recommendation method based on conversation intent specifically includes steps S201 to S204.
[0037] S201. Obtain the set of neighboring items for each node item in the cross-session graph and the node item representation vector for each node item; S202. Based on the graph attention network, the edge weights of node items and adjacent items, the node item representation vector, and the current session representation vector are processed to obtain the importance weights of each adjacent item. S203. Based on the importance weights, perform linear processing on each neighboring item in the neighboring item set to obtain the neighboring item fusion vector of each node item. S204. The cross-session representation vector is obtained by multi-level aggregation of the node item representation vector and the adjacent item fusion vector through the aggregator layer.
[0038] In one embodiment, item transformation information from other sessions is encoded based on propagation characteristics across the session graph to aid in recommendations.
[0039] Cross-session graph nodes For all interactive items in historical sessions, edge The weight is based on the frequency of item occurrence. For each item node... The set of adjacent items is determined by filtering the top N weighted edges. .
[0040] Node item representation vector (d represents the dimension of the item embedding) is the initial embedding vector of the item, which can be obtained through pre-training or random initialization and is used for subsequent attention weight calculation.
[0041] The current session representation vector s is calculated by averaging the embeddings of all items in the current session, as shown in the following formula:
[0042] Where |s| represents the number of items in the current session. For the i-th project The node item represents a vector.
[0043] edge weight The weights of edges in the cross-session graph.
[0044] In one implementation, the current session representation vector s and the node item representation vector are combined. and edge weight Calculate importance weights The calculation formula is:
[0045] in, The LeakyReLU activation function is used. [;] represents element-wise multiplication, and [;] represents concatenation. and It is a trainable parameter matrix.
[0046] The importance weights of all adjacent items of a node are normalized using the Softmax activation function, i.e.:
[0047] In one embodiment, conversation-aware attention is used to perform linear computation on each item in the neighboring item set to obtain the neighboring item fusion vector for each node item. That is, the neighbor representation vector of each node item. Specifically, the linear calculation formula is: .
[0048] In one embodiment, the node item representation vector Fusion vector with adjacent items Aggregation is performed to obtain the single-layer cross-session representation vector corresponding to the cross-session graph. , .
[0049] in, It is the ReLU activation function. To transform the weights.
[0050] In one embodiment, a single-layer GAT can only aggregate information from first-order neighbors (directly connected nodes). Stacking multiple layers of GAT allows information to propagate to multi-hop neighbors, thereby capturing more distant and higher-order dependencies in the graph. To incorporate more information relevant to the current session into the representation vector, an aggregator is used to extend from one layer to multiple layers to explore higher-order connection information.
[0051] Specifically, high-order neighbor (neighboring item) information (such as neighbors of neighbors) is aggregated through aggregator layers of a multi-layer GAT (Graph Attention Network). The u-th layer is represented as...
[0052] in, It is an aggregate function. Let v represent the item representation generated by the information propagation of the first u-1 layers. After processing through multiple layers of GAT, each item node v obtains a final cross-session representation vector. Let... for The initial propagation iteration. Therefore, a project's u-layer representation consists of its initial representation and its neighbors circulating through the u-layer. This allows for more efficient merging of messages into the representation of the current session.
[0053] In another embodiment, in cross-session representation vector generation, a dropout rate is used to avoid overfitting, i.e. , where D is the discard rate function.
[0054] In the above embodiments, the sparse and discrete conversation data based on the conversation-aware graph attention network is transformed into semantically rich and continuous item vector representations (cross-conversation representation vectors), and historical group behavior patterns (cross-conversation representation vectors) are obtained. This solves the problem of singularity in intent recognition based only on the current dialogue, obtains complex patterns between items in the conversation, improves the accuracy of intent recognition, and thus improves the accuracy of item recommendation.
[0055] S103. Based on the current session, construct a multi-granularity intention unit heterogeneous session graph, and analyze the multi-granularity intention unit heterogeneous session graph based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level. In one embodiment, continuous segments of different granularities, i.e., continuous intent units, are extracted from the current session according to a preset maximum granularity level. Intent units corresponding to each granularity level are used as nodes to construct the intent session graph corresponding to each granularity level. The intent session graphs of each granularity level are then merged to generate a heterogeneous session graph with multiple granularity intent units.
[0056] In one embodiment, a heterogeneous graph attention network is used to process the heterogeneous graph of multi-granularity intent units to obtain the intent unit representation vector for each intent unit node. For each granularity level, the last intent unit representation vector is taken as the local representation vector, and an attention mechanism is used to aggregate all intent unit vectors to obtain the global representation vector.
[0057] Further, the step of constructing a multi-granularity intent unit heterogeneous session graph based on the current session includes: processing the current session based on a preset maximum granularity level to obtain at least one continuous intent unit at a granularity level; processing the continuous intent unit based on a first preset function and a second preset function respectively to obtain a sequence feature vector and an overall feature vector, and fusing the sequence features and the overall features to obtain an intent representation vector corresponding to the continuous intent unit; constructing intent session graphs at each granularity level based on the intent representation vector, and merging the intent session graphs to generate the multi-granularity intent unit heterogeneous session graph.
[0058] In one embodiment, existing session-based item recommendation methods consider each item individually, but this easily overlooks higher-level intents within local session fragments. To delve deeper into the user's intent within the current session, intent extraction is performed using consecutive intent units within the items.
[0059] Specifically, if the preset maximum granularity level is K, then the current session is processed to extract continuous intent units with granularity levels k=1, 2, 3..., K. For example, if K=1, then continuous intent units with granularity levels k=1, 2, 3 need to be extracted.
[0060] For the current session s, extract all possible consecutive segments by a sliding window at granularity k.
[0061] A continuous intent unit represents a set of consecutive adjacent items, let... A single intent unit is a continuous segment that starts at position j and ends at position j+k-1 in a session, with a length of k. Individual items in the session are defined as single-granularity, such as... Two or more items are defined as multi-granularity, such as when K=3. .
[0062] In one embodiment, for session s, The intent representation of a k-level continuous intent unit is as follows:
[0063] Where R is the Readout function.
[0064] In another embodiment, in order to extract the complete intent of a higher-order intent unit, a first preset function is used to capture the sequential dependencies within the intent unit (such as the temporal logic of browsing, consulting, and purchasing) to obtain a temporal feature vector. The second preset function is used to capture set attributes (overall semantics independent of order, such as the combined requirements of car insurance and health insurance) to obtain the overall feature vector. Therefore, continuous intent units The intention representation vector is .
[0065] The first preset function is a sequence-based Readout function (such as a gated recursive unit), and the second preset function is a set-based Readout function (such as average and maximum values).
[0066] In one embodiment, for granularity k, the intent session graph nodes This represents all continuous intent units at the k-level granularity. There are two k-level consecutive intent units as edges, and s represents the current session.
[0067] Specifically, based on a graph neural network model, an intent session graph for each granularity level is constructed using the representation vectors of continuous intent units at each granularity level. These intent session graphs from different granularity levels are then unified to obtain a multi-granularity intent unit heterogeneous session graph. In this multi-granularity intent unit heterogeneous session graph, the edge types for nodes include intra-granularity edges and inter-granularity edges. Intra-granularity edges connect item nodes within the same-level intent session graph, while inter-granularity edges connect level 1 and higher-level intent session graphs. For example... Figure 2 The multi-granularity intention unit heterogeneous session diagram is shown in the figure. Solid arrows represent intra-granularity edges, and dashed arrows represent inter-granularity edges.
[0068] For example, suppose a session s = {v1, v3, v2, v4, v3, v2}. In a level 3 intent session graph, six granularity edges can be constructed, namely... and .against , It is a continuous segment of length 3 starting from the first position of the original session. , It is a project v4 that starts from the 4th position in the original session and is a continuous segment. The next project, because the granularity edges connect the level 1 and high-level intent session graphs, will... and Connection. For and , It is a continuous segment of length 3 starting from the second position in the original conversation. , It is the first item in the original session. And it is a fragment of the original conversation. The previous project, The project starts from the second position in the original session. And it is a fragment of the original conversation. The next project, and because the granular edges connect the level 1 and high-level intent session graphs, will... and , Connect them individually, and so on for the others.
[0069] It is understandable that intentions occur in a sequential order, therefore, the heterogeneous session graph of multi-granularity intention units is a directed graph.
[0070] In the above embodiments, the session is split according to a preset granularity to generate single / multi-granularity semantic units. Sequence features and overall features are extracted and fused to generate an intent representation vector. An intent session graph containing intra-granularity / inter-granularity edges is constructed and merged into a heterogeneous graph to model cross-granularity dependencies. This effectively breaks through the unidirectional dependency limitation of traditional sequence models, effectively extracts user intent information contained in the session, and improves the accuracy of intent recognition.
[0071] like Figure 4 As shown, the interactive item recommendation method based on conversation intent analyzes the heterogeneous conversation graph of the multi-granularity intent unit using a heterogeneous graph attention network to obtain global and local representation vectors at each granularity level, specifically including steps S301 to S303.
[0072] S301. Based on the heterogeneous graph attention network, the intent unit nodes of the multi-granularity intent unit heterogeneous session graph are grouped to obtain the inner neighbor node set and the outer neighbor node set. S302. Aggregate the inner neighbor node set and the outer neighbor node set to obtain the intention unit representation vector of each intention unit node; S303. The intention unit representation vector of the last intention unit of the continuous intention units at each granularity level is used as the local representation vector of each granularity level, and the intention unit representation vectors of each intention unit at each granularity level are aggregated to obtain the global representation vector of each granularity level.
[0073] In one embodiment, such as Figure 2 As shown, the heterogeneous session graph of multi-granularity intent units is a directed graph, whose nodes are continuous intent units of different granularities (such as single-granularity units). and multi-granularity Edge types include intra-granularity edges (edges connecting continuous units at the same granularity level) and inter-granularity edges (edges connecting continuous units at different granularity levels).
[0074] Based on the direction of the edges, the neighboring intent unit nodes of each intent unit node in the multi-granularity intent unit heterogeneous session graph are divided into two sets: the inner neighbor set and the outer neighbor set. The inner neighbor set is the set of all neighboring intent unit nodes that point to the current intent unit node, and the outer neighbor set is the set of neighboring intent unit nodes that the current intent unit node points to.
[0075] In one embodiment, for directed edges in a heterogeneous session graph of multi-granularity intent units Where e is an edge, and These are represented as source intent unit nodes and target intent unit nodes, respectively, and can represent any granularity level. In a k-level granularity intent unit heterogeneous session graph, [the following will be included]. and Defined as intent units and granularity level. Defined as an edge type, including granular inner edges and granular inter edges.
[0076] In each layer of the heterogeneous graph attention network, the representations of the inner neighbor set and the outer neighbor set are aggregated through an attention mechanism. (Inner neighbor set) The representation vector is:
[0077] in, For the Softmax function, and It's weight. and These are the intent units. and The initial representation vector; and Representing the intent unit respectively and The representation of layer I in a heterogeneous graph attention network.
[0078] Using a multi-directional attention mechanism, the representation vector of the set of outer neighbor nodes is obtained through the Readout function:
[0079] Where i represents the head index of the attention mechanism, and H is the total number of heads in the attention mechanism.
[0080] In a specific embodiment, since the multi-granularity intent unit heterogeneous session graph is a directed graph, each node has context from both its inner and outer neighbors. To extract contextual information from both directions, a heterogeneous graph attention network is applied to aggregate the information from the inner and outer neighbors to generate an intent unit representation vector for each intent unit node.
[0081] For each intent unit v in a multi-granularity intent unit heterogeneous session graph, the embeddings of v in two directions are aggregated, i.e. and ,in, The vector representing the information embedding to the left of v, i.e., the set of its inner neighbor nodes. This represents the embedding of information to the right of node v, i.e., the representation vector of the set of its outer neighbors. The final representation of node v. The sum of the embeddings in both directions and the average of the embeddings of all nodes in the session. ,in, This represents the sum of the average embeddings of all nodes in the session.
[0082] In one embodiment, local representation is used. and global representation Mine user preferences at each level of the continuous intent unit. When given a session... and the corresponding continuous intent unit representation vector At that time, the representation vector of the last intent unit is... As a local representation vector Global representation is obtained through soft attention mechanism. ,in, It is the number of k-level intent units, where K is the number of intent granularity levels.
[0083] Specifically, global representation It is represented by aggregating the embeddings of all intent units. Let... For the context set of the intention, It is an embedded representation in the context set. The calculation process is as follows:
[0084] in, These are learnable weights; For the Sigmoid function; These are the weighting coefficients.
[0085] In the above embodiments, by distinguishing between internal and external neighboring nodes, a structural foundation is provided for context modeling dependencies. Information of internal and external neighboring nodes is aggregated bidirectionally to generate an intent unit representation containing directional features and global context. Local immediate preferences and global overall preferences are extracted hierarchically, laying the core feature foundation for the final cross-granularity intent fusion and recommendation ranking. This effectively breaks through the limitations of traditional single-granularity, unidirectional sequence modeling and improves the accuracy of user intent recognition in conversation scenarios.
[0086] S104. The cross-session representation vector, the global representation vector at each granularity level, and the local representation vector are fused to obtain the target session representation vector at each granularity level. Based on the target session representation vector, the candidate items are ranked according to intent to determine the target recommended items.
[0087] In one embodiment, the global representation vector, local representation vector, and cross-session representation vector are concatenated to obtain the user preference feature vector at each granularity level of the continuous intent unit, representing the user intent at each granularity level, i.e., the target session representation vector, as shown below:
[0088] in, As weight.
[0089] In one embodiment, target session representation vectors at different granularities By integrating intent fusion ranking mechanisms to combine intent prediction and recommendation results at all granular levels, user intent is obtained, and target recommendation items are determined. For example, in an insurance product consultation session, links to insurance products that the user may click to view next are recommended, or in a telemedicine service session, information about the disease that the patient wants to know, such as details of the disease treatment plan or details of the disease's causative factors, is recommended.
[0090] Further, the step of sorting the candidate items by intent based on the target session representation vector and determining the target recommended item includes: filtering items based on the similarity scores between the target session representation vector at each granularity level and each candidate item to obtain the initial recommended items corresponding to each granularity level; obtaining the recommendation probability distribution of each initial recommended item according to the similarity score, and determining the target recommended item based on the recommendation probability distribution.
[0091] In one embodiment, candidate items are filtered based on the intent at each level to obtain initial recommended items for each granularity level. This can be achieved by calculating the similarity between the target session representation vector at each granularity level and the candidate items, and selecting the candidate item with the highest similarity as the initial recommended item for that granularity level. Specifically, for each item in the candidate item set I... ,calculate Representation vector Target session representation vectors at various granularities The inner product is used to obtain the similarity score. ,Right now .
[0092] Each granularity level k yields an original similarity score. This reflects the project at the k-th granularity level. How relevant to the current session. In one embodiment, the similarity scores of recommended items at each granularity level are normalized and weighted to obtain the recommendation probability distribution corresponding to the initial set of recommended items. The recommended item with the highest probability is then selected as the target recommended item.
[0093] Further, obtaining the recommendation probability distribution of each of the initial recommended items based on the similarity score includes: dividing each of the initial recommended items to obtain the in-session item set and the out-of-session item set corresponding to the current session, and normalizing the similarity scores of each initial recommended item in the in-session item set and the out-of-session item set to obtain normalized scores; processing the target session representation vector based on a preset discriminator network model to obtain the score weights of the in-session item set and the out-of-session item set; weighting the normalized scores of each of the initial recommended items according to the score weights to obtain the recommendation score of each of the initial recommended items at each granularity level; and weighting and fusing the recommendation scores of each of the initial recommended items at each granularity level to obtain the recommendation probability of each initial recommended item, thereby generating the recommendation probability distribution.
[0094] In one embodiment, the initial recommended items corresponding to each granularity level are divided into two mutually exclusive subsets: an in-session item set R and an out-of-session item set O. The in-session item set R represents items that have already appeared in the current session s, reflecting repeat click behavior; the out-of-session item set O represents new items that have not appeared in the current session s, reflecting exploration behavior. The original similarity scores of each initially recommended item in the in-session item set R and the out-of-session item set O are respectively subjected to Softmax normalization. The normalization formula is shown below:
[0095] in, For an in-session item set, For out-of-conversation itemsets, and These are the probability distributions for in-session and out-of-session items, respectively. The sum of the number of items in the in-session item set and the number of items in the out-of-session item set equals the number of items in the initial recommended item set. .
[0096] In one embodiment, a pair of weight coefficients is dynamically learned through a lightweight discriminator network (typically a one- or two-layer neural network). and Weighting coefficient and The computation depends on the representation of the current session. The calculation formula is as follows:
[0097] in, Let be the weight matrix, and be the trainable parameters.
[0098] In one embodiment, the two weighted distributions are concatenated to form the final recommendation vector at granularity level k. .
[0099] In one embodiment, through the above steps, K recommendation vectors y1, y2, ..., yK from different granularity levels are obtained. By weighting and aggregating the recommendation vectors from different granularity levels, the final probability distribution is obtained. Specifically, the model assigns a learnable weight parameter to each granularity level. This indicates the overall importance of this granularity level to the final recommendation. Then, Softmax is used for normalization.
[0100] The recommendation vectors at each level are weighted according to their importance. By performing a weighted summation, we obtain the final predicted probability distribution of the entire system:
[0101] It is also a vector of length |I|, where each element represents the final predicted probability that the corresponding item will become the user's next click target.
[0102] In one embodiment, the item with the highest probability is selected as the target recommended item.
[0103] In one embodiment, in order to train all the parameters of the model (including the weight matrix) fusion weight (etc.), using the cross-entropy function This loss is minimized using backpropagation and gradient descent algorithms to obtain the final model parameters. In the above embodiments, the repeated exploration normalization strategy explicitly distinguishes and balances the two key behaviors of users—repetition and exploration—and aggregates intent units at all levels to further improve recommendation accuracy, thereby obtaining recommended items that meet user expectations.
[0104] Please see Figure 5 , Figure 5 This application provides a schematic block diagram of an interactive item recommendation device based on session intent, which is used to execute the aforementioned interactive item recommendation method based on session intent. The interactive item recommendation device based on session intent can be configured on a server.
[0105] like Figure 5 As shown, the interactive item recommendation device 400 based on conversation intent includes: The relevant data acquisition module 401 is used to acquire the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph processing module 402 is used to process the cross-session graph and the current session representation vector based on a graph attention network to obtain the cross-session representation vector; The heterogeneous session graph processing module 403 is used to construct a multi-granularity intention unit heterogeneous session graph based on the current session, and analyze the multi-granularity intention unit heterogeneous session graph based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level. The recommended item determination module 404 is used to fuse the cross-session representation vector, the global representation vector at each granularity level, and the local representation vector to obtain the target session representation vector at each granularity level, and based on the target session representation vector, to sort the candidate items by intent and determine the target recommended items.
[0106] Furthermore, the relevant data acquisition module 401 includes: An interactive item identification unit is used to acquire at least two historical sessions and identify interactive items in each of the historical sessions to obtain an interactive item set. The nearest neighbor item lookup unit is used to search for the neighboring items corresponding to each interactive item in the interactive item set in each of the historical sessions, and obtain at least one pair of neighboring items; A cross-session graph construction unit is used to obtain the edges of the cross-session graph based on each pair of nearest neighbor items, take the two interactive items in each pair of nearest neighbor items as nodes of the cross-session graph, and construct the cross-session graph based on each edge and each node.
[0107] Furthermore, the cross-session graph processing module 402 includes: The neighboring item set acquisition unit is used to obtain the neighboring item set of each node item in the cross-session graph and the node item representation vector of each node item. The importance weight acquisition unit is used to process the edge weights between node items and adjacent items, the node item representation vector, and the current session representation vector based on the graph attention network to obtain the importance weights of each of the adjacent items. The fusion vector acquisition unit is used to perform linear processing on each neighboring item in the neighboring item set according to the importance weights, and obtain the neighboring item fusion vector of each node item. The cross-session representation vector acquisition unit is used to perform multi-level aggregation of the representation vectors of each node item and the fusion vector of the adjacent items through the aggregator layer to obtain the cross-session representation vector.
[0108] Furthermore, the heterogeneous session graph processing module 403 includes: A continuous intent unit is used to process the current session based on a preset maximum granularity level to obtain at least one continuous intent unit at a granularity level. The intent representation vector acquisition unit is used to process the continuous intent units based on a first preset function and a second preset function respectively to obtain a sequence feature vector and an overall feature vector, and to fuse the sequence features and the overall features to obtain the intent representation vector corresponding to the continuous intent unit. The heterogeneous session graph generation unit is used to construct intent session graphs at each granularity level based on the intent representation vector, and merge the intent session graphs to generate the multi-granularity intent unit heterogeneous session graph.
[0109] Furthermore, the heterogeneous session graph processing module 403 also includes: The intent unit node grouping unit is used to group the intent unit nodes of the multi-granularity intent unit heterogeneous session graph based on the heterogeneous graph attention network to obtain the inner neighbor node set and the outer neighbor node set. The intent unit representation vector acquisition unit is used to aggregate the inner neighbor node set and the outer neighbor node set to obtain the intent unit representation vector of each intent unit node. A local representation vector acquisition unit is used to take the intention unit representation vector of the last intention unit of the continuous intention units at each granularity level as the local representation vector at each granularity level; The global representation vector acquisition unit is used to aggregate the intention unit representation vectors of each intention unit at each granularity level to obtain the global representation vector at each granularity level.
[0110] Furthermore, the recommended item determination module 404 includes: The initial recommended item acquisition unit is used to filter items based on the similarity scores between the target session representation vector at each granularity level and each candidate item, and obtain the initial recommended items corresponding to each granularity level. The target recommendation item determination unit is used to obtain the recommendation probability distribution of each of the initial recommendation items based on the similarity score, and determine the target recommendation item based on the recommendation probability distribution.
[0111] Furthermore, the target recommendation item determination unit includes: The normalized score acquisition subunit is used to divide each of the initial recommended items to obtain the in-session item set and out-of-session item set corresponding to the current session, and to normalize the similarity scores of each initial recommended item in the in-session item set and the out-of-session item set to obtain the normalized score. The scoring weight acquisition sub-unit is used to process the target session representation vector based on a preset discriminator network model to obtain the scoring weights of the in-session itemset and the out-of-session itemset, respectively. The recommendation score acquisition sub-unit is used to weight the normalized scores of each of the initial recommendation items according to the score weights to obtain the recommendation score of each of the initial recommendation items at each granularity level; The recommendation probability distribution generation subunit is used to weight and fuse the recommendation scores of each initial recommended item at each granularity level to obtain the recommendation probability of each initial recommended item and generate the recommendation probability distribution.
[0112] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0113] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 6 It runs on the computer device shown.
[0114] Please see Figure 6 , Figure 6 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0115] See Figure 6 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0116] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any session intent-based interactive item recommendation method.
[0117] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0118] Internal memory provides an environment for the execution of computer programs in non-volatile storage media, which, when executed by a processor, enable the processor to perform any interactive item recommendation method based on session intent.
[0119] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0120] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0121] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: Get the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph and the current session representation vector are processed using a graph attention network to obtain the cross-session representation vector; Based on the current session, a multi-granularity intent unit heterogeneous session graph is constructed, and the multi-granularity intent unit heterogeneous session graph is analyzed based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level; The cross-session representation vector, the global representation vector at each granularity level, and the local representation vector are fused to obtain the target session representation vector at each granularity level. Based on the target session representation vector, the candidate items are ranked according to intent to determine the target recommended items.
[0122] In one embodiment, when the processor acquires the cross-session graph corresponding to a historical session, it is configured to: Obtain at least two historical sessions, and identify interactive items in each of the historical sessions to obtain a set of interactive items; In each of the historical sessions, search for the adjacent items corresponding to each interactive item in the set of interactive items to obtain at least one pair of nearest neighbor items; The edges of the cross-session graph are obtained based on each pair of nearest neighbor items. The two interactive items in each pair of nearest neighbor items are used as nodes of the cross-session graph. The cross-session graph is constructed based on each edge and each node.
[0123] In one embodiment, when the processor processes the cross-session graph and the current session representation vector based on a graph attention network to obtain the cross-session representation vector, it is configured to: Obtain the set of neighboring items for each node item in the cross-session graph and the node item representation vector for each node item; Based on the graph attention network, the edge weights between node items and adjacent items, the node item representation vector, and the current session representation vector are processed to obtain the importance weights of each adjacent item; Based on the importance weights, each neighboring item in the neighboring item set is linearly processed to obtain the neighboring item fusion vector of each node item. The cross-session representation vector is obtained by multi-level aggregation of the node item representation vector and the adjacent item fusion vector through the aggregator layer.
[0124] In one embodiment, when the processor constructs a multi-granularity intent unit heterogeneous session graph based on the current session, it is configured to: Based on a preset maximum granularity level, the current session is processed to obtain at least one continuous intent unit at a granularity level; The continuous intent unit is processed based on the first preset function and the second preset function respectively to obtain the sequence feature vector and the overall feature vector, and the sequence feature and the overall feature are fused to obtain the intent representation vector corresponding to the continuous intent unit; Based on the intent representation vector, intent session graphs at each of the specified granularities are constructed, and the intent session graphs are merged to generate the multi-granularity intent unit heterogeneous session graph.
[0125] In one embodiment, when the processor analyzes the heterogeneous session graph of the multi-granularity intent units based on a heterogeneous graph attention network to obtain global and local representation vectors at each granularity level, it is used to: Based on the heterogeneous graph attention network, the intent unit nodes of the multi-granularity intent unit heterogeneous session graph are grouped to obtain the inner neighbor node set and the outer neighbor node set; Aggregate the inner neighbor node set and the outer neighbor node set to obtain the intent unit representation vector for each intent unit node; The intent unit representation vector of the last intent unit in a series of intent units at each granularity level is used as the local representation vector at each granularity level, and the intent unit representation vectors of each intent unit at each granularity level are aggregated to obtain the global representation vector at each granularity level.
[0126] In one embodiment, when the processor performs intent ranking on each candidate item based on the target session representation vector to determine the target recommended item, it is configured to: Based on the similarity scores between the target session representation vector at each granularity level and each candidate item, the project is filtered to obtain the initial recommended items corresponding to each granularity level; Based on the similarity score, the recommendation probability distribution of each of the initial recommended items is obtained, and based on the recommendation probability distribution, the target recommended item is determined.
[0127] In one embodiment, when the processor obtains the recommendation probability distribution of each of the initial recommended items based on the similarity score, it is configured to: Each of the initial recommended items is divided to obtain the in-session item set and the out-of-session item set corresponding to the current session. The similarity scores of each initial recommended item in the in-session item set and the out-of-session item set are then normalized to obtain normalized scores. The target session representation vector is processed based on a preset discriminator network model to obtain the score weights of the in-session itemset and the out-of-session itemset, respectively. The normalized scores of each of the initial recommended items are weighted according to the score weights to obtain the recommendation scores of each of the initial recommended items at each granularity level. The recommendation scores of each initial recommended item at each granularity level are weighted and fused to obtain the recommendation probability of each initial recommended item, thus generating the recommendation probability distribution.
[0128] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the interactive item recommendation methods based on session intent provided in the embodiments of this application.
[0129] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for recommending interactive items based on conversational intent, characterized in that, include: Get the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph and the current session representation vector are processed using a graph attention network to obtain the cross-session representation vector; Based on the current session, a multi-granularity intent unit heterogeneous session graph is constructed, and the multi-granularity intent unit heterogeneous session graph is analyzed based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level; The cross-session representation vector, the global representation vector at each granularity level, and the local representation vector are fused to obtain the target session representation vector at each granularity level. Based on the target session representation vector, the candidate items are ranked according to intent to determine the target recommended items.
2. The interactive item recommendation method based on conversational intent according to claim 1, characterized in that, The step of obtaining the cross-session graph corresponding to the historical sessions includes: Obtain at least two historical sessions, and identify interactive items in each of the historical sessions to obtain a set of interactive items; In each of the historical sessions, search for the adjacent items corresponding to each interactive item in the set of interactive items to obtain at least one pair of nearest neighbor items; The edges of the cross-session graph are obtained based on each pair of nearest neighbor items. The two interactive items in each pair of nearest neighbor items are used as nodes of the cross-session graph. The cross-session graph is constructed based on each edge and each node.
3. The interactive item recommendation method based on conversational intent according to claim 1, characterized in that, The graph attention network processes the cross-session graph and the current session representation vector to obtain the cross-session representation vector, including: Obtain the set of neighboring items for each node item in the cross-session graph and the node item representation vector for each node item; Based on the graph attention network, the edge weights between node items and adjacent items, the node item representation vector, and the current session representation vector are processed to obtain the importance weights of each adjacent item; Based on the importance weights, each neighboring item in the neighboring item set is linearly processed to obtain the neighboring item fusion vector of each node item. The cross-session representation vector is obtained by multi-level aggregation of the node item representation vector and the adjacent item fusion vector through the aggregator layer.
4. The interactive item recommendation method based on conversational intent according to claim 1, characterized in that, The construction of a multi-granularity intent unit heterogeneous session graph based on the current session includes: Based on a preset maximum granularity level, the current session is processed to obtain at least one continuous intent unit at a granularity level; The continuous intent unit is processed based on the first preset function and the second preset function respectively to obtain the sequence feature vector and the overall feature vector, and the sequence feature and the overall feature are fused to obtain the intent representation vector corresponding to the continuous intent unit; Based on the intent representation vector, intent session graphs at each of the specified granularities are constructed, and the intent session graphs are merged to generate the multi-granularity intent unit heterogeneous session graph.
5. The interactive item recommendation method based on conversational intent according to claim 1, characterized in that, The heterogeneous graph attention network is used to analyze the heterogeneous session graph of the multi-granularity intent units to obtain global and local representation vectors at each granularity level, including: Based on the heterogeneous graph attention network, the intent unit nodes of the multi-granularity intent unit heterogeneous session graph are grouped to obtain the inner neighbor node set and the outer neighbor node set; Aggregate the inner neighbor node set and the outer neighbor node set to obtain the intent unit representation vector for each intent unit node; The intent unit representation vector of the last intent unit in a series of intent units at each granularity level is used as the local representation vector at each granularity level, and the intent unit representation vectors of each intent unit at each granularity level are aggregated to obtain the global representation vector at each granularity level.
6. The interactive item recommendation method based on conversational intent according to any one of claims 1 to 5, characterized in that, The step of ranking candidate items based on the target session representation vector to determine the target recommended item includes: Based on the similarity scores between the target session representation vector at each granularity level and each candidate item, the project is filtered to obtain the initial recommended items corresponding to each granularity level; Based on the similarity score, the recommendation probability distribution of each of the initial recommended items is obtained, and based on the recommendation probability distribution, the target recommended item is determined.
7. The interactive item recommendation method based on conversational intent according to claim 6, characterized in that, The step of obtaining the recommendation probability distribution of each of the initial recommended items based on the similarity score includes: Each of the initial recommended items is divided to obtain the in-session item set and the out-of-session item set corresponding to the current session. The similarity scores of each initial recommended item in the in-session item set and the out-of-session item set are then normalized to obtain normalized scores. The target session representation vector is processed based on a preset discriminator network model to obtain the score weights of the in-session itemset and the out-of-session itemset, respectively. The normalized scores of each of the initial recommended items are weighted according to the score weights to obtain the recommendation scores of each of the initial recommended items at each granularity level. The recommendation scores of each initial recommended item at each granularity level are weighted and fused to obtain the recommendation probability of each initial recommended item, thus generating the recommendation probability distribution.
8. An interactive item recommendation device based on conversational intent, characterized in that, include: The relevant data acquisition module is used to acquire the current session, the current session representation vector, and the cross-session graph corresponding to the historical sessions; The cross-session graph processing module is used to process the cross-session graph and the current session representation vector based on a graph attention network to obtain the cross-session representation vector; The heterogeneous session graph processing module is used to construct a multi-granularity intention unit heterogeneous session graph based on the current session, and analyze the multi-granularity intention unit heterogeneous session graph based on the heterogeneous graph attention network to obtain the global representation vector and local representation vector at each granularity level. The recommended item determination module is used to fuse the cross-session representation vector, the global representation vector at each granularity level, and the local representation vector to obtain the target session representation vector at each granularity level, and based on the target session representation vector, to sort the candidate items by intent and determine the target recommended items.
9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the interactive item recommendation method based on session intent as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the interactive item recommendation method based on session intent as described in any one of claims 1 to 7.