CN110969516B - Commodity recommendation method and device - Google Patents

Commodity recommendation method and device Download PDF

Info

Publication number
CN110969516B
CN110969516B CN201911358070.3A CN201911358070A CN110969516B CN 110969516 B CN110969516 B CN 110969516B CN 201911358070 A CN201911358070 A CN 201911358070A CN 110969516 B CN110969516 B CN 110969516B
Authority
CN
China
Prior art keywords
commodity
training
candidate
user
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911358070.3A
Other languages
Chinese (zh)
Other versions
CN110969516A (en
Inventor
李勇
郑瑜
卢中县
金德鹏
周亮
张良伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Weituo Technology Co ltd
Tsinghua University
Original Assignee
Hangzhou Weituo Technology Co ltd
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Weituo Technology Co ltd, Tsinghua University filed Critical Hangzhou Weituo Technology Co ltd
Priority to CN201911358070.3A priority Critical patent/CN110969516B/en
Publication of CN110969516A publication Critical patent/CN110969516A/en
Application granted granted Critical
Publication of CN110969516B publication Critical patent/CN110969516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24147Distances to closest patterns, e.g. nearest neighbour classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0623Item investigation
    • G06Q30/0625Directed, with specific intent or strategy
    • G06Q30/0629Directed, with specific intent or strategy for generating comparisons

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a commodity recommendation method and device, wherein the method comprises the following steps: inputting the target user into a trained recommendation system to obtain a candidate commodity set; according to the target user characterization vector and the target commodity characterization vector, reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm, and taking a plurality of candidate commodities ranked in front as optimal recommended commodities; and recommending all the best recommended commodities to the user. The embodiment of the invention provides a commodity recommending method and device, which are based on a recommending system constructed by a graph neural network, and a target user characterization vector and a target commodity characterization vector are generated according to the similarity between a target user and each commodity, so that the diversity of candidate commodities is improved, the diversity of optimal recommended commodities is improved, and the commodity with the highest probability is recommended to the user through a commodity recall stage, and the recommending accuracy is improved.

Description

Commodity recommendation method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for recommending commodities.
Background
The recommendation system is an effective algorithm for solving the information overload problem. Through correlation modeling of the user interaction historical data and various features, the recommendation system can screen out commodities meeting the user interests from a large number of candidate commodities.
With the wide deployment of recommendation systems on various internet application products such as e-commerce, online news and multimedia entertainment, the user experience metrics of the recommendation systems are also expanded from single precision indexes to comprehensive evaluation indexes including precision, diversity, novelty, fairness and the like.
The diversity directly influences the perception of the user on the recommendation result, and the insufficient diversity of the recommendation result causes information redundancy of commodities in the recommendation list, so that the efficiency of the recommendation system is reduced.
Therefore, a method for enhancing diversity of the recommendation system is needed.
Disclosure of Invention
In order to solve the above problems, the embodiment of the invention provides a commodity recommendation method and a commodity recommendation device.
In a first aspect, an embodiment of the present invention provides a commodity recommendation method, including:
inputting a target user into a trained recommendation system to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the trained recommendation system comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the trained recommendation system is obtained by training a training sample and a preset label;
according to the target user characterization vector and the target commodity characterization vector, reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm, and taking a plurality of candidate commodities ranked in front as optimal recommended commodities;
And recommending all the best recommended commodities to the user.
Preferably, the trained recommendation system is obtained by:
for any training sample in a training set, the training sample is of a bipartite graph structure, and the bipartite graph comprises user nodes and commodity nodes;
sampling neighboring commodity nodes of the user node according to the interaction times of commodities of different categories, wherein the sampling probability is inversely proportional to the interaction times of the commodities;
and performing countermeasure training on the recommendation system by using the sampled training data to obtain the trained recommendation system.
Preferably, the any training sample is a positive training sample or a negative training sample, the positive training sample comprises any user and interaction records of any user and purchased goods, and the negative training sample comprises interaction records of any user and non-purchased goods.
Preferably, the training data after sampling is used to perform countermeasure training on the recommendation system, and the recommendation system after training is obtained, which specifically includes:
and using the sampled training data, taking two tasks of recommended commodities and commodity categories as training targets, and performing countermeasure training on the recommendation system to obtain the trained recommendation system.
Preferably, the training data after sampling is used, and two tasks of recommending goods and goods category are taken as training targets, so as to perform countermeasure training on the recommendation system, which specifically includes:
inputting the sampled training data into the graphic neural network to obtain training commodity characterization vectors;
Inputting the training commodity characterization vector into a prediction model of the recommendation system to obtain candidate commodities, wherein for the prediction model, a preset label of the training sample is the candidate commodity, and the optimization target of the prediction model is the maximum cross entropy of the candidate commodity class;
and inputting the training commodity characterization vector into a gradient reverse layer of the recommendation system and a classifier of the recommendation system in sequence to obtain the category of the candidate commodity, wherein for the classifier, the preset label of the training sample is the category of the candidate commodity, and the optimization target of the classifier is that the cross entropy of the category of the candidate commodity is minimum.
Preferably, the reordering of each candidate commodity in the candidate commodity set based on the nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector takes a plurality of candidate commodities ranked at the front as the best recommended commodity, and specifically includes:
Acquiring a commodity vector library according to each target commodity characterization vector;
Obtaining a plurality of optimal commodity vectors with the largest inner products with the target user characterization vector from the commodity vector library by utilizing a nearest neighbor search algorithm according to the target user characterization vector as a reference;
And obtaining a plurality of optimal recommended commodities according to the plurality of optimal commodity vectors.
Preferably, the interaction record of any user and purchased goods comprises one or more of purchase, clicking, browsing, collecting and forwarding between any user and purchased goods.
In a second aspect, an embodiment of the present invention provides a commodity recommendation apparatus, including:
The prediction module is used for inputting a target user into the trained recommendation system to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the trained recommendation system comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the trained recommendation system is obtained by training a training sample and a preset label;
The recall module is used for reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector, and taking a plurality of candidate commodities ranked at the front as optimal recommended commodities;
And the recommending module is used for recommending all the optimal recommended commodities to the user.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the program to implement the steps of a commodity recommendation method provided in the first aspect of the present invention.
In a fourth aspect, embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a commodity recommendation method provided in the first aspect of the present invention.
The embodiment of the invention provides a commodity recommending device, which is based on a recommending system constructed by a graphic neural network, generates a target user characterization vector and a target commodity characterization vector according to the similarity between a target user and each commodity, improves the diversity of candidate commodities, filters the candidate commodities in a candidate commodity set by utilizing a nearest neighbor searching algorithm to obtain the optimal recommended commodity, and displays the optimal recommended commodity to the user. The diversity of the candidate commodities is improved, so that the diversity of the optimal recommended commodities is improved, and the commodity with the highest probability is recommended to the user through the commodity recall stage, so that the recommendation accuracy is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a commodity recommendation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of sampling training data according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of target commodity representation vector update in the neural network according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of performing countermeasure training on a recommendation system according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of a commodity recommendation device according to an embodiment of the present invention;
Fig. 6 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a flowchart of a commodity recommendation method according to an embodiment of the present invention, as shown in fig. 1, where the method includes:
S1, inputting a target user into a trained recommendation system to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the trained recommendation system comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the similarity between the target user and each commodity, and the trained recommendation system is obtained by training a training sample and a preset label;
s2, reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector, and taking a plurality of candidate commodities ranked at the front as optimal recommended commodities;
and S3, recommending all the optimal recommended commodities to the user.
Firstly, inputting a target user into a trained recommendation system, and finding out all candidate commodities meeting the interest of the target user from all commodities of a target shopping platform according to the target user by the trained recommendation system.
The recommendation system in the embodiment of the invention is based on a graph neural network, and the graph neural network learns a vectorized representation for a target user and a commodity, namely a target user representation vector and a target commodity representation vector. In the actual recommendation process, a candidate commodity list needs to be generated for the target user, and in the vector characterization space learned by the graphic neural network, the inner product between vectors is used for representing the similarity between the user and the commodity, and the recommendation system needs to recommend the most similar commodity for the user.
Generally, because of the large number of candidate commodities, further screening of candidate commodities in the candidate commodity set is required, and this stage is referred to as a commodity recall stage in the embodiment of the present invention.
The invention adopts nearest neighbor search algorithm in commodity recall process, namely, the target commodity characterization vector learned by the graphic neural network is formed into a search library, and the target user characterization vector learned by the graphic neural network is used as search vector.
And calculating the similarity between each target commodity characterization vector and the target user characterization vector by utilizing a nearest neighbor search algorithm, reordering according to the sequence from high similarity to low similarity, selecting candidate commodities corresponding to the target commodity characterization vectors ranked in the first few bits, taking the candidate commodities as optimal recommended commodities, and recommending the optimal recommended commodities to the target user.
The embodiment of the invention provides a commodity recommending method, which is based on a recommending system constructed by a graphic neural network, and generates a target user characterization vector and a target commodity characterization vector according to the similarity between a target user and each commodity, so that the diversity of candidate commodities is improved, the candidate commodities in a candidate commodity set are filtered by utilizing a nearest neighbor searching algorithm, the optimal recommended commodity is obtained, and the optimal recommended commodity is displayed to the user. The diversity of the candidate commodities is improved, so that the diversity of the optimal recommended commodities is improved, and the commodity with the highest probability is recommended to the user through the commodity recall stage, so that the recommendation accuracy is improved.
On the basis of the above embodiment, preferably, the recommendation system after training is obtained by:
for any training sample in a training set, the training sample is of a bipartite graph structure, and the bipartite graph comprises user nodes and commodity nodes;
sampling neighboring commodity nodes of the user node according to the interaction times of commodities of different categories, wherein the sampling probability is inversely proportional to the interaction times of the commodities;
and performing countermeasure training on the recommendation system by using the sampled training data to obtain the trained recommendation system.
Specifically, when training the recommendation system by using training samples in a training set in the embodiment of the present invention, the training samples are first represented as a structure of two graphs, where the two graphs include user nodes and commodity nodes, and edges between the user and commodity nodes represent interactions between the user and commodity, that is: if interaction exists, the user node and the commodity node are connected by an edge; if no interaction exists, no edge is connected between the user node and the commodity node.
After the user commodity bipartite graph is constructed, the graph neural network learns a vectorized representation for each node, namely each user and commodity are represented as a vector in a high-dimensional space.
Specifically, the distance between the user's vector and his favorite merchandise vector is closer, and the distance between the merchandise vectors that are not of interest to him is further.
In the actual calculation process of the graph neural network, each node updates the node according to the neighbor node, and the neighbor node is the node connected with the node by the edge.
If most of commodities interacted by a user are in a certain category and the others are in a small category, the user node can absorb more characterization in the same category in the process of updating the characterization by the graph neural network,
This allows products closer to the user's characterization to all come from the same category, thus reducing the diversity of best recommended products.
Therefore, in the embodiment of the invention, histogram statistics is performed on commodity nodes connected with user nodes to obtain different categories and the number of times of user interaction, namely, the dominant commodity category and the non-dominant commodity category are found in the number of interactions, wherein the dominant commodity category refers to the commodity with more times of interaction with the user, and the non-dominant commodity category refers to the commodity with less times of interaction with the user.
Fig. 2 is a schematic diagram of sampling training data in the embodiment of the present invention, as shown in fig. 2, block1 is a node reachable by a first layer of the fig. neural network, block2 is a node reachable by a second layer of the fig. neural network, A, B, C is a user node, D, E, F, G is a commodity node, a solid line indicates a sampled edge and a node, and a dotted line indicates an edge and a node that are not sampled. The neighbor nodes of the user nodes are sampled, and the probability of sampling is inversely proportional to the number of commodity category interactions, namely, the commodities with more interaction times are sampled less, and the commodities with less interaction times are sampled more, so that the number of commodities with different categories in the actual data for training the graphic neural network is balanced, and the diversity of recommended commodities is improved.
FIG. 3 is a schematic diagram of updating the target commodity expression vector in the neural network according to the embodiment of the present invention, as shown in FIG. 3, in the drawingsAnd/>For two recommended commodities on a platform, u 0 represents vector representation of a user u node at a 0 th layer of the graphic neural network, u (1) represents vector representation updated by the user u node after passing through the first layer of the graphic neural network, under the arrangement, the probability of sampling the commodity of the dominant class is low, the probability of sampling the commodity of the non-dominant class is high, and therefore, in the updating process, the training user representation vector of the user node cannot be close to the representation vector of the commodity of the dominant class, and further, the commodity with a smaller distance from the user node covers more classes, so that the diversity of recommended commodities is improved.
On the basis of the foregoing embodiment, preferably, the any training sample is a positive training sample or a negative training sample, the positive training sample includes any user and interaction records of any user with purchased goods, and the negative training sample includes interaction records of any user and any user with non-purchased goods.
In the process of training the recommendation system, the interaction record of the user and the commodity is generally adopted as a training sample of the recommendation system, wherein a positive training sample is the interaction record of the user and the purchased commodity, and a negative training sample is the interaction record of the user and the un-purchased commodity, and is obtained by sampling the un-interacted commodity of the user.
The number of positive training samples for one user is very small compared to the total commodity set, so the negative training samples need to be sampled to reduce the number of negative training samples.
The fully random sampling method adopted in general does not consider the category information of the commodities, but in practice, the total number of commodity categories may be large, so that the distribution of the negative training samples on different categories is sparse and random, and the probability of sampling commodities in the same category as the positive training samples in the negative training samples is equal to the probability of sampling commodities in other categories.
If the negative training samples and the positive training samples are different in category according to a completely random sampling mode, the recommendation system learns the preference of the user for the category in the training process, so that more commodities with the same category as the positive training samples are recommended, the recommended candidate commodities are concentrated in the category to which the positive training samples belong, the recommended commodities contain fewer categories, and the diversity is weaker.
According to the embodiment of the invention, the category information of the commodity is introduced in the process of sampling the negative training sample, so that the probability of sampling the commodity in the same category as the positive training sample is improved, more positive training samples and negative training samples in the same category are contained in the training sample, a recommendation system is promoted to learn the user preference of the commodity level with finer granularity, and modeling of the user preference of the category level with coarse granularity is reduced.
Table 1 is a comparison of the negative sampling phase and the completely random negative sampling in the examples of the present invention, as shown in table 1:
TABLE 1
Wherein c represents the total number of commodity categories, alpha is a super parameter in the embodiment of the invention, the range of alpha values is between 0 and 1, the probability of sampling the same category is represented, and the value of alpha is far greater than the probability of selecting the same category by completely random negative sampling.
By improving the probability of sampling the same category, more positive training samples and negative training samples from the same category are generated in the embodiment of the invention, after the recommendation system is trained through the training samples, the trained recommendation system distinguishes the positive training samples and the negative training samples from the same category, and then different categories of commodities meeting the user interests are recommended, and the diversity of recommended commodities is improved.
On the basis of the foregoing embodiment, preferably, the performing, with the sampled training data, the countermeasure training on the recommendation system, and obtaining the trained recommendation system specifically includes:
and using the sampled training data, taking two tasks of recommended commodities and commodity categories as training targets, and performing countermeasure training on the recommendation system to obtain the trained recommendation system.
In the embodiment of the invention, two tasks of the recommended commodity and the commodity category are used as training targets, the recommended commodity is used as a training target, namely, when the recommendation system is trained, the recommended commodity is used as a label, and parameters in the recommendation system are trained according to the predicted difference between the recommended commodity and the actual recommended commodity.
And when the recommendation system is trained by taking the commodity category as a training target, namely taking the recommended commodity category as a label, training parameters in the recommendation system according to the difference between the predicted commodity category and the actual commodity category.
On the basis of the foregoing embodiment, preferably, the training target is two tasks of recommending goods and goods category by using the sampled training data, and the performing the countermeasure training on the recommendation system specifically includes:
inputting the sampled training data into the graphic neural network to obtain training commodity characterization vectors;
Inputting the training commodity characterization vector into a prediction model of the recommendation system to obtain candidate commodities, wherein for the prediction model, a preset label of the training sample is the candidate commodity, and the optimization target of the prediction model is the maximum cross entropy of the candidate commodity class;
and inputting the training commodity characterization vector into a gradient reverse layer of the recommendation system and a classifier of the recommendation system in sequence to obtain the category of the candidate commodity, wherein for the classifier, the preset label of the training sample is the category of the candidate commodity, and the optimization target of the classifier is that the cross entropy of the category of the candidate commodity is minimum.
Fig. 4 is a schematic diagram of performing countermeasure training on a recommendation system in an embodiment of the present invention, where the recommendation system in the embodiment of the present invention includes a graph neural network, a prediction model, a gradient inversion layer, and a classifier, and the prediction model and the gradient inversion layer are respectively connected to the graph neural network, and the classifier is connected to the gradient inversion layer.
When the recommendation system performs training, the embodiment of the invention takes the recommended commodity as a main task and takes the commodity category as an auxiliary task, and the countermeasure training is performed between the main task and the auxiliary task.
The target of the commodity recommending task is to generate probability distribution of recommended commodities according to the target commodity characterization vector obtained by the graphic neural network.
The commodity category task aims at predicting the category of the recommended commodity according to the target commodity characterization vector obtained by the graphic neural network. The task is accomplished by a full connection layer classifier whose output is a class probability distribution for the commodity prediction, optimized using a cross entropy function as a loss function.
Describing from the geometric visual point, the classifier aims at learning the distribution of different types of commodities from the commodity representation space learned by the graphic neural network, particularly the clustering formed by the commodities in the same type, and carrying out type prediction on the commodity representation according to the distribution and the clustering; the objective of the prediction model is to form the characterization vector clusters of similar commodities as far as possible, so that the types of the commodities cannot be distinguished from the commodity characterization.
Under the condition that the countermeasure training is completed, any local space contains enough various commodities, because if the local space only contains few categories, the classifier can use the local space to predict commodity categories, the loss function of the countermeasure training is large, and the commodities in the few categories in the prediction model can be scattered according to a back propagation algorithm used by the model training.
For the classifier, the goal of model optimization is to minimize the loss function of commodity class prediction, i.e., minimize the cross entropy of commodity classification; for predictive models, however, the challenge training is done on this task, i.e., the goal of model optimization is to maximize the cross entropy of commodity classification.
The optimization objective of the classifier is then:
minimize LC
and the optimization targets of the prediction model are as follows:
minimize LR-γLC
Wherein L R is a loss function obtained by main task calculation of the prediction model, and L C is cross entropy of commodity classification.
Note that the sign of L C in the recommender system and classifier is opposite, this opposite direction of optimization comes from the challenge training requirements.
In the actual operation process, a gradient inversion layer is inserted between the graph neural network and the classifier model, in the gradient back transmission process of the back propagation algorithm, the gradient can be changed into the direction opposite to the original gradient through the gradient inversion layer, namely, the model before the inversion layer is optimized by a gradient descent method, and the model after the inversion layer is optimized by a gradient ascent method.
The invention further improves the diversity of recommended commodities by using a countermeasure training mode. Specifically, in the training process of the recommendation system, a mean square error function, a binary cross entropy function or a Bayesian personalized sorting function is generally adopted as a loss function, the model of the recommendation system is optimized, the calculation of the loss function only focuses on modeling of user preference, namely the relative distance between the user and the characterization of the commodity, the diversity of the recommendation system is ignored, and the commodity characterization with a closer user characterization distance only comprises a small number of classes of commodities.
On the basis of the foregoing embodiment, preferably, the reordering, based on a nearest neighbor search algorithm, of each candidate commodity in the candidate commodity set according to the target user characterization vector and the target commodity characterization vector, uses a plurality of candidate commodities ranked first as the best recommended commodity, and specifically includes:
Acquiring a commodity vector library according to each target commodity characterization vector;
Obtaining a plurality of optimal commodity vectors with the largest inner products with the target user characterization vector from the commodity vector library by utilizing a nearest neighbor search algorithm according to the target user characterization vector as a reference;
And obtaining a plurality of optimal recommended commodities according to the plurality of optimal commodity vectors.
Specifically, in the commodity recall stage, the specific process of acquiring the optimal recommended commodity is as follows:
And forming a commodity vector library by using all target commodity characterization vectors generated by the graph neural network, taking the target user characterization vectors as search vectors, acquiring the first K vectors with the largest inner products with the target user characterization vectors from the commodity vector library by utilizing a nearest neighbor search algorithm, and taking the first K vectors as optimal commodity vectors.
And obtaining the optimal recommended commodity according to the optimal commodity vector.
On the basis of the above embodiment, preferably, the interaction record of the any user and the purchased commodity includes one or more of purchase, clicking, browsing, collecting and forwarding between the any user and the purchased commodity.
In particular, the interaction records include, but are not limited to, one or more of purchase, click, browse, collection, and forwarding, and the specific situation can be determined according to the actual situation.
Fig. 5 is a schematic structural diagram of a commodity recommendation device according to an embodiment of the present invention, where, as shown in fig. 5, the device includes: a prediction module 501, a recall module 502, and a recommendation module 503. Wherein:
The prediction module 501 is configured to input a target user into a trained recommendation system, and obtain a candidate commodity set, where the candidate commodity set includes a plurality of candidate commodities, the trained recommendation system includes a neural network, and the neural network is configured to generate a target user characterization vector and a target commodity characterization vector according to the target user, and the trained recommendation system is obtained by training a training sample and a preset label;
the recall module 502 is configured to reorder each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector, and use a plurality of candidate commodities ranked in front as optimal recommended commodities;
the recommending module 503 is configured to recommend all the best recommended products to the user.
Specifically, the prediction module 501 obtains a candidate commodity set according to a target user, the recall module 502 reorders each candidate commodity in the candidate commodity set, and selects a few commodities with the top ranking from the candidate commodity set as the best recommended commodity, and the recommendation module 503 recommends the best recommended commodity to the user.
The embodiment of the device provided by the embodiment of the present invention is for implementing the above embodiments of the method, and specific flow and details refer to the above embodiments of the method, which are not repeated herein.
Fig. 6 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, where, as shown in fig. 6, the electronic device may include: processor 601, communication interface (Communications Interface) 602, memory 603 and bus 604, wherein processor 601, communication interface 602, memory 603 complete communication with each other through bus 604. The communication interface 602 may be used for information transfer of an electronic device. The processor 601 may call logic instructions in the memory 603 to perform a method comprising:
inputting a target user into a trained recommendation system to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the trained recommendation system comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the trained recommendation system is obtained by training a training sample and a preset label;
according to the target user characterization vector and the target commodity characterization vector, reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm, and taking a plurality of candidate commodities ranked in front as optimal recommended commodities;
And recommending all the best recommended commodities to the user.
Further, the logic instructions in the memory 603 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above-described method embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the transmission method provided in the above embodiments, for example, including:
inputting a target user into a trained recommendation system to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the trained recommendation system comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the trained recommendation system is obtained by training a training sample and a preset label;
according to the target user characterization vector and the target commodity characterization vector, reordering each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm, and taking a plurality of candidate commodities ranked in front as optimal recommended commodities;
And recommending all the best recommended commodities to the user.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A commodity recommendation method, comprising:
Inputting a target user into a recommendation system after countermeasure training to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the recommendation system after countermeasure training comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the recommendation system after training is obtained by training a training sample and a preset label;
According to the target user characterization vector and the target commodity characterization vector, calculating the similarity between each target commodity characterization vector and the target user characterization vector based on a nearest neighbor search algorithm, reordering each candidate commodity in the candidate commodity set according to the similarity, and taking a plurality of candidate commodities ranked in front as optimal recommended commodities; the nearest neighbor search algorithm is that target commodity characterization vectors learned by the graphic neural network are formed into a search library, and target user characterization vectors learned by the graphic neural network are used as search vectors;
Recommending all the optimal recommended commodities to a user;
The recommendation system after the countermeasure training is obtained by the following steps:
for any training sample in a training set, the training sample is of a bipartite graph structure, and the bipartite graph comprises user nodes and commodity nodes;
sampling neighboring commodity nodes of the user node according to the interaction times of commodities of different categories, wherein the sampling probability is inversely proportional to the interaction times of the commodities;
Performing countermeasure training on a recommendation system by using the sampled training data to obtain the recommendation system after the countermeasure training;
the recommendation system comprises a graph neural network, a prediction model, a gradient reverse layer and a classifier, wherein the prediction model and the gradient reverse layer are respectively connected behind the graph neural network, and the classifier is connected behind the gradient reverse layer; the classifier output is a class probability distribution predicted for the commodity; the gradient will become the opposite direction to the original gradient through the gradient inversion layer.
2. The merchandise recommendation method according to claim 1, wherein the any training sample is a positive training sample comprising any user and a record of any user's interactions with purchased merchandise or a negative training sample comprising any user and a record of any user's interactions with non-purchased merchandise.
3. The commodity recommendation method according to claim 1, wherein the training data sampled is used to perform an countermeasure training on the recommendation system, and the trained recommendation system is obtained, specifically comprising:
and using the sampled training data, taking two tasks of recommended commodities and commodity categories as training targets, and performing countermeasure training on the recommendation system to obtain the trained recommendation system.
4. The commodity recommending method according to claim 3, wherein said training data sampled is used to target two tasks of recommending commodity and commodity category, and said training system is used for countermeasure training, specifically comprising:
inputting the sampled training data into the graphic neural network to obtain training commodity characterization vectors;
Inputting the training commodity characterization vector into a prediction model of the recommendation system to obtain candidate commodities, wherein for the prediction model, a preset label of the training sample is the candidate commodity, and the optimization target of the prediction model is the maximum cross entropy of the candidate commodity class;
and inputting the training commodity characterization vector into a gradient reverse layer of the recommendation system and a classifier of the recommendation system in sequence to obtain the category of the candidate commodity, wherein for the classifier, the preset label of the training sample is the category of the candidate commodity, and the optimization target of the classifier is that the cross entropy of the category of the candidate commodity is minimum.
5. The commodity recommendation method according to claim 1, wherein the reordering of each candidate commodity in the candidate commodity set based on a nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector takes a plurality of candidate commodities ranked at the front as the best recommended commodity, specifically comprises:
Acquiring a commodity vector library according to each target commodity characterization vector;
Obtaining a plurality of optimal commodity vectors with the largest inner products with the target user characterization vector from the commodity vector library by utilizing a nearest neighbor search algorithm according to the target user characterization vector as a reference;
And obtaining a plurality of optimal recommended commodities according to the plurality of optimal commodity vectors.
6. The merchandise recommendation method according to claim 2, wherein the record of any user interaction with the purchased merchandise comprises one or more of purchase, click, browse, collection, forwarding between the any user and the purchased merchandise.
7. A commodity recommendation device, comprising:
The prediction module is used for inputting a target user into a recommendation system after countermeasure training to obtain a candidate commodity set, wherein the candidate commodity set comprises a plurality of candidate commodities, the recommendation system after countermeasure training comprises a graphic neural network, the graphic neural network is used for generating a target user characterization vector and a target commodity characterization vector according to the target user, and the recommendation system after training is obtained by training a training sample and a preset label;
the recall module is used for calculating the similarity between each target commodity characterization vector and the target commodity characterization vector based on a nearest neighbor search algorithm according to the target user characterization vector and the target commodity characterization vector, reordering each candidate commodity in the candidate commodity set according to the similarity, and taking a plurality of candidate commodities which are ranked at the front as optimal recommended commodities; the nearest neighbor search algorithm is that target commodity characterization vectors learned by the graphic neural network are formed into a search library, and target user characterization vectors learned by the graphic neural network are used as search vectors;
the recommending module is used for recommending all the optimal recommended commodities to the user;
The recommendation system after the countermeasure training is obtained by the following steps:
for any training sample in a training set, the training sample is of a bipartite graph structure, and the bipartite graph comprises user nodes and commodity nodes;
sampling neighboring commodity nodes of the user node according to the interaction times of commodities of different categories, wherein the sampling probability is inversely proportional to the interaction times of the commodities;
Performing countermeasure training on a recommendation system by using the sampled training data to obtain the recommendation system after the countermeasure training;
the recommendation system comprises a graph neural network, a prediction model, a gradient reverse layer and a classifier, wherein the prediction model and the gradient reverse layer are respectively connected behind the graph neural network, and the classifier is connected behind the gradient reverse layer; the classifier output is a class probability distribution predicted for the commodity; the gradient will become the opposite direction to the original gradient through the gradient inversion layer.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the merchandise recommendation method of any one of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the merchandise recommendation method according to any one of claims 1 to 6.
CN201911358070.3A 2019-12-25 2019-12-25 Commodity recommendation method and device Active CN110969516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911358070.3A CN110969516B (en) 2019-12-25 2019-12-25 Commodity recommendation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911358070.3A CN110969516B (en) 2019-12-25 2019-12-25 Commodity recommendation method and device

Publications (2)

Publication Number Publication Date
CN110969516A CN110969516A (en) 2020-04-07
CN110969516B true CN110969516B (en) 2024-04-26

Family

ID=70036457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911358070.3A Active CN110969516B (en) 2019-12-25 2019-12-25 Commodity recommendation method and device

Country Status (1)

Country Link
CN (1) CN110969516B (en)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111429161B (en) * 2020-04-10 2023-10-10 杭州网易再顾科技有限公司 Feature extraction method, feature extraction device, storage medium and electronic equipment
CN111681067B (en) * 2020-04-17 2023-10-31 清华大学 Long-tail commodity recommendation method and system based on graph attention network
CN111695965B (en) * 2020-04-26 2024-04-12 清华大学 Product screening method, system and equipment based on graphic neural network
CN111626821B (en) * 2020-05-26 2024-03-12 山东大学 Product recommendation method and system for realizing customer classification based on integrated feature selection
CN113744009B (en) * 2020-05-29 2024-06-18 北京沃东天骏信息技术有限公司 Target object output method, device, computer readable medium and electronic equipment
CN111708876B (en) * 2020-06-16 2023-07-18 北京百度网讯科技有限公司 Method and device for generating information
CN111723292B (en) * 2020-06-24 2023-07-07 携程计算机技术(上海)有限公司 Recommendation method, system, electronic equipment and storage medium based on graph neural network
CN111784455B (en) * 2020-06-30 2023-11-07 腾讯科技(深圳)有限公司 Article recommendation method and recommendation equipment
CN111767953B (en) * 2020-06-30 2021-11-26 北京字节跳动网络技术有限公司 Method and apparatus for training an article coding model
CN113763081B (en) * 2020-08-26 2024-06-18 北京沃东天骏信息技术有限公司 Article recall method and device
CN112114968A (en) * 2020-09-18 2020-12-22 北京达佳互联信息技术有限公司 Recommendation method and device, electronic equipment and storage medium
CN113744017A (en) * 2020-11-13 2021-12-03 北京沃东天骏信息技术有限公司 E-commerce search recommendation method and device, equipment and storage medium
CN113781147A (en) * 2020-11-17 2021-12-10 北京沃东天骏信息技术有限公司 Item recommendation method and device
CN112561644B (en) * 2020-12-16 2023-08-01 深圳市网联安瑞网络科技有限公司 Commodity recommendation method and device based on link prediction and related equipment
CN112651487B (en) * 2020-12-21 2021-07-27 广东交通职业技术学院 Data recommendation method, system and medium based on graph collapse convolution neural network
CN113159891B (en) * 2021-04-24 2022-05-17 桂林电子科技大学 Commodity recommendation method based on fusion of multiple user representations
CN113139834A (en) * 2021-04-29 2021-07-20 北京沃东天骏信息技术有限公司 Information processing method, device, electronic equipment and storage medium
CN112991026A (en) * 2021-05-08 2021-06-18 明品云(北京)数据科技有限公司 Commodity recommendation method, system, equipment and computer readable storage medium
CN113592529B (en) * 2021-06-22 2023-11-21 中债金科信息技术有限公司 Potential customer recommendation method and device for bond products
CN115631008B (en) * 2021-07-16 2024-02-13 腾讯科技(深圳)有限公司 Commodity recommendation method, device, equipment and medium
CN113609394B (en) * 2021-08-09 2023-09-05 上海交通大学 Information flow-oriented safety recommendation system
CN113689260B (en) * 2021-08-18 2023-08-08 青岛海信智慧生活科技股份有限公司 Commodity searching method and device
CN113869992B (en) * 2021-12-03 2022-03-18 平安科技(深圳)有限公司 Artificial intelligence based product recommendation method and device, electronic equipment and medium
CN114510559B (en) * 2022-01-27 2023-08-29 福建博思软件股份有限公司 Commodity retrieval method based on deep learning semantic implication and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102127A (en) * 2018-08-31 2018-12-28 杭州贝购科技有限公司 Method of Commodity Recommendation and device
CN109299373A (en) * 2018-10-20 2019-02-01 上海交通大学 Recommender system based on figure convolution technique
CN110415091A (en) * 2019-08-06 2019-11-05 重庆仙桃前沿消费行为大数据有限公司 Shop and Method of Commodity Recommendation, device, equipment and readable storage medium storing program for executing
CN110490717A (en) * 2019-09-05 2019-11-22 齐鲁工业大学 Method of Commodity Recommendation and system based on user conversation and figure convolutional neural networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102127A (en) * 2018-08-31 2018-12-28 杭州贝购科技有限公司 Method of Commodity Recommendation and device
CN109299373A (en) * 2018-10-20 2019-02-01 上海交通大学 Recommender system based on figure convolution technique
CN110415091A (en) * 2019-08-06 2019-11-05 重庆仙桃前沿消费行为大数据有限公司 Shop and Method of Commodity Recommendation, device, equipment and readable storage medium storing program for executing
CN110490717A (en) * 2019-09-05 2019-11-22 齐鲁工业大学 Method of Commodity Recommendation and system based on user conversation and figure convolutional neural networks

Also Published As

Publication number Publication date
CN110969516A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN110969516B (en) Commodity recommendation method and device
CN108648049B (en) Sequence recommendation method based on user behavior difference modeling
CN110717098B (en) Meta-path-based context-aware user modeling method and sequence recommendation method
CN113256367B (en) Commodity recommendation method, system, equipment and medium for user behavior history data
CN112950324B (en) Knowledge graph assisted pairwise sorting personalized merchant recommendation method and system
WO2022166115A1 (en) Recommendation system with adaptive thresholds for neighborhood selection
CN105159910A (en) Information recommendation method and device
CN112115377A (en) Graph neural network link prediction recommendation method based on social relationship
CN112395487A (en) Information recommendation method and device, computer-readable storage medium and electronic equipment
CN112396492A (en) Conversation recommendation method based on graph attention network and bidirectional long-short term memory network
Ben-Shimon et al. An ensemble method for top-N recommendations from the SVD
CN110598084A (en) Object sorting method, commodity sorting device and electronic equipment
CN108389113B (en) Collaborative filtering recommendation method and system
CN117391824B (en) Method and device for recommending articles based on large language model and search engine
CN111815410B (en) Commodity recommendation method based on selective neighborhood information
WO2019184480A1 (en) Item recommendation
Pughazendi et al. Graph sample and aggregate attention network optimized with barnacles mating algorithm based sentiment analysis for online product recommendation
CN116383458B (en) Information pushing method and device
CN110851694A (en) Personalized recommendation system based on user memory network and tree structure depth model
CN113450167A (en) Commodity recommendation method and device
CN115880024A (en) Method for recommending lightweight graph convolutional neural network based on pre-training
CN114637920A (en) Object recommendation method and device
KR102600697B1 (en) Interactive customized search method based on constrained Boltzmann machine operation
CN114385804A (en) Comment recommendation method of heterogeneous graph attention neural network based on meta-learning
Aslanyan et al. Utilizing textual reviews in latent factor models for recommender systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant