Intelligent assistant personalized recommendation method based on attention mechanism

By introducing an inter-head guided multi-head self-attention network and an improved feedforward neural network, combined with a reconstructed cross-attention network, the problem of difficulty in identifying users' immediate needs in personalized recommendations for intelligent assistants is solved, thereby improving the accuracy and real-time performance of personalized recommendations.

CN122064873APending Publication Date: 2026-05-19WUHAN BEST INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN BEST INFORMATION TECH CO LTD
Filing Date
2026-03-16
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing personalized recommendation methods for intelligent assistants struggle to accurately grasp users' immediate needs in dynamic interactive environments. They lack in-depth modeling of the user's current semantic context, leading to recommended content deviating from the user's true intent. Furthermore, the recommendation module is disconnected from the dialogue system, making it difficult to respond to user feedback and make adjustments in real time.

Method used

By employing a head-guided multi-head self-attention network, an improved feedforward neural network, and a reconstructed cross-attention network, and by deeply modeling user interests, current intent, and content features, and combining user interaction feedback to update the model, we can achieve the accuracy and real-time performance of personalized recommendations.

Benefits of technology

It improves the accuracy and real-time performance of recommendation results, enhances the understanding of users' immediate needs, improves the contextual relevance and response efficiency of recommended content, and solves the problems of static modeling and response lag in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064873A_ABST
    Figure CN122064873A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent assistant personalized recommendation method based on an attention mechanism. The method comprises the following steps: S1, collecting user behavior data; s2, preprocessing the user behavior data; s3, processing the user behavior sequence vector by using an inter-head guide type multi-head self-attention mechanism; s4, carrying out modeling on the content feature vector by adopting an improved feedforward neural network; s5, processing the current dialogue text of the intelligent assistant through a context injection type gating analysis network; s6, feature level fusion is carried out through the reconstruction type cross attention network, and recommendation vectors are generated; s7, on the basis of the recommendation vector, calculating correlation scores of the candidate contents through a content regulation attention scoring mechanism, and generating a recommendation result set according to the scores; and S8, collecting interactive feedback data of the user for each recommendation result, and updating the network parameters according to the interactive feedback data. According to the invention, the recommendation accuracy and context matching capability of the intelligent assistant are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of information retrieval and human-computer interaction technology, and in particular to a personalized recommendation method for intelligent assistants based on an attention mechanism. Background Technology

[0002] With the widespread application of intelligent assistants in scenarios such as voice assistants, mobile devices, and in-vehicle terminals, personalized recommendations have become an important component of enhancing user experience. Analyzing users' historical behavioral data to uncover their preference characteristics and generate recommendations that match their interests is the basic strategy of current recommendation systems. However, with the continuous enrichment of interaction methods and data types, existing recommendation systems have revealed many shortcomings in the complex and dynamic human-computer interaction environment of intelligent assistants.

[0003] Current mainstream personalized recommendation methods are mainly based on collaborative filtering, matrix factorization, and deep learning models, constructing user profiles by analyzing users' historical clicks, browsing, and ratings. These methods can reflect users' long-term preferences well in static scenarios. However, in dynamic interactive environments such as intelligent assistants, the lack of in-depth modeling of the user's current semantic context makes it difficult to accurately grasp the user's immediate needs, resulting in recommendations that often deviate from the user's true intent. For example, when a user makes an immediate request via voice or text, such as "Find me a high-speed train to Beijing tomorrow," the recommendation results often fail to understand the current dialogue context, relying solely on the user's long-term preferences to generate content that doesn't match the current need, thus affecting the relevance and usability of the recommendations.

[0004] As interaction scenarios become more diverse, user behavior data is becoming increasingly varied, encompassing both unstructured information such as text input and voice commands, and structured data such as browsing history and device status. Existing methods typically employ a uniform encoding approach to model this heterogeneous behavioral data, making it difficult to effectively distinguish the different weights of various behaviors in reflecting user interests, thus limiting the model's ability to identify key behavioral segments. Furthermore, the lack of fine-grained modeling mechanisms hinders the system's ability to effectively highlight key aspects when processing behavioral data, resulting in inaccurate user feature representation and consequently affecting the personalization and accuracy of recommendation results.

[0005] Furthermore, recommendation modules and intelligent assistant dialogue systems are often deployed separately. The recommendation process is typically passively embedded in the overall workflow as an independent response mechanism, lacking deep collaboration with user dialogue semantics. This structural fragmentation makes it difficult for recommendations to perceive changes in user semantics in real time during interaction, and also prevents them from effectively incorporating immediate user feedback on recommendation results to update model parameters. Consequently, this weakens the response efficiency and personalized adjustment capabilities of recommendations in dynamic dialogue scenarios.

