Project recommendation method and device, electronic equipment and storage medium

By combining the multi-query self-attention mechanism and the transfer-aware embedding distillation mechanism in the item recommendation system to process the collaborative signals and transfer signals of the user's historical interaction sequence, the problem of inaccurate item recommendation results in the existing technology is solved, and more accurate results are achieved User interest analysis and personalized recommendations.

CN118535795AActive Publication Date: 2024-08-23BEIJING LONGZHI DIGITAL TECH CO LTD

Patent Information

Application Number
CN202410609783.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-08-23
Estimated Expiration
2044-05-16

AI Technical Summary

Technical Problem

In the existing technology, the sequential recommendation method based on the self-attention mechanism is difficult to accurately capture the diverse interests of users, resulting in inaccurate item recommendation results.

Method used

The item embedding matrix is ​​generated by obtaining the user's historical interaction sequence, and the multi-query self-attention mechanism and transfer-aware embedding distillation mechanism are used to capture the collaborative signals and transfer signals, and fuse them into the final embedding matrix. Then, the candidate items are obtained through multi-layer perceptron operation. Probability distribution is recommended.

Benefits of technology

It can effectively capture the collaborative signals and transfer signals in the user's historical interaction sequence, improve the performance and efficiency of the item recommendation model, accurately identify the user's diversity and interest changes, and provide comprehensive and accurate item recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535795A
    Figure CN118535795A
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and provides a project recommendation method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a project embedding matrix, wherein the project embedding matrix comprises an embedding vector corresponding to each historical interaction project in a historical interaction sequence of a user; processing the project embedding matrix based on a multi-query self-attention mechanism to capture a collaborative signal in the historical interaction sequence to obtain a collaborative embedding matrix; processing the project embedding matrix based on a transfer perception embedding distillation mechanism to capture a transfer signal in the historical interaction sequence to obtain a target transfer embedding matrix; adding and fusing the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix; and performing multi-layer perceptron operation on the final embedded matrix to obtain recommendation probability distribution of the candidate items, and obtaining an item recommendation result based on the recommendation probability distribution. The problem that the project recommendation result is not accurate enough is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a project recommendation method, device, electronic device and storage medium. Background Art

[0002] A recommendation system is an information filtering system that provides users with appropriate items or services based on their historical behaviors, preferences, needs, and other information, thereby helping users find content of interest in a vast amount of information. Recommendation systems are widely used in e-commerce, social networks, entertainment, education, and other fields, and play an important role in improving user experience, increasing user stickiness, and promoting commercial benefits. The core problem of recommendation systems is how to predict users' ratings or preferences for items, and how to generate appropriate recommendation lists based on these ratings or preferences.

[0003] Nowadays, many technicians apply the sequential recommendation method of self-attention mechanism to sequence recommendation. The self-attention mechanism is a powerful sequence modeling tool that can capture the long-term dependency of a sequence by calculating the correlation between each element in the sequence. However, when users have diverse interests, the sequential recommendation method based on the self-attention mechanism cannot capture accurate interest preferences, resulting in inaccurate item recommendation results. Summary of the invention

[0004] In view of this, the present application provides a project recommendation method, device, electronic device and storage medium to solve the problem that the project recommendation results in the prior art are not accurate enough.

[0005] In a first aspect of the present application, a project recommendation method is provided, comprising: obtaining a project embedding matrix, the project embedding matrix including an embedding vector corresponding to each historical interaction project in a user's historical interaction sequence; processing the project embedding matrix based on a multi-query self-attention mechanism to capture collaborative signals in the historical interaction sequence and obtain a collaborative embedding matrix; processing the project embedding matrix based on a transfer-aware embedding distillation mechanism to capture transfer signals in the historical interaction sequence and obtain a target transfer embedding matrix; adding and fusing the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix; performing a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of candidate projects, and obtaining project recommendation results based on the recommendation probability distribution.

[0006] In a second aspect of the present application, a project recommendation device is provided, comprising: an acquisition module, configured to acquire a project embedding matrix, the project embedding matrix including an embedding vector corresponding to each historical interaction project in the user's historical interaction sequence; a self-attention module, configured to process the project embedding matrix based on a multi-query self-attention mechanism to capture collaborative signals in the historical interaction sequence and obtain a collaborative embedding matrix; a distillation module, configured to process the project embedding matrix based on a transfer-aware embedding distillation mechanism to capture transfer signals in the historical interaction sequence and obtain a target transfer embedding matrix; a fusion module, configured to add and fuse the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix; an output module, configured to perform a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of candidate projects, and obtain a project recommendation result based on the recommendation probability distribution.

