Recommendation method and device, electronic equipment, storage medium and program product

By learning the association between user and item features through the attention model, generating target user sequences and making item recommendations, it solves the problem of insufficient utilization of user and item association information in the existing technology and achieves highly accurate and personalized item recommendations.

CN120821902APending Publication Date: 2025-10-21BEIJING JIZHI DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510806293.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

The existing dual-tower model cannot fully utilize the potential association information between users and items in item recommendation, resulting in low recommendation accuracy and personalization.

Method used

The target user behavior feature sequence is divided into historical and recent features through the attention model, and the correlation between user features and item features is learned. Transformer encoding and pooling processing are used to generate the target user sequence, and item recommendations are performed in combination with the candidate item sequence.

Benefits of technology

It improves the accuracy, timeliness and personalization of item recommendations and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821902A_ABST
    Figure CN120821902A_ABST
Patent Text Reader

Abstract

The invention discloses a recommendation method and device, electronic equipment, a storage medium and a program product, and belongs to the field of article recommendation. The recommendation method comprises the steps of dividing a target user behavior feature sequence into a first sub-target user behavior feature sequence located before a target time node and a second sub-target user behavior feature sequence located after the target time node according to a time sequence; inputting the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into an attention model, and obtaining a target user sequence output by the attention model; and obtaining a target recommended article based on the target user sequence and the candidate article sequence. According to the recommendation method, the potential association information between the user and the article can be fully utilized for article recommendation, the recommendation accuracy, timeliness and individuation degree are high, and the use experience of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of item recommendation, and in particular to a recommendation method, device, electronic device, storage medium, and program product. Background Art

[0002] The dual-tower model is a widely used architecture in recommendation systems. It typically consists of two independent towers: the user tower and the item tower. The user tower processes user features, while the item tower processes item features. In related technologies, when using the dual-tower model for item recommendation, user and item features are processed by independent neural networks. A final recommendation score is generated using a dot product or weighted sum method, and item recommendations are then made based on the recommendation score. This method fails to fully utilize the potential associations between users and items, resulting in low accuracy and personalization of recommendations. Summary of the Invention