[0006] Therefore, how to provide a personalized recommendation method for intelligent assistants based on attention mechanisms is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0007] One objective of this invention is to propose a personalized recommendation method for intelligent assistants based on an attention mechanism. By using an inter-head guided multi-head self-attention network, an improved feedforward neural network, and a reconstructed cross-attention network, it achieves deep modeling of user interests, current intent, and content features, and has the advantages of high recommendation accuracy, strong real-time response, and strong model adaptability.

[0008] A personalized recommendation method for an intelligent assistant based on an attention mechanism according to an embodiment of the present invention includes the following steps:

[0009] S1. Collect user behavior data and generate raw datasets;

[0010] S2. Preprocess the original dataset to generate user behavior sequence vectors and content feature vectors;

[0011] S3. Utilize an inter-head guided multi-head self-attention mechanism to process user behavior sequence vectors and generate behavior collaborative expression vectors;

[0012] S4. An improved feedforward neural network is used to model the content feature vector to generate a content representation vector;

[0013] S5. Process the current dialogue text of the intelligent assistant through a context-injected gating parsing network, and generate a contextual intent vector by combining the time information and spatial location information during the interaction.

[0014] S6. The behavior co-expression vector, content expression vector and contextual intent vector are fused at the feature level through a reconstructed cross-attention network to generate a recommendation vector;

[0015] S7. Based on the recommendation vector, calculate the relevance score of the candidate content through the content-controlled attention scoring mechanism, and obtain the recommendation result set according to the score.

[0016] S8. Output the recommended result set through the intelligent assistant interface, collect user interaction feedback data, and update the network parameters based on the interaction feedback data.

[0017] Optionally, the user's historical behavior data includes: the user's voice command data, the text content entered by the user in the smart assistant, the user's browsing behavior records on the terminal device, and the operating status information of the user's device.

[0018] Optionally, the preprocessing process involves organizing the user's voice command data, text input content, browsing behavior records, and device status information into a user behavior sequence in chronological order, and encoding the behavior content, time information, and context information to generate a user behavior sequence vector and a content feature vector. The content feature vector includes content attribute encoding, category identification information, and context description features.

[0019] Optionally, step S3 includes:

[0020] S31. A head-guided multi-head self-attention network is used to encode the user behavior sequence vector. The mechanism includes one master guiding attention head and three subordinate attention heads.

[0021] S32. The main guidance attention head calculates the query matrix, key matrix, and attention scoring matrix based on the input user behavior sequence vector, and performs matrix multiplication between the attention scoring matrix and the input user behavior sequence vector to generate the guidance matrix. ;

[0022] S34. Each subordinate attention head constructs its own query matrix, key matrix, and value matrix, and combines the query matrix and key matrix with the bootstrapping matrix generated by the main bootstrapping head. Combine and adjust attention weights:

[0023] ;

[0024] in, For the first Attention weight matrix of each subordinate head, Represents the query matrix, Represents the key matrix, , This is the proportional adjustment coefficient. Let be the dimension of the key matrix;

[0025] S35. Weight the value matrix of the three subordinate attention heads according to their attention weights to obtain three intermediate representations. Then, concatenate the output of the main guiding attention head with the outputs of the three subordinate attention heads column by column and input them into the linear mapping layer to perform dimensionality compression processing to generate a fused representation vector.

[0026] S36. Perform a residual connection between the fused representation vector and the input user behavior sequence vector, and perform layer normalization to generate a behavior co-representation vector.

[0027] Optionally, step S4 includes:

[0028] S41. Input the content feature vector into the improved feedforward neural network for feature reconstruction. The improved feedforward neural network includes four parallel expert sub-networks, a routing index calculation module, and a gated vector generation and fusion module.

[0029] The expert subnetwork includes a linear transformation layer and a nonlinear mapping layer with GELU activation function. The output dimension of the linear transformation layer of each expert subnetwork is set differently. The linear transformation layer receives the input content feature vector and performs linear operations with a preset weight matrix and bias vector to map the content feature vector to a set hidden dimension space to generate an intermediate vector. The nonlinear mapping layer performs a nonlinear transformation on the intermediate vector based on the GELU activation function to generate an expert vector.

[0030] S42. Based on category identification information in content feature vectors Through hash function Calculate the route index ,in For integer hash mapping functions, the mod 4 operation restricts the output value to belong to the set of expert subnetwork numbers. ;

[0031] S43, Based on route index Construct a gate vector of length 4. , where, when the index position season The rest of the positions Then, the expert vector output by each expert subnetwork is multiplied by the corresponding gating value and summed to obtain the gated single-path output vector;