[0007] According to a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0008] According to a fourth aspect of the present application, a storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0009] At least one of the above technical solutions adopted in this application can achieve the following beneficial effects:

[0010] The user's historical interaction sequence is obtained through the project recommendation model, and a project embedding matrix is ​​generated based on the historical interaction sequence. The project embedding matrix is ​​processed by the multi-query self-attention mechanism and the transfer-aware embedding distillation mechanism respectively to obtain the collaborative embedding matrix and the target transfer embedding matrix. The multi-query self-attention mechanism can flexibly capture the collaborative signals in the historical interaction sequence and represent the user's diverse preferences. The transfer-aware embedding distillation mechanism can capture the transfer signals in the historical interaction sequence. While accurately identifying the user's interest changes, it can also calibrate the collaborative signals to obtain the user's comprehensive interest representation. The collaborative embedding matrix and the target transfer embedding matrix are further fused to obtain the final embedding matrix. The final embedding matrix can comprehensively represent the user's interests. After that, the final embedding matrix can be operated by a multi-layer perceptron to obtain the user's preference for each candidate item in the current scene and then obtain the project recommendation probability distribution. The candidate items with corresponding probabilities can be selected as the project recommendation results according to the probability distribution. In this way, the sequential recommendation method through multi-query self-attention and transfer-aware embedding distillation can effectively capture the collaborative signals and transfer signals in the user's historical interaction sequence, thereby improving the performance and efficiency of the item recommendation model, and introducing the embedding fusion mechanism when fusing the collaborative embedding matrix and the target transfer embedding matrix can obtain a comprehensive user interest representation, which can not only consider the user's diverse interests, but also consider the user's long-term and short-term interests at the same time, thereby obtaining a comprehensive and accurate user interest analysis to obtain accurate item recommendation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 It is a flowchart of a project recommendation method provided in an embodiment of the present application;

[0013] Figure 2 It is a flowchart of another project recommendation method provided in an embodiment of the present application;

[0014] Figure 3 It is a structural schematic diagram of a project recommendation device provided in an embodiment of the present application;

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

[0016] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0017] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0018] In addition, it should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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, the elements defined by the sentence "includes..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0019] A project recommendation method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0020] Figure 1 is a flowchart of a project recommendation method provided in an embodiment of the present application. Figure 2 As shown, the recommended methods for this project include:

[0021] S101, obtaining an item embedding matrix, where the item embedding matrix includes an embedding vector corresponding to each historical interaction item in the user's historical interaction sequence;

[0022] S102, processing the item embedding matrix based on the multi-query self-attention mechanism to capture the collaborative signals in the historical interaction sequence and obtain the collaborative embedding matrix;

[0023] S103, processing the item embedding matrix based on the transfer-aware embedding distillation mechanism to capture the transfer signals in the historical interaction sequence and obtain the target transfer embedding matrix;

[0024] S104, adding and fusing the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix;

[0025] S105, performing a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of the candidate items, and obtaining a project recommendation result based on the recommendation probability distribution.

[0026] Specifically, in the item recommendation model, an input component can be used to first receive the user's historical interaction sequence, that is, the list of items that the user has historically clicked or purchased, such as [i1,i2,...,i n ]. Then, an item embedding component can be used to embed each item in the historical interaction sequence to obtain the item embedding dimension. Then, the multi-query self-attention component and the transfer-aware embedding distillation component are used to capture the collaborative signal and transfer signal of the historical interaction sequence, respectively, to obtain the collaborative embedding matrix and the target transfer matrix.

[0027] Then, an embedding fusion component can be used to add the collaborative embedding matrix and the target transfer matrix to obtain the final embedding matrix, so that the collaborative signal and the transfer signal are fused to obtain a comprehensive user interest representation. Then, a multi-layer perceptron component is used to perform a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution to represent the user's preference for all candidate items.

[0028] Finally, the output component can select the most likely next candidate item or multiple candidate items according to the recommendation probability distribution and output them as the item recommendation result.