[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a recommendation method, device, electronic device, storage medium, and program product that fully utilize the potential association information between users and items to make item recommendations, with high recommendation accuracy, timeliness, and personalization, thereby helping to improve the user experience.

[0004] In a first aspect, the present application provides a recommendation method, the method comprising:

[0005] Dividing the target user behavior feature sequence into a first sub-target user behavior feature sequence located before the target time node and a second sub-target user behavior feature sequence located after the target time node according to the time sequence;

[0006] Inputting the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into an attention model, and obtaining a target user sequence output by the attention model;

[0007] Based on the target user sequence and the candidate item sequence, a target recommended item is obtained.

[0008] According to the recommendation method of the present application, through the attention model, the correlation between user characteristics and item characteristics is pre-calculated based on the target user behavior characteristics to obtain a target user sequence that can highlight the items that the user is currently more interested in, and then item recommendations are made based on the target user sequence and the candidate item sequence. This method can fully utilize the potential correlation information between users and items to make item recommendations, has high recommendation accuracy, timeliness and personalization, and helps to improve the user experience.

[0009] According to one embodiment of the present application, the attention model is trained by the following steps:

[0010] Obtain multiple sample user behavior feature sequences;

[0011] Dividing each of the sample user behavior feature sequences into at least one historical behavior feature and at least one first behavior feature according to a chronological order;

[0012] The historical behavior features and the first behavior features are input into the attention model to learn the correlation between the historical behavior features and the first behavior features, and the attention model is trained with the goal of outputting a predicted user sequence.

[0013] According to one embodiment of the present application, inputting the historical behavior features and the first behavior features into the attention model to learn the correlation between the historical behavior features and the first behavior features and outputting a predicted user sequence as a goal, training the attention model includes:

[0014] Performing Transformer encoding and average pooling processing on the first behavior feature to obtain a second behavior feature;

[0015] Learning the association weights between each of the historical behavior features and the interest-related information represented by the second behavior feature through an attention mechanism module;

[0016] The attention model is trained based on the association weight, the historical behavior feature, and the second behavior feature to obtain the predicted user sequence.

[0017] According to the recommendation method of this application, by dividing the sample user behavior feature sequence and learning the association weights between historical behavior features and first behavior features, the user's short-term interest vector can be obtained by combining the recent first behavior features with Transformer. On the basis of indirectly introducing item features, adaptive weight assignment can be performed according to the changes in interest preferences of the same user at different time nodes, thereby obtaining a predicted user sequence that can highlight the items that the user is currently more interested in, further improving the accuracy and personalization of the attention model, and having high timeliness.

[0018] According to one embodiment of the present application, the training of the attention model based on the association weight, the historical behavior feature, and the second behavior feature to obtain the predicted user sequence includes:

[0019] Performing weight assignment processing on the historical behavior feature based on the association weight to obtain a third behavior feature;

[0020] Each of the historical behavior features, each of the third behavior features, and each of the second behavior features is merged and pooled to obtain the predicted user sequence.

[0021] According to an embodiment of the present application, the target user behavior feature sequence includes behavior feature data corresponding to the target user at multiple time nodes, and each behavior feature data is used to characterize the target user's operation action on the object.

[0022] According to the recommendation method of the present application, a target user behavior feature sequence is constructed by constructing multiple historical operations of the user on multiple items, which can indirectly introduce item features, so that the attention model learns the association between features, item features, corresponding operations and time features, and constructs a target user sequence based on the association. It can pre-learn the correlation between user features and item features, so that the target user sequence constructed based on the correlation is more in line with the current user's behavioral feature habits, thereby improving the accuracy of the obtained target user sequence, which helps to improve the accuracy and personalization of subsequent item recommendations based on the target user sequence.

[0023] According to one embodiment of the present application, obtaining target recommended items based on the target user sequence and the candidate item sequence includes:

[0024] Calculating similarity between the target user sequence and the candidate item sequence to obtain a similarity result;

[0025] Based on the similarity result, the target recommended item is determined from the candidate item sequence.

[0026] In a second aspect, the present application provides a recommendation device, comprising:

[0027] A first processing module is configured to divide the target user behavior feature sequence into a first sub-target user behavior feature sequence located before a target time node and a second sub-target user behavior feature sequence located after the target time node according to a time sequence;

[0028] A second processing module is configured to input the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into an attention model to obtain a target user sequence output by the attention model;

[0029] The third processing module is configured to obtain target recommended items based on the target user sequence and the candidate item sequence.

[0030] According to the recommendation device of the present application, through the attention model, the correlation between user characteristics and item characteristics is pre-calculated based on the target user behavior characteristics to obtain a target user sequence that can highlight the items that the user is currently more interested in, and then item recommendations are made based on the target user sequence and the candidate item sequence. This can fully utilize the potential correlation information between users and items to make item recommendations, has high recommendation accuracy, timeliness and personalization, and helps to improve the user experience.

[0031] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the recommendation method as described in the first aspect above when executing the computer program.

[0032] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the recommendation method as described in the first aspect above.

[0033] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the recommendation method as described in the first aspect above.

[0034] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0035] Through the attention model, the correlation between user features and item features is pre-calculated based on the target user's behavioral characteristics to obtain a target user sequence that can highlight the items that the user is currently more interested in. Then, item recommendations are made based on the target user sequence and the candidate item sequence. This can fully utilize the potential correlation information between users and items for item recommendations, with high recommendation accuracy, timeliness and personalization, which helps to improve the user experience.

[0036] Furthermore, by constructing a target user behavior feature sequence through the user's multiple historical operations on multiple items, the item features can be indirectly introduced, so that the attention model learns the association between the user features, item features, corresponding operations and time features, and constructs the target user sequence based on the association. It can pre-learn the correlation between user features and item features, so that the target user sequence constructed based on the correlation is more in line with the current user's behavioral feature habits, thereby improving the accuracy of the obtained target user sequence, which helps to improve the accuracy and personalization of subsequent item recommendations based on the target user sequence.

[0037] Furthermore, by dividing the sample user behavior feature sequence and learning the association weights between historical behavior features and first behavior features, we can use the recent first behavior features in combination with Transformer to obtain the user's short-term interest vector. On the basis of indirectly introducing item features, we can also perform adaptive weight assignment based on the changes in the interest preferences of the same user at different time nodes, and obtain a predicted user sequence that can highlight the items that the user is currently more interested in, further improving the accuracy and personalization of the attention model, and having high timeliness.