[0032] S44. Input the single-path output vector into the linear mapping layer for dimensionality compression and perform layer normalization to generate a content representation vector.

[0033] Optionally, step S5 includes:

[0034] S51. Construct a context-injected gated parsing network, wherein the context-injected gated parsing network includes a semantic encoding path, a context injection path, and a gated fusion layer. The semantic encoding path includes a two-layer feedforward structure, the context injection path includes a time-aware convolutional module and a feature compression module, and the gated fusion layer receives the outputs of the semantic encoding path and the context injection path.

[0035] S52. Input the current dialogue text into the semantic encoding path to generate a text semantic vector. ;

[0036] S53. Input the current dialogue history context into the context injection pathway to generate a context representation vector. And calculate the gating coefficient in the gating fusion layer. The fused semantic representation vector is obtained. :

[0037] ;

[0038] S54. Concatenate the semantic representation vector with the interaction time vector and spatial location information vector, and input the concatenation vector into the linear mapping layer to generate the contextual intent vector.

[0039] Optionally, step S6 includes:

[0040] S61. Construct a reconstructed cross-attention network, which includes three input paths, a shared semantic alignment module, a cross-attention calculation module, and a residual fusion module.

[0041] The three input paths respectively receive behavioral collaborative expression vectors. Content representation vector and contextual intent vector And through linear mapping transformation, path representation vectors of a unified dimension are obtained respectively. ;

[0042] The shared semantic alignment module introduces a shared alignment matrix. Semantic alignment is performed on the three path representation vectors respectively to generate semantically aligned representation vectors:

[0043]

[0044]

[0045] ;

[0046] S62. In the cross-attention calculation module, each semantically aligned representation vector is used as the query vector, and the other two are used as the key vector and value vector, respectively. Three sets of cross-attention calculations are performed to generate three cross-attention vectors:

[0047]

[0048]

[0049]

[0050] S63. In the residual fusion module, the three cross-attention vectors are concatenated to form a concatenated vector. Introducing a shared linear mapping matrix Perform dimensional compression and add behavior path alignment representation. As a residual term, the fusion vector is calculated. :

[0051] ;

[0052] S64, merge vectors Recommendation vectors are generated through normalization and compression mapping operations.

[0053] In the residual fusion module of the reconstructed cross-attention network, the alignment representation of the behavior path is introduced as a residual term. This helps to retain the main information of the user's original behavior features in the fusion representation, avoids the dilution or interference of key behavioral semantics during the cross-attention process, improves the stability of the feature representation and the convergence of the training process, strengthens the dominant position of the behavior path in recommendation modeling, can provide semantic compensation after multi-source information fusion, and enhances the expressive power of the final fusion representation and the robustness of the model.

[0054] In the method of this invention, user behavior sequence vectors are encoded through an inter-head guided multi-head self-attention mechanism to extract correlation features between behaviors and generate a behavior collaborative expression vector that comprehensively reflects the dynamics of user interests. An improved feedforward neural network is used to perform structured modeling of content feature vectors to generate semantically compressed content expression vectors. A context-injected gating parsing network is used to process the current dialogue text and, combined with interaction time and location information, to construct a contextual intent vector. The above three types of vectors are used as multi-dimensional inputs and feature-level fusion is performed through a reconstructed cross-attention network to capture the deep interaction relationship between the three types of information, thereby generating a recommendation input vector with high semantic relevance.

[0055] Optionally, step S7 includes:

[0056] S71. Input the features of the candidate content into the improved feedforward neural network to generate candidate content representation vectors. ;

[0057] S72. Construct a content regulation and attention scoring mechanism, which includes a main scoring path and an auxiliary regulation path. The main scoring path receives recommendation vectors. With candidate content representation vector Generate matching vector pairs through linear mapping , ,in and Trainable parameters for the main scoring path;

[0058] S73, Attribute vector of candidate content received by auxiliary control path And through the mapping matrix Generation of regulatory factors ,in This represents the Sigmoid activation function;

[0059] S74. Perform a normalized dot product operation on the matching vectors of the main scoring path, and calculate the correlation score by combining it with the control factor:

[0060] ;

[0061] in, Indicates the candidate content The query vector, Indicates the candidate content The key vector, Indicates regulatory factor, Represents the L2 norm;

[0062] S75. Sort all candidate scores in descending order of numerical value to generate a set of recommendation results.

[0063] The content-modulated attention scoring mechanism constructs candidate content representation vectors and adjusts the attention scoring process based on the contextual relevance between recommendation vectors and moderating factors. This allows the relevance score to reflect both overall similarity and the guiding role of content features in recommendation preferences, thereby improving the matching accuracy and ranking reliability of recommendation results. Compared to fixed-weight scoring methods, it has stronger adaptability and discriminative ability when dealing with diverse candidate information.