[0029] In this way, the synergy signals and transfer signals in the historical interaction sequences can be extracted, the user's diverse interests and cyclical changes in interests can be analyzed, and the integration of synergy signals and transfer signals for the project recommendation process can improve the accuracy of the project recommendation results. Finally, the recommendation probability distribution and project recommendation results can be obtained to provide personalized recommendations to users. This not only optimizes the performance of the project recommendation model by using multi-query self-attention components, transfer-aware embedding distillation components, and embedding fusion components, but also comprehensively integrates the user's interest representation to obtain accurate project recommendation results.

[0030] In some embodiments, obtaining a project embedding matrix includes: obtaining the number of all projects in the current scene; constructing a first embedding matrix based on the number of all projects and a preset first embedding dimension, the first embedding matrix including embedding vectors of the historical interaction projects and non-interaction projects in the current scene; retrieving a historical interaction sequence in a target database based on a unique identifier of the user, taking each historical interaction project in the historical interaction sequence as a query, obtaining the embedding vector of the historical interaction project from the first embedding matrix, and sorting the embedding vectors of the historical interaction projects based on the historical interaction sequence to obtain a project embedding matrix.

[0031] Specifically, a trainable embedding matrix can be constructed based on all items in the current scene and the preset first embedding dimension, namely the first embedding matrix Where m may represent the number of all items, and d may represent a preset first embedding dimension. The first embedding matrix can then be used to embed each historical interaction item i in the pre-acquired historical interaction sequence. j Mapped to an embedding vector corresponding to a low-dimensional embedding space Then we get the item embedding matrix Where n is the length of the user interaction sequence.

[0032] Among them, the formula for obtaining the item embedding matrix can be expressed as e j =E[i j ],X=[e1,e2,...,e n ] T , T can represent the transposition operation of the matrix, that is, arranging each item embedding vector in the item embedding matrix in columns. The preset first embedding dimension can be determined based on experiments and model performance tuning, and can be selected according to specific tasks and datasets, so no specific restrictions are made here and no detailed expansion is made.

[0033] Furthermore, the item recommendation model can identify the user's unique identifier (such as user ID) based on the user to retrieve the user's historical data stored in the target database or data storage to obtain the historical interaction sequence. It can be understood that once the item recommendation model identifies the user ID, the item recommendation model can query the user's historical interaction sequence. The historical interaction sequence may include the user's interaction behavior with the item, such as clicks, purchases, ratings, etc.

[0034] Furthermore, the corresponding embedding vector can be obtained from the first embedding matrix based on each historical interaction project to obtain the features and semantic information of the historical interaction project, and the obtained embedding vectors can be sorted based on the historical interaction sequence to obtain the project embedding matrix. It should be understood that the sorting of the embedding vectors can be completed based on a sorting algorithm or model, for example, collaborative filtering, deep learning models, etc. can be used to analyze the user's interest in the historical interaction projects and sort them based on timestamps. In this way, the project embedding matrix can be used for subsequent recommendation tasks to generate a personalized recommendation list.

[0035] Of course, the first embedding matrix can also be trained during its construction, that is, the back propagation algorithm and optimizer can be used to adjust the parameters embedded in the first embedding matrix to minimize the loss. In the project recommendation system, the user interaction sequence can provide the real interaction information between the user and the project, but the first embedding matrix E learns only the representation of the project, but does not include the association with the user. Therefore, the interaction information between the user and the project can be combined with the project embedding to generate a project embedding matrix to represent the user's interests and behavior patterns.

[0036] According to the method of the above embodiment, a first embedding matrix is ​​constructed according to the current scenario and a historical interaction sequence is obtained. Each item in the historical interaction sequence can be mapped to a corresponding embedding vector to obtain a project embedding matrix to represent the user's interests and behavior patterns. The project embedding matrix is ​​subjected to subsequent multi-query self-attention and transfer-aware embedding distillation processing of the user to obtain a final embedding matrix that expresses the user's comprehensive interest representation. This can assist the project recommendation model in efficiently and accurately obtaining the recommendation probability distribution of the project, and thus obtaining accurate personalized project recommendation results.

[0037] In some embodiments, the item embedding matrix is ​​processed based on a multi-query self-attention mechanism to capture collaborative signals in historical interaction sequences to obtain a collaborative embedding matrix, including: using the entire item embedding matrix as an attention query to obtain a global interest representation of the user; using a dynamic window size to obtain a partial embedding of the item embedding matrix, and using the partial embedding as an attention query to obtain a local interest representation of the user; fusing the global interest representation and the local interest representation to obtain a mixed interest representation; projecting the mixed interest representation to the original embedding space through a linear transformation matrix to obtain a collaborative embedding matrix, and the original embedding space corresponds to the vector space in the first embedding matrix.