[0038] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0040] Figure 1 This is one of the flow charts of the recommended method provided in the embodiments of this application;

[0041] Figure 2 This is the second flow chart of the recommended method provided in the embodiment of the present application;

[0042] Figure 3 This is the third flow chart of the recommended method provided in the embodiment of this application;

[0043] Figure 4 It is a structural diagram of a recommended device provided in an embodiment of the present application;

[0044] Figure 5 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0046] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0047] The following describes in detail the recommendation method, recommendation device, electronic device, and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0048] The recommendation method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0049] The recommendation method provided in the embodiments of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the recommendation method. The electronic devices mentioned in the embodiments of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The recommendation method provided in the embodiments of the present application is described below using an electronic device as an example of the execution entity.

[0050] like Figure 1 As shown, the recommendation method includes: step 110, step 120 and step 130.

[0051] It can be understood that this recommendation method can be used in recommendation scenarios, including but not limited to various user recommendation scenarios such as product recommendation, house recommendation, game recommendation, video recommendation, music recommendation and text note recommendation.

[0052] Step 110: Divide the target user behavior feature sequence into a first sub-target user behavior feature sequence located before the target time node and a second sub-target user behavior feature sequence located after the target time node according to the time sequence;

[0053] In this step, the target time node can be any time node and can be customized by the user.

[0054] In some embodiments, the target time node may be a time node some time before the current time node for recommendation, such as a time node corresponding to the previous week or two weeks.

[0055] The target user is any user to be recommended. The target user behavior feature sequence is used to characterize the target user's behavior characteristics over a period of time. Based on the behavior characteristics, the user's like, dislike, or expectation for an item can be represented.

[0056] Among them, items can include physical items such as houses, real estate, clothing, furniture, vehicles and daily necessities, as well as virtual items such as games, videos, music and text notes.

[0057] It can be understood that the target user behavior feature sequence may include multiple sub-behavior features, and each sub-behavior feature corresponds to a time node, that is, the time when the behavior corresponding to the sub-behavior feature occurs; the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence are partial sub-behavior features in the target user feature behavior sequence, and the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence may respectively include one or more sub-behavior features.

[0058] The first sub-target user behavior feature sequence includes one or more sub-behavior features located before the target time node, and is used to characterize the historical behavior features of the target user.

[0059] The second sub-target user behavior feature sequence includes one or more sub-behavior features located after the target time node, and is used to characterize the behavior features of the target user in the most recent period of time.

[0060] In the actual execution process, the target user behavior feature sequence can be divided according to the target time node to obtain the target user's historical behavior features and the behavior features of the most recent period, and then obtain the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence.

[0061] In some embodiments, the target user behavior feature sequence includes behavior feature data corresponding to the target user at multiple time nodes, and each behavior feature data is used to represent the target user's operation action on the item.

[0062] In this embodiment, the behavioral feature data may include an operation action at a certain time point and an operation object corresponding to the operation action, wherein the operation object is an item. The time point is the moment when the target user performs the relevant operation on the item.

[0063] Taking the shopping scenario as an example, the items may be various items for selection displayed on a shopping webpage or shopping interface, and the operation actions include but are not limited to clicking, collecting, purchasing, browsing, deleting, and blocking an item.

[0064] During the actual implementation process, the user's operation actions on the item each time they browse the page or interface can be collected to obtain multiple behavioral feature data, and the corresponding time node, such as a timestamp, can be marked for each behavioral feature data.

[0065] According to the recommendation method provided in the embodiment of the present application, a target user behavior feature sequence is constructed by constructing multiple historical operations of the user on multiple items, which can indirectly introduce item features, so that the attention model learns the association relationship between features, item features, corresponding operations and time features, and constructs a target user sequence based on the association relationship. It can pre-learn the correlation between user features and item features, so that the target user sequence constructed based on the correlation is more in line with the current user's behavioral feature habits, thereby improving the accuracy of the obtained target user sequence, which helps to improve the accuracy and personalization of subsequent item recommendations based on the target user sequence.

[0066] Step 120: Input the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into the attention model to obtain the target user sequence output by the attention model;