[0064] Optionally, step S8 includes:

[0065] S81. The set of recommended results is displayed through the intelligent assistant interface, and each recommended item in the set is bound to a unique content identifier and a recommendation sequence number.

[0066] S82. Receive user interaction feedback data for recommended items, the feedback data including click behavior, ignore behavior, favorite operation, delete operation and rating input;

[0067] S83. Associate each feedback action with the content identifier of the corresponding recommendation item to construct a feedback data unit. The feedback data unit includes feedback type, target identifier, timestamp and operation value.

[0068] S84. The feedback data units are combined into a feedback data set to update the network parameters and complete the continuous adaptive optimization of the recommendation model.

[0069] The beneficial effects of this invention are:

[0070] First, this invention introduces a master-slave structured, head-guided, multi-head self-attention network to deeply model user behavior sequences. When identifying dependencies and interest priorities between different temporal behaviors, it dynamically adjusts the focus direction of each attention head, thereby improving the accuracy of user feature representation and the precision of interest modeling. Second, this invention introduces an improved feedforward neural network to extract features from candidate content and combines this with contextual semantic parsing to generate content and intent representations. This achieves deep integration of recommendation logic and semantic information, enhancing the understanding of users' immediate needs and improving the contextual relevance of recommendation results. Furthermore, this invention introduces a reconstructive cross-attention network in the multi-source vector fusion stage. Through semantic alignment and residual reconstruction mechanisms, it strengthens the deep interaction between behavioral features, content features, and intent features, and combines user interaction feedback to achieve online model updates, thereby constructing recommendation input vectors with adaptive capabilities and high representational quality.

[0071] In summary, this invention significantly improves the accuracy, real-time performance, and interactivity of personalized recommendations in intelligent assistant scenarios through structural optimization and mechanism improvements in key aspects such as user modeling, contextual understanding, feature fusion, and online learning. It effectively solves the problems of static modeling, failure to recognize immediate intent, and delayed recommendation response in existing recommendation systems. Attached Figure Description

[0072] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0073] Figure 1 This is a flowchart illustrating a personalized recommendation method for an intelligent assistant based on an attention mechanism proposed in this invention.

[0074] Figure 2 This is a flowchart of the multi-source attention feature fusion process for personalized recommendation in this invention;

[0075] Figure 3 This is a flowchart of the content control attention scoring mechanism in this invention. Detailed Implementation

[0076] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0077] refer to Figure 1-3 A personalized recommendation method for intelligent assistants based on an attention mechanism includes:

[0078] S1. Collect user behavior data and generate raw datasets;

[0079] S2. Preprocess the original user behavior dataset to generate user behavior sequence vectors and content feature vectors;

[0080] S3. Utilize an inter-head guided multi-head self-attention mechanism to process user behavior sequence vectors and generate behavior collaborative expression vectors;

[0081] S4. An improved feedforward neural network is used to model the content feature vector to generate a content representation vector;

[0082] S5. Process the current dialogue text of the intelligent assistant through a context-injected gating parsing network, and generate a contextual intent vector by combining the time information and spatial location information during the interaction.

[0083] S6. The behavior co-expression vector, content expression vector and contextual intent vector are fused at the feature level through a reconstructed cross-attention network to generate a recommendation vector;

[0084] S7. Based on the recommendation vector, calculate the relevance score of the candidate content through the content-controlled attention scoring mechanism, and obtain the recommendation result set according to the score.

[0085] S8. Output the recommended result set through the intelligent assistant interface, collect user interaction feedback data, and update the network parameters based on the interaction feedback data.

[0086] In this embodiment, the user's historical behavior data includes: the user's voice command data, the text content entered by the user in the smart assistant, the user's browsing behavior records on the terminal device, and the operating status information of the user's device.

[0087] In this embodiment, the preprocessing process involves organizing the user's voice command data, text input content, browsing behavior records, and device status information into a user behavior sequence in chronological order, and encoding the behavior content, time information, and context information to generate a user behavior sequence vector and a content feature vector. The content feature vector includes content attribute encoding, category identification information, and context description features.

[0088] In this embodiment, step S3 includes:

[0089] S31. A head-guided multi-head self-attention network is used to encode the user behavior sequence vector. The mechanism includes one master guiding attention head and three subordinate attention heads.

[0090] S32. The main guidance attention head calculates the query matrix, key matrix, and attention scoring matrix based on the input user behavior sequence vector, and performs matrix multiplication between the attention scoring matrix and the input user behavior sequence vector to generate the guidance matrix. ;