[0038] Specifically, the global interest representation and local interest representation corresponding to the user's historical interaction sequence can be extracted from the item embedding matrix and fused to obtain the mixed interest. Then, a trainable linear transformation matrix can be used to project the mixed interest representation into the original embedding space to obtain the collaborative embedding matrix, which can characterize the user's mixed interest representation. The collaborative trainable linear transformation matrix can be expressed as Where d represents the embedding dimension, which can also be obtained by model training.

[0039] Furthermore, the item embedding matrix can be used as an attention query, that is, the entire user interaction sequence can be used as an attention query to obtain the user's global interest representation. In this way, the embedding representation of each item can be taken into account and the user's interest can be captured by weighting the entire embedding matrix. The formula for capturing the global interest representation can be:

[0040] Q L =X,K L =V L =X, H L =A L V L

[0041] in, They represent the long query (i.e., the item embedding matrix), key, value, attention weight, and output matrix (i.e., global interest representation). The attention weight can represent the user's global interest representation information, which is then mapped to the output matrix for subsequent interest fusion processing.

[0042] Furthermore, a part of the matrix in the item embedding matrix can be obtained through a dynamic window size as an attention short query to obtain a local interest representation. This can be understood as using a trainable window size w as an attention query, that is, dynamically training a window size according to the current historical interaction sequence through the item recommendation model to extract part of the embedding from the item embedding matrix. For example, the embedding matrix corresponding to the last w historical interaction items in the historical interaction sequence can be obtained as an attention query, which can be expressed as Q S =X[-w:] to capture the user's attention to the last historical interaction sequence containing w historical interaction items. The formula for capturing local interest can be expressed as:

[0043] K S =V S =X, H S =A S V S

[0044] in, denote the short query (i.e., partial embedding), key, value, attention weight, and output matrix (i.e., local interest representation), respectively, and X[-w:] denotes the embedding matrix of the last w historical interaction items in the user interaction sequence.

[0045] Furthermore, the long query results and the short query results can be concatenated and fused, that is, the global interest representation and the local interest representation are fused to obtain a hybrid interest representation, and the formula is as follows: H = [H L ,H S ]in, Represents the concatenated output matrix (i.e., mixed interest representation).

[0046] Afterwards, the mixed interest can be projected into the original embedding space using a trainable linear transformation matrix to obtain a collaborative embedding matrix, as follows: Y = HW. It can represent the collaborative embedding matrix. In this way, a collaborative embedding matrix that comprehensively represents user interests can be obtained, and then the probability distribution of candidate items can be obtained by analyzing the collaborative embedding matrix, thereby obtaining accurate item recommendation results.

[0047] According to the method of the above embodiment, the entire user interaction sequence is used as an attention query to obtain a global interest representation, and the user's historical behavior can be weighted by calculating the attention weight to generate a global interest representation including the user's attention level to the entire sequence. A trainable window size is also used as an attention query to obtain the local interest representation in the historical interaction sequence to obtain the user's attention level to a section of the interaction sequence in the historical interaction sequence. After that, the user's mixed interest representation and collaborative embedding matrix are obtained, and the global interest and local interest can be combined to obtain a comprehensive interest feature. In this way, the combination of the user's global interest and local interest can better capture the user's diverse preferences. The user interaction sequence can be flexibly processed through the long and short query self-attention mechanism. At the same time, interest features at different levels are combined through embedding splicing and projection, thereby improving the performance of the item recommendation model.

[0048] In some embodiments, the item embedding matrix is ​​processed based on a transition-aware embedding distillation mechanism to capture transition signals in the historical interaction sequence to obtain a target transition embedding matrix, including: constructing a second embedding matrix based on the number of all items and a preset second embedding dimension; based on the second embedding matrix, mapping each item in the historical interaction sequence to a corresponding transfer embedding vector to obtain an initial transfer embedding matrix; and distilling the transition signals in the initial transfer embedding matrix into the item embedding matrix to obtain a target transfer embedding matrix.

[0049] Specifically, a second embedding matrix can be constructed based on the number of all items in the current scene and the preset second embedding dimension to map each item i in the user's historical interaction sequencej Mapped to the corresponding transfer embedding vector Get the initial transfer embedding matrix