[0067] In this step, the attention model is an important mechanism in deep learning, especially in natural language processing (NLP), computer vision (CV), and sequence modeling tasks. It enables the model to dynamically focus on different parts of the input data, thereby capturing key information more efficiently.

[0068] The attention model can be pre-trained. The specific training method will be described in the following examples and will not be elaborated here.

[0069] The target user sequence is obtained after learning the association between user characteristics and item characteristics. It can represent the user characteristics and the corresponding item characteristics that the user is interested in recently. Among them, user characteristics may include but are not limited to: gender, age, occupation, place of residence, and consumption status.

[0070] The target user sequence can be used as the output value of the user tower in the dual-tower model.

[0071] like Figure 2 As shown, in some embodiments, step 120 may include:

[0072] Encode and average pool the second sub-target user behavior feature sequence to obtain a second behavior feature sequence;

[0073] Learning the association weights between each sub-behavior feature in the first sub-target user behavior sequence and the interest-related information represented by the second behavior feature sequence;

[0074] Based on the association weight, each sub-behavior feature in the first sub-target user behavior sequence is weighted to obtain a third behavior feature sequence;

[0075] The first sub-target user behavior sequence, the third behavior feature sequence, and the second behavior feature sequence are merged and pooled to obtain a target user sequence.

[0076] In this embodiment, the second behavior feature sequence is a sequence consisting of one or more second behavior features.

[0077] In some embodiments, merging and pooling the first sub-target user behavior sequence, the third behavior feature sequence, and the second behavior feature sequence to obtain the target user sequence may include:

[0078] Performing a dot product process on the first sub-target user behavior sequence and the third behavior feature sequence, and then performing a merge pooling process to obtain the third behavior feature sequence;

[0079] The third behavior feature sequence and the second behavior feature sequence are merged and pooled to obtain a target user sequence.

[0080] In the actual implementation process, the above steps can be implemented by the attention model. By pre-training the attention model, in the subsequent application process, it is only necessary to input the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into the attention model, and the attention model can output the target user sequence.

[0081] Step 130: Obtain target recommended items based on the target user sequence and the candidate item sequence.

[0082] In this step, the candidate item sequence may include item sequences corresponding to multiple candidate items, such as various commodities on a shopping platform, various videos on a video website, various types of properties in a property application, etc.; the target recommended item is a predicted candidate item that the target user may be more interested in.

[0083] In some embodiments, a candidate item sequence may be obtained by performing feature embedding (FeatureEmbedding), deep learning (such as DNN), and embedding (Embedding) on ​​the item features of the candidate objects.

[0084] During the actual implementation process, the attention model described in step 120 can be embedded into the user tower (such as a neural network) of the dual-tower model to improve the user tower of the dual-tower model, so that the user tower can pre-learn the association between user characteristics and item characteristics based on user behavior characteristics, and process the user behavior characteristics according to the learned association to obtain a target user sequence. The target user sequence can be used as the output of the user tower in the dual-tower model, and the candidate item sequence can be used as the output of the item tower in the dual-tower model. The recommendation score is obtained by calculating the similarity between the target user sequence and the candidate item sequence, and the target recommended item is recommended based on the recommendation score.

[0085] By retaining the dual-tower model structure, the high performance of the online infer service can be guaranteed.

[0086] In some embodiments, step 130 may include:

[0087] Calculate the similarity between the target user sequence and the candidate item sequence to obtain the similarity result;

[0088] Based on the similarity results, the target recommended items are determined from the candidate item sequence.

[0089] In this embodiment, the similarity result may be expressed as a similarity score. A higher similarity score indicates that the target user corresponding to the target user sequence has a higher preference for the candidate item corresponding to the similarity score at the current time node.

[0090] In some embodiments, the similarity result may be calculated using a cosine similarity algorithm, such as a product or cosine similarity algorithm.

[0091] In some embodiments, the similarity result may also be calculated by a neural network model.

[0092] After obtaining the similarity scores corresponding to the candidate items, one or more candidate items with the highest similarity scores may be selected as target recommended items to be recommended to the target user corresponding to the target user sequence.

[0093] In the actual implementation process, the dual-tower model can also be used to obtain the target recommended items based on the target user sequence and the candidate item sequence.

