Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It is noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and in the foregoing figures, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The invention will be described in detail below with reference to the drawings in connection with embodiments.
It should be noted that, in the technical scheme of the application, the acquisition, storage, use, processing and the like of the data all conform to the relevant regulations of national laws and regulations.
It should be noted that, the user personalized commodity recommendation method and device of the present invention can be used in the financial field, and can also be used in any field other than the financial field, and the application field of the user personalized commodity recommendation method and device of the present invention is not limited.
Note that Embedding in the present invention is an existing concept in the machine learning field, and simply speaking, embedding is to represent an object with a vector of low dimension. That is, long-term interests Embedding, short-term interests Embedding, user features Embedding, and the like in the present invention are low-dimensional vectors.
Fig. 1 is a flowchart of a user-personalized good recommendation method according to an embodiment of the present invention, as shown in fig. 1, and in one embodiment of the present invention, the user-personalized good recommendation method of the present invention includes steps S101 to S103.
Step S101, determining long-term interests Embedding of the user according to the order action sequence of the user.
A user may begin one order before another is not completed, thus first requiring splitting and aggregating the user's actions at the order granularity. The invention screens out all orders in a period of time and then extracts the order action sequence of the user. In one embodiment of the invention, the order action sequence of the user may take the form of Table 1 below.
TABLE 1
Step S102, determining short-term interests Embedding of the user according to the commodity click sequence of the user.
The method sorts the commodities clicked and browsed by the user according to time to obtain a commodity clicking sequence. In one embodiment of the present invention, the user is also able to remove the products that do not exceed the preset time, which may be 20 seconds, for click browsing when the product click sequence is generated.
Step S103, determining a user complex Embedding according to the long-term interests Embedding, the short-term interests Embedding and the user characteristics Embedding of the user, and determining a commodity matching the user according to the user complex Embedding.
The invention carries out personalized commodity recommendation on the user by combining the long-term interests of the user, the short-term interests of the user and the characteristics of the user, and compared with the proposal of recommending only commodities purchased according to history in the prior art, the commodity recommendation accuracy is improved.
As shown in fig. 2, in one embodiment of the present invention, the determining the long-term interest Embedding of the user according to the order action sequence of the user in step S101 specifically includes steps S201 to S203.
Step S201, commodity purchase data are determined according to the order behavior sequence, and a graph model is constructed according to the commodity purchase data, wherein the graph model comprises nodes and directed edges, and the nodes comprise user nodes and commodity nodes.
In one embodiment of the invention, the directed edge is used for representing the purchasing order of the commodities, and the weight value of the directed edge between two commodity nodes is determined by the number of times the two commodity nodes appear in the same order.
Step S202, determining respective nodes Embedding of each commodity node in the graph model by adopting GRAPHSAGE graph neural network algorithm.
Step S203, selecting N commodity nodes from all commodity nodes according to the node Embedding, and generating the long-term interest Embedding according to the nodes Embedding of the N commodity nodes, where N is a positive integer.
In one embodiment of the present invention, the generating the long-term interest Embedding according to the node Embedding of the N commodity nodes in the step S203 specifically includes:
the nodes Embedding of the N commodity nodes are pooled to obtain the long-term interest Embedding.
In one embodiment of the present invention, the user-customized merchandise recommendation method of the present invention further includes the steps of:
And expanding the graph model by using commodity purchase data of similar users in a third party domain by adopting a transfer learning method.
The present invention defines the long-term interest of the user as having occurred purchasing behavior. Because of the cold start, the sequence of user orders we get may be very few, so the long-term interest data for each user may be very sparse. Therefore, by means of the source domain with rich data of the third party, embedding of the third party domain can be taken to the local domain for use according to the similarity of the domains, and the recommendation accuracy of the local domain is improved. The similarity of domains can be seen from the following aspects:
1. user similarity. Two domains have many identical users, e.g., two APPs of the same company have many public users.
2. Commodity similarity. The two domains have many identical items. For example, two APPs have many identical products.
As shown in fig. 7, for those cases where there are overlapping users or items in two domains, embedding representations of the same user or item in different domains may be shared, fused, so that Embedding contains information in each domain. The overlapped users or commodities can be used as bridges to link different fields, so that the data in the graph model is richer, and the commodity recommendation accuracy is improved.
The invention constructs a graph model for each user, wherein the nodes of the graph model are composed of the user and purchased commodities, the user can use the id to uniquely mark the graph model, each commodity can be uniquely identified by goodId + shopId + cateId, if the commodity with special meaning is identified in other modes, for example, the ticket can use the service line+departure place+destination to uniquely mark.
Directed edges in the graph model are generated by user behavior, such as purchasing item A and item B in succession for the user, which creates a directed edge directed from A to B. If there are multiple directed edges with A pointing to B, then the weight of the edge is enhanced.
The invention also needs to define the edge weights of the nodes and the node connection, and the edge weights are defined as follows:
(user, item) edge weights: user_item scoring matrix, the weights of the edges are regularized rating;
Attribute similarity, where two users are the user of the third party domain and the user of the home domain, respectively, we can connect the two domains using the similarity of the users. Note that for each user's graph model, there is only one user (user node) of the graph model, i.e., the current user;
(item) edge weight: attribute similarity.
For some orders, a plurality of commodities may be included, and the commodities may have better collocation, in consideration of this, the method for improving the edge weight of the commodities appearing in the same order specifically includes: the order action sequence contains an item_pair attribute which records the merchandise that appears in the same order. If a certain item1 ever appears in the order with multiple items, then the value form of this column is obtained [ (number of times item1, item2, item1 and item2 appear in the order together), (number of times item1, item5, item1 and item5 appear in the order together) ]. If book1 and inverst _cd were ever co-present in the same two orders, then the values of the attributes item_pair of book1 and inverst _cd contain the same partial content (book 1, inverst _cd, 2). The directed edge weight value of the commodity node is affected by this attribute.
The invention can obtain the edge weight list of each relation:
[(usersource,usertarget,similarity)
(user1,user2,rating)
(item1,item2,similarity)]
the invention uses a graph network to model the relationship of user-item, user-user and item-item, thereby constructing a complete graph model. The component map model may use networkx functions.
[ Input ] the edges of the relationship obtained above weight list user_item weighted edge list;
[ output ] Graph object of Graph model.
After the graph model is built, the present invention determines the respective node Embedding of each commodity node in the graph model by using GRAPHSAGE a graph neural network algorithm in step S202. The calculation flow of the nodes Embedding and GRAPHSAGE of the commodity nodes generated by using the GRAPHSAGE model obtained through training mainly comprises three parts:
(1) And sampling the neighbor nodes, namely sampling the neighbor nodes of each node in the graph model. At "layer 1", node v aggregates the information of two neighbors of "layer 0", and neighbor u of v is also the information of two neighbors of "layer 0". By "layer 2", node v extends to "layer 0" second order neighbor nodes through "layer 1" node u. Thus, in aggregation, K times of aggregation can be extended to K-order neighbors. Each iteration, a node obtains information from neighboring nodes. As the number of iterations increases, the node incrementally obtains more information from farther in the graph. Therefore, K does not have to take a large value, and when k=2, the effect is very good, i.e. only expansion to 2 nd order neighbors is needed.
(2) Aggregation function generation node Embedding aggregates the neighbor node features according to the aggregation function, generating current node Embedding. Since the neighbors of a node in the graph are unordered, the order of the input nodes is changed and the output result of the function should be unchanged. The aggregation function adopted by the method is LSTM aggregator, the neighbor nodes are input into the LSTM after being disordered in sequence, the characteristics of the LSTM decoding neighbors are used, and the LSTM has stronger expression capability compared with simple averaging and Pooling operation.
(3) And outputting the node Embedding generated by using the aggregation function. Calculated Embedding is a Embedding vector containing information about the interaction of the user with the merchandise. For a newly added node a, only the own characteristics and adjacent nodes need to be known to obtain the vector representation of the newly added node a. The vector representation of all other nodes need not be retrained.
In one embodiment of the present invention, the determining, by using the GRAPHSAGE neural network algorithm in step S202, the respective node Embedding of each commodity node in the graph model specifically includes:
when determining the node Embedding of the target commodity node, firstly normalizing the weight of the directed edge of each neighbor commodity node of the target commodity node, and then aggregating the neighbor commodity nodes according to the normalized weight.
In one embodiment of the invention, the invention also optimizes the aggregation of GRAPHSAGE in the migration learning.
GRAPHSAGE is a method of deriving a layer k node representation by aggregating the layer k node itself and the neighbor Embedding. Cross-domain Embedding (cross-domain Embedding) may also be generated therefrom.
However, if only some simple combinations of two domains are made on the coincidence Embedding, such as average-pooling, concat, etc., the importance of the different domains embedding cannot be grasped. Therefore, the invention uses an element-wise attention mechanism to respectively assign different embedding weights to two domains, so that smaller weights can be automatically distributed to less good embedding of a sparse domain, and the result of a source domain is not influenced too much, which is the key point of cross-domain migration.
However GRAPHSAGE cannot process the weighted graph, only the weight aggregation of the neighbor nodes is possible, and the importance difference of different neighbor nodes is not considered. In order to solve the problem of equal weight aggregation optimization, as shown in fig. 8, the weights of the edges may be normalized before aggregation, as compared to directly performing equal weight aggregation on neighbor nodes. Namely, the polymerization mode is as follows:
Becomes normalized aggregation:
And as the neighbor with larger edge weight has larger influence on the target node, the normalized weight is multiplied by the corresponding neighbor node characteristic, and finally the characteristic fusion is carried out. The normalization of the node weights can be completed in the preprocessing nodes, and the algorithm speed is not affected.
As shown in fig. 3, in one embodiment of the present invention, the step S203 of screening N commodity nodes from all commodity nodes according to the node Embedding specifically includes a step S301 and a step S302.
In step S301, the sum of the distances between the node Embedding of each commodity node and the nodes Embedding of all commodity nodes is calculated.
Step S302, N commodity nodes with the smallest sum of distances are selected from all commodity nodes.
All commodities Embedding of the short-term historical behavior of the user are subjected to pooling (pooled) in the traditional recall to form a user Embedding representing the user, and the method can reduce the time space cost by fusing information to a certain extent, but can easily cause information loss, and the pooled Embedding is likely to be worse than hundreds of thousands of miles. The present invention therefore does not average all items Embedding, but instead selects the N items Embedding in the graphical model as representative of all items, the item Embedding being the least sum of distances from all items embedding in the class.
The invention screens out N commodity nodes with the smallest sum of distances from all commodity nodes, and further pools the nodes Embedding of all the N commodity nodes to obtain the long-term interests Embedding of the user. In one embodiment of the present invention, N may be set as desired, for example, 10.
The user behavior sequence used in the invention is modeled as pooling-based architecture paradigm, and is characterized in that the user history behavior is regarded as a disordered set, and the method comprises sum/max pooling, various attention and the like. However, the method of taking Embedding each commodity in the user behavior sequence and then pooling is essentially to treat each commodity clicked by the user as being equally important. In practice, the user's ordered goods contribute differently to the task. For example, predicting the probability that a user clicks on a target commodity, it is apparent that a commodity that has been historically ordered by r will play a more important role in the same category as the target commodity. And a certain behavior of the user is not described by a simple commodity, it is related not only to the behavior itself properties (e.g. time, behavior intention, etc.), but also to the properties and preferences of the user (e.g. age, whether it is a parent or child user).
Therefore, the invention augments Embedding data to obtain short-term interests Embedding and user characteristics Embedding of the user, and adds the categories Embedding to the training of the model.
As shown in fig. 4, in one embodiment of the present invention, the step S102 generates the short-term interest Embedding of the user according to the commodity click sequence, which specifically includes steps S401 to S403.
Step S401, dividing the commodity click sequence into a plurality of subsequences according to a preset time interval.
Step S402, training the user short-term interest commodity Embedding corresponding to each subsequence by using a Skip-gram model.
Step S403, pooling the short-term interest commodities Embedding of the user corresponding to each sub-sequence, to obtain the short-term interest Embedding.
In the above step, we construct long-term interests Embedding based on the user's actual purchase behavior, but the user's purchase is a low frequency behavior, and the information available is not enough. The user clicking is a higher frequency action than the user buying, the user may click a lot of commodities in one day, the clicking sequence is more descriptive of the interest of the user in a short period, because the data is sparse, the data is enough to be expanded for a long time, but the problem is brought that the interest point of the user in a long-time background can change more than a short time, so that the invention adopts the time interval (session) division of the clicking sequence into a plurality of sub-sequences (the sub-sequences are represented by the session in the embodiment of the invention), and the relevance is ensured.
The flow of constructing training data based on click behavior is as follows:
for each user, ordering the clicking actions of the user into a long sequence according to time;
to reduce noise, click behavior with a page dwell time of less than 30 seconds is removed;
in order to make the clicking behaviors in one sequence have stronger correlation, the invention divides the two behaviors with the clicking behaviors time interval of half an hour into two sequences. For each user, thereby generating a plurality of session sequences;
each session may contain the following two commercial products (items):
The user finally generates clicked item of the purchasing behavior;
The user eventually does not have the item that generated the click of the purchase behavior.
The present invention uses the Skip-gram model in Word2vec to train the user short-term interest items Embedding. The Skip-gram model predicts its context words (other words than the center word window) given the center word. To illustrate the subsequent training steps, the Skip-gram model principle is first described here.
Assume that there are 5 words in our text sequence, [ "the", "boy", "loves", "playing", "game" ]. Assuming that our window size Skip-window=2, the center word is "loves", then the context word (also referred to as "background word") is "the", "boy", "play", "game". The context word is also referred to herein as a "background word".
Skip-window can help us to do so by generating the conditional probability of the background word "the", "boy", "play", "game" from it by a distance of no more than 2 by the center word "loves". Assuming that the contexts are independent of each other, the conditional probabilities are formulated as:
P(the|loves)*P(boy|loves)*P(playing|loves)*P(game|loves)
here, a one-to-many scenario is to infer a plurality of words from a word.
Skip-gram first encodes each word in one-hot mode, and each word forms a vector of V1. Each word is then mapped to d-dimensional space according to an index map, typically in such a way that all words are mapped onto the matrix W (matrix shape V x d) such that each word corresponds one-to-one to a certain column in the matrix.
The Skip-gram model is trained by first initializing a matrix of d-dimensional space as a weight matrix W' (the matrix shape is v×d). Each word has the opportunity to become a center word and also a background word for other center words because the window is changing. The vector vi when the matrix W is the center word and the vector ui when the matrix W' is the background word.
Taking out the word vector vc (vector shape is 1*d) of the central word and other words in the weight matrix W' as inner products, and assuming that the index of the background word is o, the calculation result of each word is that
From the last step we have obtained V numbers, and assuming that i represents any word in the dictionary, then the probability of each word isNote that the inputs for the whole process are (center word vector, background word vector), we infer the background word from the center word.
Since the background words are independent, it is assumed that T represents the position of the window center word and m represents the size of the window. Therefore, the probability of deducing the background word from each center word can be calculated, and the vector of the background word is given when the background word is input, and the output probability of the background word only needs to be maximized. After the probability is written into a form of continuous multiplication, the function is transformed to carry out maximized likelihood estimation:
the subscript j represents the subscript of the background word, and j cannot be 0 because one center word infers a plurality of background words. The log is taken in the function, and the maximum value of the likelihood function is the same as the maximum value of the likelihood function after taking the log because of the monotonically increasing property of the log function, but the solution is more convenient.
After obtaining the probability, we can update the parameters and update the vector of the center word by using the gradient descent methodAfter all words in the vocabulary have been trained, we have found that the two word vectors for each word are the vector when vi and ui,vi are the center word, and ui is the vector when the background word, we generally use vi as the final choice.
The Skip-gram model is designed to learn the representation of words in a sentence, whereas in the present scenario a central item has some relevance in a contextual item window, so the present invention trains the user short-term interest items Embedding with Skip-gram.
Through the analysis of the principle, the invention can analogize the click sequence of the commodity into sentences, and the commodity is a word in the sentences. Let S be S click sessions obtained from N users, each session s= (item1,item2,…,itemM) ∈s being a sequence of M products that a user clicks on without interruption. The commodities the user looks at in a short time are similar, and the commodities in the same session can be regarded as a sentence. When the time interval between two continuous clicks of the user exceeds half an hour, a new session is opened. Our training goal is to learn a d-dimensional vector vitemi for each commodity itemi. Using Skip-gram model, the present invention defines the optimization function as:
c is the center commodity in the session, o is the context commodity in the session;
vc denotes embedding for the center commodity attribute, vo denotes embedding for the context commodity, without 'denotes input embedding, with' denotes output embedding;
dpositive is the positive sample set and Dnegative is the negative sample set;
dbuy represents the merchandise purchased within session;
referring to the negative sample set of the same category, in order to reduce the number of items recommended to the user, most of the items of the same category are of the same type, so here the items of the same category are negatively sampled.
The negative samples are used to increase training speed and improve the quality of the resulting commodity vector, and the present invention will randomly select a small fraction of the commodity that is not seen by the user to update the corresponding weights. Negative sampling allows only a small fraction of the weights to be updated for one training sample at a time, thereby reducing the amount of computation during gradient descent.
In order to make the recommendation result more prone to the merchandise purchased by the user, the present invention introduces information of the merchandise actually purchased in the process of generating the merchandise Embedding.
In one embodiment of the present invention, the user-customized merchandise recommendation method of the present invention further includes the steps of:
and amplifying the characteristics of the user by utilizing the GBDT model to obtain the user characteristics Embedding of the user.
In order to prevent the situation that the target user is cold started and the available features are relatively small, the invention can train a GBDT model offline to amplify the user features. The invention utilizes GBDT as a feature extraction tool to discover the distinguished features and feature combinations, thereby reducing the labor cost in the feature engineering.
The principles of GBDT generating features are described first. As shown in fig. 9, assuming GBDT is made up of two trees, GBDT features the middle dashed block. When GBDT is trained to make predictions, the classification probability is not taken as output, but the leaf node position to which the predicted probability value calculated by each tree in the model belongs is recorded as 1, so that new training data is constructed. Let GBDT have two weak classifiers, respectively represented by black and white parts, wherein the number of leaf nodes of the black weak classifier is 3, the number of leaf nodes of the white weak classifier is 2, and the prediction result of 0-1 in the black weak classifier falls onto the second leaf node, and the prediction result of 0-1 in the white weak classifier also falls onto the second leaf node. Then the prediction of the black weak classifier is [ 01 ] and the prediction of the white weak classifier is [ 01 ], collectively the output of GBDT is the combination of these weak classifiers [ 010 01 ]. Then GBDT of the sample is characterized as [ 010 01 ].
Multiple trees may obtain multiple combinations of features with differentiation, and each tree GBDT may learn the deficiencies of the previous trees. For GBDT, the front tree, feature splitting is mainly manifested by a distinguishing feature for most samples, and the rear tree is mainly manifested by a small number of samples with still larger residuals through the front n trees. Preferably, the feature of distinguishing over the whole is selected, and then the feature of distinguishing over a small number of samples is selected.
The invention uses GBDT to amplify user characteristics as follows:
(1) Training GBDT the model by using the original training set to construct a series of decision trees to form a strong classifier. GBDT may generally be implemented using xgboost, or lightgbm.
(2) GBDT is used to predict which leaf node of each tree a sample will fall on in preparation for subsequent discrete feature construction. What we need at this point is not GBDT to predict the result, but rather the specific location of the training data on each tree.
(3) And marking the position of the leaf node to which the sample output belongs as 1 by using new data to carry out one-hot coding, and obtaining a position marking vector W of each sample. The outputs of all samples form a sparse matrix marking the positions of leaf nodes of the output of each decision tree.
(4) The marker vector W is used as new training data for training a subsequent model.
In addition to the new features generated above, the user features Embedding include the user's geographic location, age, gender, etc.
As shown in fig. 5, in one embodiment of the present invention, the step S103 determines the user comprehensive Embedding according to the long-term interests Embedding, the short-term interests Embedding and the user characteristics Embedding of the user, and specifically includes step S501 and step S502.
And step S501, the short-term interests Embedding and the user features Embedding are spliced to obtain a splicing result.
And step S502, performing inner product operation on the spliced result and the long-term interest Embedding to obtain the user synthesis Embedding.
Fig. 6 is an overall flowchart of a commodity recommendation method according to the present invention, as shown in fig. 6, the present invention inputs the user features Embedding and the short-term interests Embedding into the concat layer to perform the concat operation (splicing operation), then sends the splicing result to the upper neural network MLP layer, and performs inner product operation on the splicing result and the long-term interests Embedding to obtain the user integration Embedding. In the invention, when inner product operation is carried out on two sides, cross entropy loss is also utilized for optimization, so that recall results are ensured to be related to short-term interests and user behaviors.
In one embodiment of the present invention, the determining, in step S103, the commodity matching the user according to the user integration Embedding specifically includes:
and calculating the similarity between the user complex Embedding and the commodity Embedding of each commodity, and determining the commodity matched with the user according to the similarity.
As shown in FIG. 6, the invention calculates the similarity between the user Embedding and the commodity Embedding at recall, and finds the commodity that matches the user best by means of vector retrieval based on inner product or Euclidean distance. And the commodity matched with the user is the commodity which is subsequently recommended to the user.
As can be seen from the above embodiments, the personalized commodity recommendation method for users of the present invention has at least the following advantages:
1. when the invention constructs long-term interests Embedding for each user, (1) the Graph Embedding technique is used so that Embedding of each node contains global information of the graph and local similarity information of neighbor nodes. (2) The use of transfer learning augments the user-associated merchandise data and optimizes GRAPHSAGE the aggregate function based on the characteristics of the transfer learning. (3) And the method for selecting Graph Embedding nodes is optimized, so that information loss is reduced.
2. The method is divided into a plurality of sequences according to the time interval of the commodity clicking action of the user, and short-term interest data of the user are amplified on the premise that the interest points of the user are not diffused and disappeared.
3. The invention uses GBDT model to amplify user characteristics as training data of MLP, which is helpful to improve recommendation accuracy.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Based on the same inventive concept, the embodiment of the present invention also provides a user-personalized commodity recommendation device, which can be used to implement the user-personalized commodity recommendation method described in the above embodiment, as described in the following embodiments. Because the principle of the user personalized commodity recommendation device for solving the problem is similar to that of the user personalized commodity recommendation method, the embodiment of the user personalized commodity recommendation device can refer to the embodiment of the user personalized commodity recommendation method, and the repetition is omitted. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 10 is a block diagram illustrating a configuration of a user-customized merchandise recommendation apparatus according to an embodiment of the present invention, and as shown in fig. 10, in one embodiment of the present invention, the user-customized merchandise recommendation apparatus includes:
A long-term interest Embedding construction unit 1 for determining a long-term interest Embedding of the user according to the order action sequence of the user;
a short-term interest Embedding construction unit 2, configured to determine a short-term interest Embedding of the user according to the commodity click sequence of the user;
and the commodity matching unit 3 is used for determining a user complex Embedding according to the long-term interests Embedding, the short-term interests Embedding and user characteristics Embedding of the user, and determining commodities matched with the user according to the user complex Embedding.
In one embodiment of the present invention, the long-term interest Embedding constructs the unit 1, specifically including:
The diagram model construction module is used for determining commodity purchase data according to the order behavior sequence and constructing a diagram model according to the commodity purchase data, wherein the diagram model comprises nodes and directed edges, and the nodes comprise user nodes and commodity nodes;
The node Embedding determining module is used for determining a node Embedding of each commodity node in the graph model by adopting a GRAPHSAGE graph neural network algorithm;
The long-term interest Embedding determining module is configured to screen N commodity nodes from all commodity nodes according to the node Embedding, and generate the long-term interest Embedding according to nodes Embedding of the N commodity nodes, where N is a positive integer.
In one embodiment of the present invention, the long-term interest Embedding determining module is specifically configured to pool the nodes Embedding of the N commodity nodes to obtain the long-term interest Embedding.
In one embodiment of the present invention, the user-personalized commodity recommendation device of the present invention further includes:
And the transfer learning unit is used for expanding the graph model by adopting a transfer learning method and commodity purchase data of similar users in a third party domain.
In one embodiment of the present invention, the node Embedding determines a module, specifically including:
And the normalization weighting aggregation sub-module is used for normalizing the weights of the directed edges of all the neighbor commodity nodes of the target commodity node when determining the node Embedding of the target commodity node, and then aggregating the neighbor commodity nodes according to the normalized weights.
In one embodiment of the present invention, the long-term interest Embedding determining module specifically includes:
the distance calculation sub-module is used for respectively calculating the sum of the distances between the node Embedding of each commodity node and the nodes Embedding of all commodity nodes;
And the node selection sub-module is used for screening N commodity nodes with the smallest sum of distances from all commodity nodes.
In one embodiment of the invention, the directed edge is used for representing the purchasing order of the commodities, and the weight value of the directed edge between two commodity nodes is determined by the number of times the two commodity nodes appear in the same order.
In one embodiment of the present invention, the short-term interest Embedding building unit 2 specifically includes:
the sub-sequence dividing module is used for dividing the commodity clicking sequence into a plurality of sub-sequences according to a preset time interval;
the Skip-gram model training module is used for training the user short-term interest commodity Embedding corresponding to each subsequence by adopting a Skip-gram model;
and a short-term interest Embedding determining module, configured to pool the user short-term interest commodities Embedding corresponding to each of the subsequences, so as to obtain the short-term interest Embedding.
In one embodiment of the present invention, the user-personalized commodity recommendation device of the present invention further includes:
And the user characteristic amplification unit is used for amplifying the characteristics of the user by utilizing the GBDT model to obtain the user characteristics Embedding of the user.
In one embodiment of the present invention, the commodity matching unit 3 specifically includes:
The splicing processing module is used for splicing the short-term interests Embedding and the user features Embedding to obtain a splicing result;
and the inner product operation module is used for performing inner product operation on the spliced result and the long-term interest Embedding to obtain the user synthesis Embedding.
In one embodiment of the present invention, the commodity matching unit 3 specifically includes:
And the similarity calculation module is used for calculating the similarity between the user complex Embedding and the commodity Embedding of each commodity and determining the commodity matched with the user according to the similarity.
To achieve the above object, according to another aspect of the present application, there is also provided a computer apparatus. As shown in fig. 11, the computer device includes a memory, a processor, a communication interface, and a communication bus, where a computer program executable on the processor is stored on the memory, and when the processor executes the computer program, the steps in the method of the above embodiment are implemented.
The processor may be a central processing unit (Central Processing Unit, CPU). The Processor may also be other general purpose processors, digital Signal Processors (DSP), application SPECIFIC INTEGRATED Circuits (ASIC), field-Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above.
The memory is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and units, such as corresponding program units in the above-described method embodiments of the invention. The processor executes the various functional applications of the processor and the processing of the composition data by running non-transitory software programs, instructions and modules stored in the memory, i.e., implementing the methods of the method embodiments described above.
The memory may include a storage program area that may store an operating system, application programs required for at least one function, and a storage data area that may store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more units are stored in the memory, which when executed by the processor, performs the method in the above embodiments.
The details of the computer device may be correspondingly understood by referring to the corresponding relevant descriptions and effects in the above embodiments, and will not be repeated here.
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the above-described user-personalized commodity recommendation method. It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. The storage medium may be a magnetic disk, an optical disc, a Read-Only Memory (ROM), a random access Memory (RandomAccessMemory, RAM), a Flash Memory (Flash Memory), a hard disk (HARD DISK DRIVE, abbreviated as HDD), a Solid state disk (Solid-state disk STATE DRIVE, SSD), or the like, and the storage medium may further include a combination of the above types of memories.
To achieve the above object, according to another aspect of the present application, there is also provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the user-personalized good recommendation method described above.
It will be apparent to those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.