[0050] Among them, the method for obtaining the preset second embedding dimension and the preset first embedding dimension can be consistent, the preset second embedding dimension and the preset first embedding dimension can be different, and the selection is made by tuning the project recommendation model. In the application, the embedding dimension can be selected by methods such as cross-validation, that is, the optimal dimension is selected from a series of possible embedding dimensions, the performance of the possible dimensions on the validation set is evaluated, and finally the embedding dimension with the best performance is selected. Of course, the selection of embedding dimensions can also be guided by combining domain knowledge and experience. In the embodiment of the present application, the selection of the preset first embedding dimension and the preset second embedding dimension can be guided by the data characteristics of all projects and user information in the current scene.

[0051] As an example, in a house selling system, the features of the house and the user can be determined first. The features may include the location, price, area, type of the house, and the user's search history, click history, and collection history. Then, the numerical features and categorical features can be vectorized respectively. For the numerical features, the original value is directly used as part of the vector. For the categorical features, the vector can be converted into a vector by hot encoding. In this way, it is assumed that the processed vector dimensions are: numerical features (assuming that each numerical feature occupies one dimension): 2 dimensions (price, area); categorical features (assuming that each categorical feature occupies one dimension): house type: 3 dimensions (assuming that there are apartments, villas, and townhouses), user search history, click history, collection history: assuming that each historical record has 10 possible values, so the dimension corresponding to each historical record is 10 dimensions. Therefore, the total dimension can be 2+3+10+10+10=35 dimensions, so the embedding dimension in the vector space can be determined. Therefore, the preset first dimension and the preset second dimension can be obtained by analyzing the data features through the model.

[0052] In this way, optimizing the embedded representation according to the current scenario and data characteristics can also improve the performance and effect of the project recommendation model. In the implementation of the project recommendation model, ensuring the selection of appropriate embedding dimensions can improve the accuracy and efficiency of the project recommendation model.

[0053] Furthermore, the transfer signal in the initial transfer embedding matrix can be distilled into the item embedding matrix to obtain the target transfer matrix. The distillation process can use a loss function based on knowledge distillation (KD). By minimizing the loss function, the transfer signal in the initial transfer matrix is ​​distilled into the item embedding matrix, so that the item embedding can simultaneously reflect the user's collaboration and transfer preferences.

[0054] In other embodiments, the transfer signal in the initial transfer embedding matrix is ​​distilled into the item embedding matrix to obtain a target transfer embedding matrix, including: obtaining the user's interest score and transition probability for historical interaction items, and constructing a first loss based on the interest score and the transition probability; constructing a second loss based on the initial embedding matrix and the target embedding matrix; constructing a loss function for knowledge distillation based on the first loss and the second loss, and distilling the transfer signal into the item embedding matrix based on minimization of the loss function to obtain a target transfer embedding matrix.

[0055] Specifically, the loss function of knowledge distillation can be constructed through cross entropy loss and regularization term. The specific formula can be expressed as:

[0056] in, can represent the loss function of knowledge distillation, σ can represent the sigmoid function, μ represents the regularization coefficient, and Zj,i represents the user from item i j The transfer probability to item i, Xj,i represents the user's interest score for item i, and Zj′ represents the transfer embedding vector t j The projection in the item embedding space is the target embedding matrix, Z j represents the initial transfer embedding matrix. It should be noted that the first loss function can be expressed as: The second loss function can be expressed as:

[0057] Furthermore, the Bayesian Personalized Ranking (BPR) loss function can be used to optimize the transition probability of items, that is, to encourage the item recommendation model to predict the user's transition probability from item i to item i. j The probability of transferring to item i is greater than the probability of transferring to other items, so as to obtain the ranking of the transfer probability in the item recommendation system, thereby improving the effect of personalized ranking in the item recommendation model. The user's interest score for the item can represent the user's preference for the item, and the user's interest representation can be mapped to the score space of all items, that is, the user's interest score for the item can be calculated by a multi-layer perceptron.

[0058] It should also be understood that the regularization coefficient can be selected through cross-validation or grid search to control the complexity of the item recommendation model and prevent the model from overfitting.

[0059] In this way, the loss function of knowledge distillation can be calculated based on the obtained parameters, and the transfer signal can be distilled into the item embedding matrix based on the minimization of the loss function, so that the item embedding can simultaneously reflect the user's collaboration and transfer preferences.