[0094] During the research and development process, the inventors discovered that in the related technology, the two towers in the dual-tower model are independent of each other. The user tower is responsible for processing user features, and the item tower is responsible for processing item features. Only in the final output stage of the two towers do they interact in some way (such as dot product or weighted sum) to generate the final recommendation results; this method cannot fully utilize the potential association information between users and items, resulting in low accuracy and personalization of recommendations.

[0095] In this application, before generating a target user sequence, the association between user characteristics and item characteristics is pre-learned based on the target user's behavioral characteristics, and the target user's behavioral characteristics are weighted according to the learned association. This allows for adaptive weight assignment based on the changing interests and preferences of different users, resulting in a target user sequence that highlights the items that the user is currently most interested in, with high flexibility, timeliness, and personalization.

[0096] In addition, the target user behavior feature sequence is divided by the target time node to learn the association between users and items based on the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence. The user's short-term interest vector, namely the target user sequence, is obtained by combining the recent second sub-target user behavior feature sequence with the transformer. On the basis of indirectly introducing item features, adaptive weight assignment can be performed based on the changes in the interest preferences of the same user at different time nodes. The target user sequence that can highlight the items that the user is currently most interested in is obtained, further improving the degree of personalization and having high timeliness.

[0097] Then, item recommendations are made based on the target user sequence and the candidate item sequence. This can fully utilize the potential correlation information between users and items to make item recommendations, so that the recommended items can be adaptively adjusted and matched according to the differences in users and the changes in preferences of the same user in different time periods, significantly improving the accuracy, timeliness and personalization of recommendations, thereby improving the user experience.

[0098] According to the item recommendation method provided in the embodiment of the present application, through the attention model, the correlation between user characteristics and item characteristics is pre-calculated based on the target user behavior characteristics to obtain a target user sequence that can highlight the items that the user is currently more interested in. Then, item recommendations are made based on the target user sequence and the candidate item sequence. This method can fully utilize the potential correlation information between users and items to make item recommendations, has high recommendation accuracy, timeliness and personalization, and helps to improve the user experience.

[0099] The following describes how to train the attention model.

[0100] In some embodiments, the attention model can be trained by the following steps:

[0101] Obtain multiple sample user behavior feature sequences;

[0102] Dividing each sample user behavior feature sequence into at least one historical behavior feature and at least one first behavior feature according to the time sequence;

[0103] The historical behavior features and the first behavior features are input into the attention model to learn the correlation between the historical behavior features and the first behavior features, and the attention model is trained with the goal of outputting the predicted user sequence.

[0104] In this embodiment, the sample user behavior feature sequence may include behavior feature data corresponding to the sample user at multiple time nodes, and each behavior feature data is used to characterize the target user's operation action on the item.

[0105] In the actual implementation process, multiple different sample users may be selected, and one or more sample user behavior feature sequences corresponding to each sample user may be obtained based on historical data of each sample user, thereby obtaining multiple sample user behavior feature sequences.

[0106] The method of dividing the sample user behavior feature sequence is similar to the method of dividing the target user behavior feature sequence, and this application will not elaborate on it here.

[0107] The time node of the historical behavior feature is before the time node of the first behavior feature, and the first behavior feature is used to characterize the behavior characteristics of the sample user in the most recent period of time.

[0108] For each sample user behavior feature sequence, one or more historical behavior features and one or more corresponding first behavior features can be divided. These historical behavior features and first behavior features are input into the attention model. The attention model learns the association between the historical behavior features and first behavior features corresponding to the same sample user, and outputs the predicted user sequence based on the learned association.

[0109] According to the difference between the output predicted user sequence and the sample user behavior feature sequence, the attention model is trained until the set requirements are met, thereby completing the training of the attention model.

[0110] According to the recommendation method provided in the embodiment of the present application, by dividing the sample user behavior feature sequence and learning the association weights between historical behavior features and first behavior features, a predicted user sequence can be obtained that highlights the items that the user is currently more interested in, further improving the accuracy and personalization of the attention model and having high timeliness.

[0111] In some embodiments, the historical behavior features and the first behavior features are input into the attention model to learn the correlation between the historical behavior features and the first behavior features, and output a predicted user sequence as a goal. Training the attention model may include:

[0112] Perform Transformer encoding and average pooling on the first behavior feature to obtain the second behavior feature;