[0091] S34. Each subordinate attention head constructs its own query matrix, key matrix, and value matrix, and combines the query matrix and key matrix with the bootstrapping matrix generated by the main bootstrapping head. Combine and adjust attention weights:

[0092] ;

[0093] in, For the first Attention weight matrix of each subordinate head, Represents the query matrix, Represents the key matrix, , This is the proportional adjustment coefficient. Let be the dimension of the key matrix;

[0094] S35. Weight the value matrix of the three subordinate attention heads according to their attention weights to obtain three intermediate representations. Then, concatenate the output of the main guiding attention head with the outputs of the three subordinate attention heads column by column and input them into the linear mapping layer to perform dimensionality compression processing to generate a fused representation vector.

[0095] S36. Perform a residual connection between the fused representation vector and the input user behavior sequence vector, and perform layer normalization to generate a behavior co-representation vector.

[0096] In this embodiment, step S4 includes:

[0097] S41. Input the content feature vector into the improved feedforward neural network for feature reconstruction. The improved feedforward neural network includes four parallel expert sub-networks, a routing index calculation module, and a gated vector generation and fusion module.

[0098] The expert subnetwork includes a linear transformation layer and a nonlinear mapping layer with GELU activation function. The output dimension of the linear transformation layer of each expert subnetwork is set differently. The linear transformation layer receives the input content feature vector and performs linear operations with a preset weight matrix and bias vector to map the content feature vector to a set hidden dimension space to generate an intermediate vector. The nonlinear mapping layer performs a nonlinear transformation on the intermediate vector based on the GELU activation function to generate an expert vector.

[0099] S42. Based on category identification information in content feature vectors Through hash function Calculate the route index ,in For integer hash mapping functions, the mod 4 operation restricts the output value to belong to the set of expert subnetwork numbers. ;

[0100] S43, Based on route index Construct a gate vector of length 4. , where, when the index position season The rest of the positions Then, the expert vector output by each expert subnetwork is multiplied by the corresponding gating value and summed to obtain the gated single-path output vector;

[0101] In this embodiment, step S5 includes:

[0102] S51. Construct a context-injected gated parsing network, wherein the context-injected gated parsing network includes a semantic encoding path, a context injection path, and a gated fusion layer. The semantic encoding path includes a two-layer feedforward structure, the context injection path includes a time-aware convolutional module and a feature compression module, and the gated fusion layer receives the outputs of the semantic encoding path and the context injection path.

[0103] S52. Input the current dialogue text into the semantic encoding path to generate a text semantic vector. ;

[0104] S53. Input the current dialogue history context into the context injection pathway to generate a context representation vector. And calculate the gating coefficient in the gating fusion layer. The fused semantic representation vector is obtained. :

[0105] ;

[0106] S54. Concatenate the semantic representation vector with the interaction time vector and spatial location information vector, and input the concatenation vector into the linear mapping layer to generate the contextual intent vector.

[0107] In this embodiment, step S6 includes:

[0108] S61. Construct a reconstructed cross-attention network, which includes three input paths, a shared semantic alignment module, a cross-attention calculation module, and a residual fusion module.

[0109] The three input paths respectively receive behavioral collaborative expression vectors. Content representation vector and contextual intent vector And through linear mapping transformation, path representation vectors of a unified dimension are obtained respectively. ;

[0110] The shared semantic alignment module introduces a shared alignment matrix. Semantic alignment is performed on the three path representation vectors respectively to generate semantically aligned representation vectors:

[0111]

[0112]

[0113] ;

[0114] S62. In the cross-attention calculation module, each semantically aligned representation vector is used as the query vector, and the other two are used as the key vector and value vector, respectively. Three sets of cross-attention calculations are performed to generate three cross-attention vectors:

[0115]

[0116]

[0117]

[0118] S63. In the residual fusion module, the three cross-attention vectors are concatenated to form a concatenated vector. Introducing a shared linear mapping matrix Perform dimensional compression and add behavior path alignment representation. As a residual term, the fusion vector is calculated. :

[0119] ;

[0120] S64, merge vectors Recommendation vectors are generated through normalization and compression mapping operations.

[0121] In the residual fusion module of the reconstructed cross-attention network, the alignment representation of the behavior path is introduced as a residual term. This helps to retain the main information of the user's original behavior features in the fusion representation, avoids the dilution or interference of key behavioral semantics during the cross-attention process, improves the stability of the feature representation and the convergence of the training process, strengthens the dominant position of the behavior path in recommendation modeling, can provide semantic compensation after multi-source information fusion, and enhances the expressive power of the final fusion representation and the robustness of the model.