[0060] In some embodiments, a multilayer perceptron operation is performed on the final embedding matrix to obtain a recommendation probability distribution of candidate items, including: mapping the final embedding matrix to the original embedding space to obtain a new vector; and performing probability conversion and normalization processing on the new vector through a preset activation function to obtain a recommendation probability distribution.

[0061] Specifically, the recommendation probability distribution can be obtained by the following formula:

[0062]

[0063] in, represents the recommendation probability distribution, U represents the final embedding matrix, W2 and b2 represent trainable parameters that can be trained by the item recommendation model, and m represents the number of candidate items, which can be all items in the current scene.

[0064] It should be noted that the final embedding matrix U can be obtained by the formula: U = Y + Z, where represents the final embedding matrix, represents the co-embedding matrix, Representing the transfer embedding matrix, it can be understood that the fusion of collaborative signals and transfer signals can obtain a comprehensive user interest representation.

[0065] In this way, the user's interest representation can be mapped to the rating space of all items to obtain the user's preference for each item. The rating space of all items can be a higher-dimensional vector space of all items in the current scene to better capture the user's characteristics and preferences.

[0066] It should also be noted that W2 can represent a trainable parameter matrix of size (d×m) to linearly transform the output of the multilayer perceptron. b2 can represent a trainable bias term vector of size m to adjust the bias of each output dimension. Both W2 and b2 can be learned through the training process of the item recommendation model to maximize the model performance.

[0067] Furthermore, the comprehensive user interest representation can be multiplied by the weight matrix W2 for linear transformation, and the bias term b2 can be added to obtain a new vector, which is the representation after the multi-layer perceptron operation. The new vector can then be input into the Sfotmax function, and each element of the new vector can be converted into a non-negative number and normalized to a recommendation probability distribution with a sum of 1.

[0068] According to the method of the above embodiment, the comprehensive user interest representation can be mapped to the rating space of all items through the multi-layer perceptron operation, and the recommendation probability distribution of the user's preference for each item can be obtained through the Softmax function. This can more intuitively reflect the user's preference, and the recommendation probability distribution can be applied to generate the final recommendation list, thereby obtaining accurate item recommendation results.

[0069] In some embodiments, obtaining project recommendation results based on the recommendation probability distribution includes: based on the recommendation probability distribution, selecting candidate projects whose recommendation probabilities are greater than a preset value as project recommendation results; displaying the project recommendation results through a visual interface, and accepting user operations on the project recommendation results.

[0070] Specifically, after obtaining the recommendation probability distribution, candidate items with probabilities greater than a preset value (such as 0.5) can be selected as the final item recommendation results for output, and the output item recommendation results can be displayed on a visual interface. Users can click, refresh, comment, and other operations on the item recommendation results. After receiving these operations, the user's operations can be automatically stored and updated in the historical interaction sequence.

[0071] It should be noted that all items can be output in sequence according to the probability size, and the user can scroll the page to view them. Candidate items with higher probabilities can also be selected as item recommendation results according to the TopN mechanism. There is no restriction here.

[0072] According to the method of the above embodiment, the project recommendation result can be obtained by outputting the result of the recommendation probability distribution, so that the user interest represented by the collaborative signal and the transfer signal in the historical interaction sequence is further analyzed to obtain the recommendation probability distribution, so as to obtain the project recommendation result that can accurately represent the user's preference, thereby improving the quality of the recommendation result while optimizing the user experience.

[0073] Figure 2 This is a flow chart of another project recommendation method provided in the embodiment of the present application. Figure 2 The embodiments of the present application are further described.

[0074] according to Figure 2 It can be seen that the item recommendation model can be composed of multiple modules.

[0075] First, the item embedding module can be used to embed each item in the user's historical interaction sequence to obtain the item embedding matrix.

[0076] Then, the multi-query self-attention module can be used to perform multi-query self-attention operations on the project embedding matrix to obtain a collaborative embedding matrix, dynamically focusing on different parts of the historical interaction sequence in order to better understand the collaborative signals in the historical interaction sequence; at the same time, the transfer-aware embedding distillation module can be used to perform transfer-aware embedding distillation operations on the project embedding matrix, and the transfer signal can be distilled into the project embedding matrix through knowledge distillation to obtain the transfer embedding matrix, which can improve the performance of the project recommendation model.