[0113] The attention mechanism module learns the association weights between each historical behavior feature and the interest-related information represented by the second behavior feature;

[0114] The attention model is trained based on the association weight, historical behavior characteristics and second behavior characteristics to obtain the predicted user sequence.

[0115] In this embodiment, average pooling is used to gradually reduce the spatial dimensions of the data (such as the height and width of the image) by calculating the mean of local areas, while retaining important global features, namely the second-behavior features, to improve computational efficiency.

[0116] The attention mechanism module learns the association between each historical behavior feature and the interest-related information represented by the second behavior feature, and obtains the association weight based on the association relationship. The higher the association weight, the higher the user's interest in the item corresponding to the behavior feature corresponding to the association weight.

[0117] According to the recommendation method provided in the embodiment of the present application, by dividing the sample user behavior feature sequence and learning the association weights between historical behavior features and first behavior features, the user's short-term interest vector can be obtained by combining the recent first behavior features with Transformer. On the basis of indirectly introducing item features, adaptive weight assignment can be performed according to the changes in interest preferences of the same user at different time nodes to obtain a predicted user sequence that can highlight the items that the user is currently more interested in, further improving the accuracy and personalization of the attention model, and having high timeliness.

[0118] In some embodiments, training an attention model based on the association weight, the historical behavior feature, and the second behavior feature to obtain a predicted user sequence may include:

[0119] Perform weight assignment processing on the historical behavior characteristics based on the associated weight to obtain the third behavior characteristics;

[0120] Each historical behavior feature, each third behavior feature, and each second behavior feature are merged and pooled to obtain a predicted user sequence.

[0121] In this embodiment, a Sum Pooling process is used to sum all values ​​in a local area and output the summed value.

[0122] Figure 2 An example of the architecture of an attention model is provided, which includes: an attention unit, a first merging pool, a second merging pool, a Transformer encoder, and an average pooling module, wherein the output end of the Transformer encoder is connected to the input end of the average pooling module, and the output end of the average pooling module is respectively connected to the input end of the second merging pool and the input end of the attention unit.

[0123] Attention units are used to calculate the association weight between each historical behavior feature and the user's current interest represented by the second behavior feature.

[0124] The Transformer encoder is a neural network architecture based on the self-attention mechanism, which is used to process sequential data (such as text, time series, etc.); it captures global dependencies by parallel computing the relationships between each element in the input sequence, achieving efficient and accurate information encoding.

[0125] Average pooling is a downsampling operation in convolutional neural networks (CNNs). It gradually reduces the spatial dimensions of the data (such as the height and width of the image) by calculating the mean of local areas while retaining important global features.

[0126] Pooling is used for dimensionality reduction, feature extraction, and enhancing model robustness.

[0127] In some embodiments, the first merging pool and the second merging pool may be sum pooling. Of course, in other embodiments, the first merging pool and the second merging pool may also be maximum pooling or average pooling, etc., which is not limited in this application.

[0128] The training process of the attention model is similar to the application process. The following takes the application process as an example to illustrate the specific implementation of the attention model.

[0129] During the actual execution process, the first sub-goal user behavior sequence is input into the attention unit, and the second sub-goal user behavior sequence is input into the Transformer encoder, which performs encoding processing. By parallel computing the relationship between each element in the input sequence, it captures global dependencies and achieves efficient and accurate information encoding; the encoded sequence is then input into the average pooling module for average pooling to extract important global features. This important global feature is the second behavior feature hs, which can be used to characterize the user's current interest, and the second behavior feature hs is input into the attention unit.

[0130] The attention unit processes the received first sub-target user behavior sequence and global features, calculates the association weight between each sub-sequence in the first sub-target user behavior sequence and the user's current interest represented by the global feature, and assigns weights to each sub-sequence in the first sub-target user behavior sequence according to the association weight, and obtains a weight vector that can represent the interests of all sub-sequences in the first sub-target user behavior sequence and the second sub-target user behavior sequence, that is, the third behavior feature Ahistory, and performs a product operation on the third behavior feature Ahistory and the first sub-target user behavior sequence, and inputs the operation result into the first merging pool for processing.

[0131] The data processed by the first merging pool and the second behavior feature hs are input into the second merging pool for merging and pooling processing, thereby obtaining the target user sequence.