[0122] In the method of this invention, user behavior sequence vectors are encoded through an inter-head guided multi-head self-attention mechanism to extract correlation features between behaviors and generate a behavior collaborative expression vector that comprehensively reflects the dynamics of user interests. An improved feedforward neural network is used to perform structured modeling of content feature vectors to generate semantically compressed content expression vectors. A context-injected gating parsing network is used to process the current dialogue text and, combined with interaction time and location information, to construct a contextual intent vector. The above three types of vectors are used as multi-dimensional inputs and feature-level fusion is performed through a reconstructed cross-attention network to capture the deep interaction relationship between the three types of information, thereby generating a recommendation input vector with high semantic relevance.

[0123] In this embodiment, step S7 includes:

[0124] S71. Input the features of the candidate content into the improved feedforward neural network to generate candidate content representation vectors. ;

[0125] S72. Construct a content regulation and attention scoring mechanism, which includes a main scoring path and an auxiliary regulation path. The main scoring path receives recommendation vectors. With candidate content representation vector Generate matching vector pairs through linear mapping , ,in and Trainable parameters for the main scoring path;

[0126] S73, Attribute vector of candidate content received by auxiliary control path And through the mapping matrix Generation of regulatory factors ,in This represents the Sigmoid activation function;

[0127] S74. Perform a normalized dot product operation on the matching vectors of the main scoring path, and calculate the correlation score by combining it with the control factor:

[0128] ;

[0129] in, Indicates the candidate content The query vector, Indicates the candidate content The key vector, Indicates regulatory factor, Represents the L2 norm;

[0130] S75. Sort all candidate scores in descending order of numerical value to generate a set of recommendation results.

[0131] The content-modulated attention scoring mechanism constructs candidate content representation vectors and adjusts the attention scoring process based on the contextual relevance between recommendation vectors and moderating factors. This allows the relevance score to reflect both overall similarity and the guiding role of content features in recommendation preferences, thereby improving the matching accuracy and ranking reliability of recommendation results. Compared to fixed-weight scoring methods, it has stronger adaptability and discriminative ability when dealing with diverse candidate information.

[0132] In this embodiment, step S8 includes:

[0133] S81. The set of recommended results is displayed through the intelligent assistant interface, and each recommended item in the set is bound to a unique content identifier and a recommendation sequence number.

[0134] S82. Receive user interaction feedback data for recommended items, the feedback data including click behavior, ignore behavior, favorite operation, delete operation and rating input;

[0135] S83. Associate each feedback action with the content identifier of the corresponding recommendation item to construct a feedback data unit. The feedback data unit includes feedback type, target identifier, timestamp and operation value.

[0136] S84. The feedback data units are combined into a feedback data set to update the network parameters and complete the continuous adaptive optimization of the recommendation model.

[0137] Example 1:

[0138] To verify the feasibility of this invention in practice, it was applied to the voice-activated intelligent assistant system of a comprehensive service platform. This platform offers a wide range of services, covering multiple business scenarios such as travel, tourism, accommodation, ticketing, and lifestyle services, with over 5 million voice interactions daily. It exhibits typical characteristics of multi-scenario, multi-task, and multi-turn dialogue. Users initiate natural language commands through the intelligent assistant to complete specific tasks, such as ordering tickets, finding nearby restaurants, and browsing popular events.

[0139] This experiment conducted two tests on the platform, Group A and Group B. Group A used the platform's existing recommendation system, while Group B introduced the personalized recommendation method for intelligent assistants based on the attention mechanism proposed in this invention. Users in both groups were stratified and randomly sampled according to region, age, gender, and device type to ensure balanced experimental conditions. The testing period lasted four weeks, using data from at least 20,000 daily active users for comparative evaluation.

[0140] In Group B, this invention first collects historical user behavior data, including voice command text, user-inputted search phrases, browsed content information, and device operating status. After preprocessing, the data is converted into user behavior sequence vectors and content feature vectors. Subsequently, the user behavior sequence vectors are fed into an inter-head guided multi-head self-attention network to extract interest patterns from the time series and generate a behavior co-expression vector. The content feature vectors are compressed and expressed using an improved feedforward neural network to form a content expression vector. Simultaneously, the current dialogue input undergoes semantic parsing through a context-injected gating parsing network, combining interaction time and spatial location to form a contextual intent vector.

[0141] The three representation vectors are then input into the reconstructed cross-attention network proposed in this invention. By introducing a shared semantic alignment mechanism, a path cross structure, and a residual reconstruction unit, the three information streams are fused to ultimately generate a comprehensive vector representation for recommendation. During the recommendation stage, candidate content is encoded using an improved feedforward neural network to generate candidate content representation vectors, which are then scored and ranked against the recommendation input vectors through a content-controlled attention mechanism. The final result is presented to the user via voice or text / image through the intelligent assistant interface. User actions such as clicks, skips, and ratings are recorded in real time and used as feedback data for model updates.