[0077] Then, the collaborative embedding matrix and the transfer embedding matrix can be added together through the embedding fusion module to obtain the final embedding matrix, which can integrate the interest representations from different sources and obtain a comprehensive user interest representation to improve the accuracy of the item recommendation results.

[0078] Then, the final embedding matrix can be subjected to multi-layer perceptron operation through the multi-layer perceptron module to obtain the recommendation probability distribution.

[0079] Finally, the recommendation result module can select the most likely next item as the item recommendation result according to the recommendation probability distribution and output it to the user, so that the model output can be converted into actual item recommendation results to provide personalized recommendations to users.

[0080] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0081] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0082] Figure 3 Schematic diagram of a project recommendation device provided in an embodiment of the present application. Figure 3 As shown, the recommended equipment for this project includes:

[0083] An acquisition module 301 is configured to acquire an item embedding matrix, where the item embedding matrix includes an embedding vector corresponding to each historical interaction item in the user's historical interaction sequence;

[0084] A self-attention module 302 is configured to process the item embedding matrix based on a multi-query self-attention mechanism to capture collaborative signals in the historical interaction sequence and obtain a collaborative embedding matrix;

[0085] A distillation module 303 is configured to process the item embedding matrix based on a transition-aware embedding distillation mechanism to capture the transition signals in the historical interaction sequence and obtain a target transition embedding matrix;

[0086] A fusion module 304 is configured to add and fuse the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix;

[0087] The output module 305 is configured to perform a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of the candidate items, and obtain an item recommendation result based on the recommendation probability distribution.

[0088] In some embodiments, the acquisition module 301 is specifically used to obtain the number of all items in the current scene; construct a first embedding matrix based on the number of all items and a preset first embedding dimension, the first embedding matrix including embedding vectors of historical interaction items and non-interaction items in the current scene; based on the user's unique identifier, retrieve the historical interaction sequence in the target database, take each historical interaction item in the historical interaction sequence as a query, obtain the embedding vector of the historical interaction item from the first embedding matrix, and sort the embedding vectors of the historical interaction items based on the historical interaction sequence to obtain a project embedding matrix.

[0089] In some embodiments, the self-attention module 302 is specifically used to use the entire project embedding matrix as an attention query to obtain the user's global interest representation; use a dynamic window size to obtain a partial embedding of the project embedding matrix, and use the partial embedding as an attention query to obtain the user's local interest representation; fuse the global interest representation and the local interest representation to obtain a mixed interest representation; project the mixed interest representation into the original embedding space through a linear transformation matrix to obtain a collaborative embedding matrix, and the original embedding space corresponds to the vector space in the first embedding matrix.

[0090] In some embodiments, the distillation module 303 is specifically used to construct a second embedding matrix based on the number of all items and a preset second embedding dimension; based on the second embedding matrix, each item in the historical interaction sequence is mapped to a corresponding transfer embedding vector to obtain an initial transfer embedding matrix; and the transfer signal in the initial transfer embedding matrix is ​​distilled into the item embedding matrix to obtain a target transfer embedding matrix.

[0091] In some embodiments, the distillation module 303 is specifically used to obtain the user's interest score and transition probability for historical interaction items, and construct a first loss based on the interest score and transition probability; construct a second loss based on the initial embedding matrix and the target embedding matrix; construct a loss function for knowledge distillation based on the first loss and the second loss, and distill the transfer signal into the item embedding matrix based on the minimization of the loss function to obtain the target transfer embedding matrix.

[0092] In some embodiments, the output module 305 is specifically used to map the final embedding matrix to the original embedding space to obtain a new vector; and perform probability conversion and normalization processing on the new vector through a preset activation function to obtain a recommendation probability distribution.

[0093] In some embodiments, the output module 305 is specifically used to select candidate projects with recommendation probabilities greater than a preset value as project recommendation results based on the recommendation probability distribution; display the project recommendation results through a visual interface, and accept user operations on the project recommendation results.

[0094] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0095] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0096] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.

[0097] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0098] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0099] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0100] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0101] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A project recommendation method, characterized in that: include: Obtaining an item embedding matrix, wherein the item embedding matrix includes an embedding vector corresponding to each historical interaction item in the user's historical interaction sequence; Processing the item embedding matrix based on a multi-query self-attention mechanism to capture collaborative signals in the historical interaction sequence to obtain a collaborative embedding matrix; Processing the item embedding matrix based on a transition-aware embedding distillation mechanism to capture transition signals in the historical interaction sequence to obtain a target transition embedding matrix; Adding and fusing the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix; A multi-layer perceptron operation is performed on the final embedding matrix to obtain a recommendation probability distribution of candidate items, and an item recommendation result is obtained based on the recommendation probability distribution.