[0132] In some embodiments, the output value of the second merge pool can also be embedded to convert the data object into a numerical vector, so that the target user sequence obtained has low-dimensional, dense and real-valued characteristics, and can capture the important features and internal relationships of the data object.

[0133] Figure 3 This diagram illustrates the structure of an attention unit. The attention unit can include multiple activation units and a normalization (Softmax) layer.

[0134] Among them, the activation unit is used to calculate the attention weights. Through nonlinear transformation and normalization, the input information, such as the global feature hs and the first sub-target user behavior sequence, is mapped into weights representing the importance distribution.

[0135] In the actual execution process, the activation unit can transform the input features through nonlinear activation functions such as Softmax, ReLU, Tanh, etc. to generate unnormalized attention scores.

[0136] The activation units correspond one-to-one to the subsequences X1, ..., Xn-k included in the first sub-target user behavior sequence, and are used to solve the association weights between each subsequence and the global feature hs.

[0137] The attention scores generated by each activation unit are input into the normalization layer for normalization processing, and the weighted sum is used to obtain the weight vector Ahistory that can represent the interest of all subsequences in the first sub-target user behavior sequence and the second sub-target user behavior sequence.

[0138] Normalization processing through the Softmax function can assign higher probabilities to larger inputs and suppress smaller input values, thereby increasing the weights of behaviors that the user is currently interested in (including operation actions and the operation objects corresponding to the operation actions) in the historical behavior feature sequence, so that the final target user sequence is closer to the user's current interest preferences, and can adaptively assign weights according to different users. For the same user, it can also be adaptively adjusted according to the current different time nodes, with high flexibility, timeliness and personalization; then, based on the target user sequence, the items that the user is currently more interested in can be matched, so that the recommended items can be adaptively adjusted and matched according to different users and the changes in the preferences of the same user in different time periods, thereby improving the flexibility, timeliness and personalization of item recommendations.

[0139] It's easy to understand that during training, simply replace the target user behavior feature sequence with the sample user behavior feature sequence, input the historical behavior features into the attention unit, and input the first behavior feature into the Transformer encoder. Training will then allow the attention model to output the predicted user sequence. The specific implementation logic is similar to the application scenario and will not be elaborated here.

[0140] According to the recommendation method provided in the embodiment of the present application, by introducing the attention mechanism module, user features and item features can interact in the early stage of the model, so as to better capture the potential correlation information between users and items, and make full use of the potential correlation information between users and items to recommend items, thereby improving the accuracy and personalization of model recommendations.

[0141] The recommendation method provided in the embodiment of the present application can be executed by a recommendation device. In the embodiment of the present application, the recommendation device provided in the embodiment of the present application is described by taking the recommendation device executing the recommendation method as an example.

[0142] The embodiment of the present application also provides a recommendation device.

[0143] like Figure 4 As shown, the recommendation device includes: a first processing module 410 , a second processing module 420 and a third processing module 430 .

[0144] A first processing module 410 is configured to divide the target user behavior feature sequence into a first sub-target user behavior feature sequence located before the target time node and a second sub-target user behavior feature sequence located after the target time node according to the time sequence;

[0145] The second processing module 420 is used to input the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into the attention model to obtain the target user sequence output by the attention model;

[0146] The third processing module 430 is configured to obtain target recommended items based on the target user sequence and the candidate item sequence.

[0147] According to the recommendation device provided in the embodiment of the present application, through the attention model, the correlation between user characteristics and item characteristics is pre-calculated based on the target user behavior characteristics to obtain a target user sequence that can highlight the items that the user is currently more interested in. Then, item recommendations are made based on the target user sequence and the candidate item sequence. This can fully utilize the potential correlation information between users and items to make item recommendations, has high recommendation accuracy, timeliness and personalization, and helps to improve the user experience.

[0148] In some embodiments, the apparatus may further include a fourth processing module configured to:

[0149] Obtain multiple sample user behavior feature sequences;

[0150] Dividing each sample user behavior feature sequence into at least one historical behavior feature and at least one first behavior feature according to the time sequence;

[0151] The historical behavior features and the first behavior features are input into the attention model to learn the correlation between the historical behavior features and the first behavior features, and the attention model is trained with the goal of outputting the predicted user sequence.