[0142] During the experiment, the platform statistically analyzed the average click-through rate, average session rounds, payment conversion rate, and recommendation response time. Table 1 below shows a comparison of experimental data from some sampling days:

[0143] Table 1. Comparison of Experimental Performance of Intelligent Assistant Recommendation Systems

[0144] Active users experimental group Average click-through rate (%) Average number of conversation rounds Payment conversion rate (%) Recommended response time (ms) 20,847 Group A 6.48 2.2 1.72 127 20,912 Group B 11.16 3.6 3.39 138 19,974 Group A 5.96 2.1 1.53 129 20,031 Group B 10.74 3.4 3.04 137 20,203 Group A 6.11 2.3 1.69 130 20,250 Group B 11.03 3.7 3.41 139 20,450 Group A 6.28 2.4 1.76 125 20,521 Group B 11.41 3.8 3.62 141

[0145] The data in the table shows that the method of this invention outperforms traditional methods in several key indicators. The average click-through rate of group B was generally more than 4.5 percentage points higher than that of group A, indicating a significant increase in user acceptance of the recommended content. The average number of conversation rounds increased to over 3.6, indicating that the recommended content was more attractive and promoted deeper interaction between users and the assistant. The payment conversion rate in the experimental group was almost twice that of the original model, validating the accuracy and actual commercial value of the recommendations. The recommendation response time was only slightly higher than the original model, with the increase controlled within about 10 milliseconds, which is imperceptible to users and does not affect the smoothness of the experience.

[0146] In a dialogue example, the user expressed a need to "go to a quiet little place to play the day after tomorrow." The original model recommended conventional popular attractions, such as city tours, business districts, and famous scenic spots, which did not match "quiet" and "little place." However, the method of this invention combines the word weights in the current semantic intent vector with the contextual historical preferences, and prioritizes pushing resources related to "eco-friendly homestays," "ancient town tours," and "off-the-beaten-path routes," thereby improving the recommendation relevance.

[0147] Based on the above experimental results, this invention not only improves the accuracy of personalized recommendations but also enhances its adaptability to natural language interaction processes. It solves the problems of weak context awareness, coarse interest extraction, and slow feedback response in traditional recommendation systems, and has good practicality and promotional value.

[0148] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A personalized recommendation method for intelligent assistants based on an attention mechanism, characterized in that, Includes the following steps: S1. Collect user behavior data and generate raw datasets; S2. Preprocess the original dataset to generate user behavior sequence vectors and content feature vectors; S3. Utilize an inter-head guided multi-head self-attention mechanism to process user behavior sequence vectors and generate behavior collaborative expression vectors; S4. An improved feedforward neural network is used to model the content feature vector to generate a content representation vector; S5. Process the current dialogue text of the intelligent assistant through a context-injected gating parsing network, and generate a contextual intent vector by combining the time information and spatial location information during the interaction. S6. The behavior co-expression vector, content expression vector and contextual intent vector are fused at the feature level through a reconstructed cross-attention network to generate a recommendation vector; S7. Based on the recommendation vector, calculate the relevance score of the candidate content through the content-controlled attention scoring mechanism, and obtain the recommendation result set according to the score. S8. Output the recommended result set through the intelligent assistant interface, collect user interaction feedback data, and update the network parameters based on the interaction feedback data.

2. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, The user's historical behavior data includes: the user's voice command data, the text content entered by the user in the smart assistant, the user's browsing behavior records on the terminal device, and the operating status information of the user's device.

3. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, The preprocessing process involves organizing the user's voice command data, text input content, browsing behavior records, and device status information into a user behavior sequence in chronological order, and encoding the behavior content, time information, and context information to generate a user behavior sequence vector and a content feature vector. The content feature vector includes content attribute encoding, category identification information, and context description features.

4. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S3 includes: S31. The user behavior sequence vector is encoded using an inter-head guided multi-head self-attention mechanism, wherein the inter-head guided multi-head self-attention mechanism includes one master guiding attention head and three subordinate attention heads; S32. The main guidance attention head calculates the query matrix, key matrix, and attention scoring matrix based on the input user behavior sequence vector, and performs matrix multiplication operation between the attention scoring matrix and the input user behavior sequence vector to generate the guidance matrix; S34. Each subordinate attention head constructs its own query matrix, key matrix, and value matrix, and combines the query matrix and key matrix with the guidance matrix generated by the main guidance head to adjust the attention weights. S35. Weight the value matrix of the three subordinate attention heads according to their attention weights to obtain three intermediate representations. Then, concatenate the output of the main guiding attention head with the outputs of the three subordinate attention heads column by column and input them into the linear mapping layer to perform dimensionality compression processing to generate a fused representation vector. S36. Perform a residual connection between the fused representation vector and the input user behavior sequence vector, and perform layer normalization to generate a behavior co-representation vector.

5. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S4 includes: S41. Input the content feature vector into the improved feedforward neural network for feature reconstruction. The improved feedforward neural network includes four parallel expert sub-networks, a routing index calculation module, and a gated vector generation and fusion module. The expert subnetwork includes a linear transformation layer and a nonlinear mapping layer with GELU activation function. The output dimension of the linear transformation layer of each expert subnetwork is set differently. The linear transformation layer receives the input content feature vector and performs linear operations with a preset weight matrix and bias vector to map the content feature vector to a set hidden dimension space to generate an intermediate vector. The nonlinear mapping layer performs a nonlinear transformation on the intermediate vector based on the GELU activation function to generate an expert vector. S42. Calculate the routing index using a hash function based on the category identifier information in the content feature vector; S43. Based on the routing index, construct a gated vector of length 4, where the gated vector is set to [value] when the index position is equal to the routing index. The remaining positions are set to 0, and the expert vector output by each expert subnetwork is multiplied by the corresponding gating value and then summed to obtain the gated single path output vector; S44. Input the single-path output vector into the linear mapping layer for dimensionality compression and perform layer normalization to generate a content representation vector.

6. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S5 includes: S51. Construct a context-injected gated parsing network, wherein the context-injected gated parsing network includes a semantic encoding path, a context injection path, and a gated fusion layer. The semantic encoding path includes a two-layer feedforward structure, the context injection path includes a time-aware convolutional module and a feature compression module, and the gated fusion layer receives the outputs of the semantic encoding path and the context injection path. S52. Input the current dialogue text into the semantic encoding path to generate a text semantic vector; S53. Input the current dialogue history context into the context injection path to generate a context representation vector, and calculate the gating coefficient in the gating fusion layer to obtain the fused semantic representation vector; S54. Concatenate the semantic representation vector with the interaction time vector and spatial location information vector, and input the concatenation vector into the linear mapping layer to generate the contextual intent vector.

7. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S6 includes: S61. Construct a reconstructed cross-attention network, which includes three input paths, a shared semantic alignment module, a cross-attention calculation module, and a residual fusion module. The three input paths receive behavioral co-expression vectors, content expression vectors, and contextual intent vectors, respectively, and obtain path representation vectors of a unified dimension through linear mapping transformation; The shared semantic alignment module introduces a shared alignment matrix and performs semantic alignment operations on the three path representation vectors respectively to generate semantically aligned representation vectors. S62. In the cross-attention calculation module, each semantically aligned representation vector is used as the query vector, and the other two paths are used as the key vector and value vector respectively. Three sets of cross-attention calculations are performed to generate three cross-attention vectors. S63. In the residual fusion module, the three cross-attention vectors are concatenated to form a concatenated vector. A shared linear mapping matrix is ​​introduced for dimensionality compression, and a behavior path alignment representation is added as a residual term to calculate the fusion vector. S64. The fused vector is normalized and compressed to generate a recommendation vector.

8. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S7 includes: S71. Input the features of the candidate content into the improved feedforward neural network to generate a candidate content representation vector; S72. Construct a content control attention scoring mechanism, which includes a main scoring path and an auxiliary control path. The main scoring path receives a recommendation vector and a candidate content representation vector, and generates matching vector pairs through linear mapping. S73. The auxiliary control path receives the attribute vector of the candidate content and generates the control factor through the mapping matrix; S74. Perform a normalized dot product operation on the matching vectors of the main scoring path, and calculate the correlation score by combining it with the control factor: ; in, Indicates the candidate content The query vector, Indicates the candidate content The key vector, Indicates regulatory factor, Represents the L2 norm; S75. Sort all candidate scores in descending order of numerical value to generate a set of recommendation results.

9. The personalized recommendation method for an intelligent assistant based on an attention mechanism according to claim 1, characterized in that, Step S8 includes: S81. Display the set of recommendation results through the intelligent assistant interface, wherein each recommendation item in the set is bound to a unique content identifier and recommendation sequence number information; S82. Receive user interaction feedback data for recommended items, the feedback data including click behavior, ignore behavior, favorite operation, delete operation and rating input; S83. Associate each feedback action with the content identifier of the corresponding recommendation item to construct a feedback data unit. The feedback data unit includes feedback type, target identifier, timestamp and operation value. S84. The feedback data units are combined into a feedback data set to update the network parameters and complete the continuous adaptive optimization of the recommendation model.