2. The method according to claim 1, characterized in that: The obtaining of the project embedding matrix comprises: Get the number of all items in the current scene; Constructing a first embedding matrix based on the number of all items and a preset first embedding dimension, wherein the first embedding matrix includes embedding vectors of the historical interaction items and non-interaction items in the current scene; Based on the unique identifier of the user, the historical interaction sequence is retrieved in the target database, each of the historical interaction items in the historical interaction sequence is used as a query, the embedding vector of the historical interaction item is obtained from the first embedding matrix, and the embedding vectors of the historical interaction items are sorted based on the historical interaction sequence to obtain the item embedding matrix.

3. The method according to claim 2, characterized in that The multi-query self-attention mechanism is used to process the item embedding matrix to capture the collaborative signal in the historical interaction sequence to obtain the collaborative embedding matrix, including: The entire item embedding matrix is ​​used as an attention query to obtain the user's global interest representation; Obtaining partial embeddings of the item embedding matrix using a dynamic window size, and using the partial embeddings as attention queries to obtain a local interest representation of the user; fusing the global interest representation and the local interest representation to obtain a hybrid interest representation; The hybrid interest representation is projected into an original embedding space through a linear transformation matrix to obtain the collaborative embedding matrix, and the original embedding space corresponds to the vector space in the first embedding matrix.

4. The method according to claim 2, characterized in that: The item embedding matrix is ​​processed based on the transition-aware embedding distillation mechanism to capture the transition signal in the historical interaction sequence to obtain a target transition embedding matrix, including: constructing a second embedding matrix based on the number of all items and a preset second embedding dimension; Based on the second embedding matrix, mapping each item in the historical interaction sequence to a corresponding transfer embedding vector to obtain an initial transfer embedding matrix; The transfer signal in the initial transfer embedding matrix is ​​distilled into the item embedding matrix to obtain the target transfer embedding matrix.

5. The method according to claim 4, characterized in that The step of distilling the transfer signal in the initial transfer embedding matrix into the item embedding matrix to obtain the target transfer embedding matrix comprises: Obtaining the user's interest score and transition probability for the historical interaction item, and constructing a first loss based on the interest score and the transition probability; constructing a second loss based on the initial embedding matrix and the target embedding matrix; A loss function for knowledge distillation is constructed based on the first loss and the second loss, and the transfer signal is distilled into the item embedding matrix based on minimization of the loss function to obtain the target transfer embedding matrix.

6. The method according to claim 3, characterized in that The performing a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of candidate items includes: Mapping the final embedding matrix to the original embedding space to obtain a new vector; The new vector is probability converted and normalized by using a preset activation function to obtain the recommendation probability distribution.

7. The method according to claim 1, characterized in that The obtaining of the project recommendation result based on the recommendation probability distribution includes: Based on the recommendation probability distribution, selecting the candidate item with a recommendation probability greater than a preset value as the item recommendation result; The project recommendation results are displayed through a visual interface, and user operations on the project recommendation results are accepted.

8. A project recommendation device, characterized in that: include: An acquisition module is configured to acquire an item embedding matrix, wherein the item embedding matrix includes an embedding vector corresponding to each item in a historical interaction sequence between a user and the item; A self-attention module is configured to process the item embedding matrix based on a multi-query self-attention mechanism to capture collaborative signals in the historical interaction sequence and obtain a collaborative embedding matrix; a distillation module configured to process the item embedding matrix based on a transition-aware embedding distillation mechanism to capture the transition signal in the historical interaction sequence and obtain a target transition embedding matrix; A fusion module is configured to add and fuse the collaborative embedding matrix and the target transfer embedding matrix to obtain a final embedding matrix; The output module is configured to perform a multi-layer perceptron operation on the final embedding matrix to obtain a recommendation probability distribution of candidate items, and obtain an item recommendation result based on the recommendation probability distribution.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Recommendation method based on self-attention mechanism

    CN113822742A

  • System and method for handling popularity bias in item recommendations

    US20220188899A1

  • Systems and methods for recommendation of items and controlling an associated bias thereof

    US20230169569A1

Cited By

  • Project recommendation method and device, medium and computer equipment

    CN119719486A