[0152] In some embodiments, the fourth processing module may further be configured to:

[0153] Perform Transformer and average pooling on the first behavior feature to obtain the second behavior feature;

[0154] The attention mechanism module learns the association weights between each historical behavior feature and the interest-related information represented by the second behavior feature;

[0155] The attention model is trained based on the association weight, historical behavior characteristics and second behavior characteristics to obtain the predicted user sequence.

[0156] In some embodiments, the fourth processing module may further be configured to:

[0157] Perform weight assignment processing on the historical behavior characteristics based on the associated weight to obtain the third behavior characteristics;

[0158] Each historical behavior feature, each third behavior feature, and each second behavior feature are merged and pooled to obtain a predicted user sequence.

[0159] In some embodiments, the third processing module 430 may also be used to:

[0160] Calculate the similarity between the target user sequence and the candidate item sequence to obtain the similarity result;

[0161] Based on the similarity results, determine the target recommended items from the candidate item sequence

[0162] The recommendation device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), an ATM or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0163] The recommendation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0164] The recommendation device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0165] In some embodiments, as Figure 5As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, the various processes of the above-mentioned recommended method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0166] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0167] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned recommended method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0168] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0169] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned recommendation method when executed by a processor.

[0170] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0171] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned recommended method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0172] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0173] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0175] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

[0176] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0177] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A recommendation method, characterized in that: include: Dividing the target user behavior feature sequence into a first sub-target user behavior feature sequence located before the target time node and a second sub-target user behavior feature sequence located after the target time node according to the time sequence; Inputting the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into an attention model, and obtaining a target user sequence output by the attention model; Based on the target user sequence and the candidate item sequence, a target recommended item is obtained.

2. The recommendation method according to claim 1, characterized in that The attention model is trained by the following steps: Obtain multiple sample user behavior feature sequences; Dividing each of the sample user behavior feature sequences into at least one historical behavior feature and at least one first behavior feature according to a chronological order; The historical behavior features and the first behavior features are input into the attention model to learn the correlation between the historical behavior features and the first behavior features, and the attention model is trained with the goal of outputting a predicted user sequence.

3. The recommendation method according to claim 2, characterized in that: Inputting the historical behavior feature and the first behavior feature into the attention model to learn the correlation between the historical behavior feature and the first behavior feature and outputting a predicted user sequence as a goal, training the attention model, includes: Performing Transformer encoding and average pooling processing on the first behavior feature to obtain a second behavior feature; Learning the association weights between each of the historical behavior features and the interest-related information represented by the second behavior feature through an attention mechanism module; The attention model is trained based on the association weight, the historical behavior feature, and the second behavior feature to obtain the predicted user sequence.

4. The recommendation method according to claim 3, characterized in that: The step of training the attention model based on the association weight, the historical behavior feature, and the second behavior feature to obtain the predicted user sequence includes: Performing weight assignment processing on the historical behavior feature based on the association weight to obtain a third behavior feature; Each of the historical behavior features, each of the third behavior features, and each of the second behavior features is merged and pooled to obtain the predicted user sequence.

5. The recommendation method according to any one of claims 1 to 4, characterized in that: The target user behavior feature sequence includes behavior feature data corresponding to the target user at multiple time nodes, and each behavior feature data is used to represent the target user's operation action on the item.

6. The recommendation method according to any one of claims 1 to 4, characterized in that: The step of obtaining target recommended items based on the target user sequence and the candidate item sequence includes: Calculating similarity between the target user sequence and the candidate item sequence to obtain a similarity result; Based on the similarity result, the target recommended item is determined from the candidate item sequence.

7. A recommendation device, characterized in that: include: A first processing module is configured to divide the target user behavior feature sequence into a first sub-target user behavior feature sequence located before a target time node and a second sub-target user behavior feature sequence located after the target time node according to a time sequence; A second processing module is configured to input the first sub-target user behavior feature sequence and the second sub-target user behavior feature sequence into an attention model to obtain a target user sequence output by the attention model; The third processing module is configured to obtain target recommended items based on the target user sequence and the candidate item sequence.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the recommendation method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the recommendation method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the recommendation method according to any one of claims 1 to 6 is implemented.