Item recommendation method and device
Through the knowledge graph and graph neural network algorithm, scalable populations are determined for the differences in seed users, which solves the problem of low accuracy in item recommendation in the existing technology, realizes more efficient user-item related utilization, and improves the recommendation experience .
Patent Information
- Application Number
- CN202110260190.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-10
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-03-10
AI Technical Summary
The prior art, when there are few or no seed users, relying on manual rules to construct positive and negative samples leads to noise problems, resulting in reduced accuracy of item recommendations and insufficient utilization of the association relationship between the item and the user.
Using knowledge graph and graph neural network algorithms, determine whether there is a seed user based on business scenario data, and obtain similar users if it exists; if it does not exist, obtain similar items of the items to be recommended, and determine the scalable user from its neighbor users to perform Item recommendation.
It improves the accuracy of item recommendations, solves the noise problem, makes full use of the relationship between users, items and addresses, and improves the experience of merchants and users.
Smart Images

Figure CN112950321B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an item recommendation method and device. Background Art
[0002] With the continuous development of online shopping platforms, item recommendation systems have become an important part of e-commerce. In the process of item recommendation, users who are interested in an item are called seed users. The population is expanded through seed users to obtain expandable users, and the item is recommended to expandable users. Existing technologies can use discriminant models and graph label propagation methods to expand the population.
[0003] However, the discriminant model and graph label propagation method are only applicable to the case of seed users. When there are few or no seed users, it is necessary to rely on manual rules to construct positive and negative samples, which will cause noise problems, lead to insufficient or inaccurate expansion of the population, reduce the accuracy of item recommendations, and bring a bad experience to merchants and users. In addition, the existing technology does not fully utilize the rich associations between items and users. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides an item recommendation method and device, which can use different methods to determine expandable populations for business scenarios with seed users and business scenarios without seed users, thereby improving the accuracy of item recommendations and providing a better experience for merchants and users.
[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for recommending an item is provided.
[0006] An item recommendation method according to an embodiment of the present invention includes: obtaining business scenario data, wherein the business scenario data includes items to be recommended; determining whether the business scenario data includes seed users, wherein the seed users are users who have operated the items to be recommended; if so, obtaining similar users corresponding to the seed users based on a knowledge graph and a graph neural network algorithm, and determining that the similar users are expandable users; if not, obtaining similar items corresponding to the items to be recommended based on the knowledge graph, and determining that neighbor users corresponding to the similar items are expandable users; and recommending the items to be recommended to the expandable users.
[0007] Optionally, obtaining similar users corresponding to the seed user based on the knowledge graph and graph neural network algorithm includes: based on the user relationship graph corresponding to the knowledge graph, taking the seed user as a positive sample and the non-seed user as a negative sample, and combining the user's portrait data, using the graph neural network algorithm to perform model training to obtain the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; calculating the similarity value between the seed user and the non-seed user according to the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; selecting similar users corresponding to the seed user from the non-seed users according to the calculated similarity value between the seed user and the non-seed user; wherein the non-seed user is a user other than the seed user in the user relationship graph, and the number of the non-seed users is one or more.
[0008] Optionally, obtaining similar items corresponding to the item to be recommended based on the knowledge graph, and determining that the neighbor users corresponding to the similar items are expandable users, includes: judging whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph; if so, obtaining the similar items based on the user-item relationship graph and a graph neural network algorithm; if not, obtaining the similar items based on the user-item relationship graph and according to specific attribute tags of the item to be recommended; obtaining the neighbor users corresponding to the similar items from the user-item relationship graph, and determining that the neighbor users are the expandable users.
[0009] Optionally, obtaining the similar items based on the user-item relationship graph and the graph neural network algorithm includes: based on the user-item relationship graph, and in combination with the user's portrait data and the item's attribute data, performing model training using the graph neural network algorithm to obtain feature vectors corresponding to the item to be recommended and feature vectors corresponding to other items; calculating a similarity value between the item to be recommended and the other items based on the feature vectors corresponding to the item to be recommended and the feature vectors corresponding to the other items; selecting similar items corresponding to the item to be recommended from the other items based on the calculated similarity value between the item to be recommended and the other items; wherein the other items are items other than the item to be recommended in the user-item relationship graph, and the number of the other items is one or more.
[0010] Optionally, obtaining the similar items based on the user-item relationship graph and according to specific attribute tags of the items to be recommended includes: selecting items with the specific attribute tags from the user-item relationship graph according to attribute data of the items, and determining that the selected items are the similar items.
[0011] Optionally, the knowledge graph is constructed according to the following process: obtaining user historical behavior data; obtaining the relationship between users and items based on the user historical behavior data; obtaining the relationship between users and addresses, and the relationship between items and addresses based on user order data in the user historical behavior data; and constructing a knowledge graph with users, items, and addresses as nodes based on the relationship between users and items, the relationship between users and addresses, and the relationship between items and addresses.
[0012] Optionally, after constructing a knowledge graph with users, items and addresses as nodes, the method further includes: adding user portrait data to the knowledge graph, and adding item attribute data to the knowledge graph.
[0013] Optionally, the user relationship graph is generated according to the following process: obtain all users in the knowledge graph; for each user among all the users, obtain users who have common neighbors with the user from the knowledge graph, and then calculate the similarity value between the user and the obtained user to obtain the similarity value between all the users; generate the user relationship graph based on the similarity value between all the users.
[0014] Optionally, the calculating of the similarity value between the user and the acquired user includes: determining common neighbors corresponding to the user and the acquired user; counting the number of nodes corresponding to the common neighbors based on the knowledge graph; calculating the similarity value between the user and the acquired user based on the relationship between the user and the common neighbors, the relationship between the acquired user and the common neighbors, and the number of nodes corresponding to the common neighbors, and in combination with set weights.
[0015] Optionally, the user-item relationship graph is generated according to the following process: based on the knowledge graph, obtaining the relationship between the user and the item; based on the relationship between the user and the item, combined with the set weights, calculating the association value between the user and the item; based on the association value between the user and the item, generating the user-item relationship graph.
[0016] Optionally, the graph neural network algorithm is a GraphSAGE algorithm.
[0017] To achieve the above objective, according to another aspect of an embodiment of the present invention, an item recommendation device is provided.
[0018] An item recommendation device according to an embodiment of the present invention includes: an acquisition module, used to acquire business scenario data, wherein the business scenario data includes items to be recommended; a judgment module, used to judge whether the business scenario data includes seed users, wherein the seed users are users who have operated the items to be recommended; a first determination module, used to, if so, acquire similar users corresponding to the seed users based on a knowledge graph and a graph neural network algorithm, and determine that the similar users are expandable users; a second determination module, used to, if not, acquire similar items corresponding to the items to be recommended based on the knowledge graph, and determine that neighbor users corresponding to the similar items are expandable users; and a recommendation module, used to recommend the items to be recommended to the expandable users.
[0019] Optionally, the first determination module is also used to: based on the user relationship graph corresponding to the knowledge graph, take the seed user as a positive sample and the non-seed user as a negative sample, and combine the user's portrait data, use the graph neural network algorithm to perform model training to obtain the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; calculate the similarity value between the seed user and the non-seed user according to the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; select a similar user corresponding to the seed user from the non-seed users according to the calculated similarity value between the seed user and the non-seed user; wherein the non-seed user is a user other than the seed user in the user relationship graph, and the number of the non-seed users is one or more.
[0020] Optionally, the second determination module is also used to: determine whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph; if so, obtain the similar item based on the user-item relationship graph and the graph neural network algorithm; if not, obtain the similar item based on the user-item relationship graph and according to the specific attribute tags of the item to be recommended; obtain the neighbor users corresponding to the similar items from the user-item relationship graph, and determine that the neighbor users are the expandable users.
[0021] Optionally, the second determination module is also used to: perform model training using a graph neural network algorithm based on the user-item relationship graph and in combination with the user's portrait data and the item's attribute data to obtain feature vectors corresponding to the item to be recommended and feature vectors corresponding to other items; calculate a similarity value between the item to be recommended and the other items based on the feature vectors corresponding to the item to be recommended and the feature vectors corresponding to the other items; select similar items corresponding to the item to be recommended from the other items based on the calculated similarity value between the item to be recommended and the other items; wherein the other items are items other than the item to be recommended in the user-item relationship graph, and the number of the other items is one or more.
[0022] Optionally, the second determination module is further used to: select an item with the specific attribute label from the user-item relationship graph according to the attribute data of the item, and determine that the selected item is the similar item.
[0023] Optionally, the device also includes a graph construction module, which is used to: obtain user historical behavior data; obtain the relationship between users and items based on the user historical behavior data; obtain the relationship between users and addresses, and the relationship between items and addresses based on user order data in the user historical behavior data; and construct a knowledge graph with users, items, and addresses as nodes based on the relationship between users and items, the relationship between users and addresses, and the relationship between items and addresses.
[0024] Optionally, the graph construction module is also used to: add user portrait data to the knowledge graph, and add item attribute data to the knowledge graph.
[0025] Optionally, the graph construction module is also used to: obtain all users in the knowledge graph; for each user among all the users, obtain users who have common neighbors with the user from the knowledge graph, and then calculate the similarity value between the user and the obtained user to obtain the similarity value between all the users; generate the user relationship graph based on the similarity value between all the users.
[0026] Optionally, the graph construction module is also used to: determine the common neighbors corresponding to the user and the acquired user; count the number of nodes corresponding to the common neighbors based on the knowledge graph; calculate the similarity value between the user and the acquired user based on the relationship between the user and the common neighbors, the relationship between the acquired user and the common neighbors, and the number of nodes corresponding to the common neighbors, and in combination with the set weights.
[0027] Optionally, the graph construction module is also used to: obtain the relationship between the user and the item based on the knowledge graph; calculate the association value between the user and the item based on the relationship between the user and the item in combination with the set weights; and generate the user-item relationship graph based on the association value between the user and the item.
[0028] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0029] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the item recommendation method according to the embodiment of the present invention.
[0030] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0031] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the item recommendation method according to the embodiment of the present invention is implemented.
[0032] An embodiment of the above invention has the following advantages or beneficial effects: for business scenarios with seed users and business scenarios without seed users, different methods can be used to determine the expandable population, and then recommend the items to be recommended to the expandable population, which solves the noise problem caused by relying on artificial rules to construct positive and negative samples in the prior art when there are few or no seed users, and can obtain an expanded population that meets the needs, improve the accuracy of item recommendations, and provide a better experience for merchants and users. In addition, in the process of determining expandable users, a knowledge graph with users, items and addresses as nodes is used, which solves the problem that the prior art does not fully utilize the rich associations between items and users, and fully utilizes the interactive relationship between items and users, user portrait data and item attribute data. And, for business scenarios with seed users, the knowledge graph and graph neural network algorithm are combined to further improve the accuracy of item recommendations. In addition, for business scenarios without seed users, a multi-hop query method is adopted, first using the knowledge graph to obtain similar items corresponding to the items to be recommended, and then determining the neighbor users corresponding to the similar items as expandable users.
[0033] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0035] Figure 1is a schematic diagram of main steps of an item recommendation method according to an embodiment of the present invention;
[0036] Figure 2 is a schematic diagram of a process of constructing a knowledge graph according to an embodiment of the present invention;
[0037] Figure 3 is a schematic diagram of the structure of a knowledge graph according to an embodiment of the present invention;
[0038] Figure 4 It is a schematic diagram of the main process of obtaining similar users corresponding to a seed user based on a knowledge graph and a graph neural network algorithm according to an embodiment of the present invention;
[0039] Figure 5 is a schematic diagram of the structure of a user relationship graph generated according to an embodiment of the present invention;
[0040] Figure 6 is a schematic diagram of a main process of determining expandable users through items to be recommended according to an embodiment of the present invention;
[0041] Figure 7 is a schematic diagram of the structure of a user-item relationship graph generated according to an embodiment of the present invention;
[0042] Figure 8 is a schematic diagram of the main process of the method for item recommendation according to an embodiment of the present invention;
[0043] Fig. 9 is a schematic diagram of main modules of an item recommendation device according to an embodiment of the present invention;
[0044] Fig.10 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0045] Fig.11 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0047] Figure 1 Schematic diagram of main steps of the item recommendation method according to an embodiment of the present invention.
[0048] like Figure 1As shown, the main steps of the item recommendation method may include:
[0049] Step S101, obtaining business scenario data;
[0050] Step S102, determining whether the business scenario data contains a seed user, if so, executing step S103, if not, executing step S104;
[0051] Step S103, based on the knowledge graph and graph neural network algorithm, obtain similar users corresponding to the seed user, and determine that the similar users are expandable users;
[0052] Step S104, based on the knowledge graph, obtaining similar items corresponding to the item to be recommended, and determining neighbor users corresponding to the similar items as expandable users;
[0053] Step S105: recommend the items to be recommended to expandable users.
[0054] Among them, business scenario refers to the scenario for item recommendation. Business scenario data can be understood as data related to item recommendation obtained when planning to recommend items. The business scenario data contains items to be recommended, that is, through the business scenario data, the items to be recommended can be determined. In addition, business scenario data can be data provided by merchants who want to recommend items. For example, a merchant A on an e-commerce platform plans to promote item P1, then the business scenario data can be item P1 provided by merchant A, or it can be users who have recently purchased item P1 provided by merchant A.
[0055] Business scenarios may include scenarios with seed users and scenarios without seed users. The scenario with seed users means that the business scenario data contains seed users. Among them, seed users are users who have operated on the items to be recommended, such as users who have purchased the items to be recommended, users who have collected the items to be recommended, or users who have paid attention to the items to be recommended. For example, if the business scenario data is provided by merchant A and includes users who have purchased item P1 within the past week, then it can be considered that the business scenario data contains seed users, and the seed users are users who have purchased item P1 within the past week. The scenario without seed users means that the business scenario data does not contain seed users. For example, if the business scenario data is a set of items that need to be recommended provided by merchant A, then the business scenario data does not contain seed users.
[0056] The item recommendation method provided in the embodiment of the present invention can obtain scalable users in different ways for different business scenarios, and then recommend items to be recommended to scalable users. Therefore, after the business scenario data is obtained in step S101, step S102 is used to determine whether the business scenario data contains seed users.
[0057] If the business scenario data contains seed users, then similar users corresponding to the seed users, that is, users similar to the seed users, can be obtained based on the knowledge graph and graph neural network algorithm, and then the obtained similar users can be determined to be expandable users. If the business scenario data does not contain seed users, then similar items corresponding to the recommended items, that is, items similar to the recommended items, can be obtained based on the knowledge graph, and then the knowledge graph can be used to query the neighbor users corresponding to the similar items, and the queried neighbor users can be determined to be expandable users. Among them, the knowledge graph can be understood as a semantic network that reveals the relationship between entities. In an embodiment of the present invention, the knowledge graph refers to a relationship graph with users, items and addresses as nodes obtained by analyzing the user's historical behavior data, that is, the entities in the knowledge graph are users, items and addresses, and the relationship between users, items and addresses can be obtained through the knowledge graph.
[0058] It should be noted that after obtaining the expandable users, the number of expandable users can be verified to determine whether the number of expandable users obtained meets the demand. For example, Merchant A stipulates that item P1 needs to be recommended to at least 100 users, but the number of expanded users obtained is 50. Then, for scenarios with seed users, similar users corresponding to the seed users can be obtained again; for scenarios without seed users, similar items corresponding to the items to be recommended can be obtained again. Finally, after determining the expandable users, the items to be recommended can be recommended to the expandable users.
[0059] According to the method for recommending items in the embodiment of the present invention, for business scenarios with seed users and business scenarios without seed users, different methods can be used to determine the expandable population, and then recommend the items to be recommended to the expandable population, which solves the noise problem caused by the prior art relying on artificial rules to construct positive and negative samples when there are few or no seed users, and can obtain an expanded population that meets the needs, improve the accuracy of item recommendations, and provide a better experience for merchants and users. In addition, in the process of determining expandable users, a knowledge graph with users, items and addresses as nodes is used, which solves the problem that the prior art does not fully utilize the rich associations between items and users, and fully utilizes the interactive relationship between items and users, user portrait data and item attribute data. In addition, for business scenarios with seed users, the knowledge graph and graph neural network algorithm are combined to further improve the accuracy of item recommendations. In addition, for business scenarios without seed users, a multi-hop query method is adopted, first using the knowledge graph to obtain similar items corresponding to the items to be recommended, and then determining the neighbor users corresponding to the similar items as expandable users.
[0060] From the above, we know that for both scenarios with seed users and scenarios without seed users, it is necessary to determine expandable users based on the knowledge graph. Therefore, the knowledge graph plays an important role in the item recommendation method of the embodiment of the present invention. Figure 2 FIG. 1 is a schematic diagram of the construction process of the knowledge graph according to an embodiment of the present invention. Figure 2 As shown, the knowledge graph construction process may include steps S201 to S204.
[0061] Step S201: Obtain user historical behavior data.
[0062] The user historical behavior data may be the user behavior data on the e-commerce platform within a period of time, such as the user behavior data on the e-commerce platform in the past three months. The user historical behavior data may include: user order data, data on user clicked items, data on user favorited items, data on user followed items, data on user added items, data on user searched items, and other data related to user operation behaviors. The user order data may refer to the number of times the user purchased an item, the user clicked item data may refer to the number of times the user clicked on an item, and the user added item data may refer to the number of times the user added an item to the shopping cart.
[0063] Step S202: Obtain the relationship between the user and the item based on the user's historical behavior data. That is, the relationship between the user and the item can be obtained through the user's historical behavior data, such as user B1 purchased item P1, and user B2 clicked on items P2 and P4.
[0064] Step S203: According to the user order data in the user historical behavior data, the relationship between the user and the address, and the relationship between the item and the address are obtained. The user order data includes address data. For example, if user B1 purchases item P1, the delivery address of item P1 is C1. Therefore, the relationship between the user and the address, and the relationship between the item and the address can be obtained through the user order data.
[0065] Step S204: Based on the relationship between the user and the item, the relationship between the user and the address, and the relationship between the item and the address, a knowledge graph with users, items, and addresses as nodes is constructed.
[0066] In an embodiment of the present invention, the nodes of the knowledge graph include users, items, and addresses. If it is obtained through the user's historical behavior data that a certain user has an interactive relationship with a certain item, such as the user has purchased the item, then an edge corresponding to the relationship type will be established between the user and the item, that is, in the knowledge graph, the user is connected to the item, and the relationship between the user and the item is marked. Similarly, if a certain item has a relationship with a certain address, then in the knowledge graph, the user is connected to the item, and the relationship between the item and the address is marked. Similarly, if a certain user has a relationship with a certain address, then in the knowledge graph, the user is connected to the address, and the relationship between the user and the address is indicated.
[0067] Figure 3 is a schematic diagram of the structure of the knowledge graph according to an embodiment of the present invention. Figure 3 , we can get the relationship between users B1, B2, B3 and B4, items P1, P2, P3, P4 and P5, and addresses C1 and C2. The specific relationship is that user B1 purchased item P1, and the delivery address is C1, and user B1 collected item P2; user B2 clicked on items P2 and P4, user B2 purchased item P5, and the delivery address is C1; user B3 purchased item P1, and the delivery address is C2, and user B3 followed item P3; user B4 added item P3 to the shopping cart and searched for item P5.
[0068] In addition, after constructing a knowledge graph with users, items, and addresses as nodes, the user's portrait data can also be added to the knowledge graph, and the item's attribute data can also be added to the knowledge graph. In the user tag, the user's portrait data, such as the user's age, occupation, gender, etc., are supplemented. In the item tag, the item's attribute data, such as the item's brand, category, volume, etc., are supplemented. In an embodiment of the present invention, the user's portrait data and the item's attribute data are added to the knowledge graph, so that user information and item information can be intuitively obtained from the knowledge graph, improving the user experience.
[0069] Next, the process of determining scalable users based on the knowledge graph is described in detail for scenarios with seed users and scenarios without seed users.
[0070] (I) Scenario with seed users
[0071] Figure 4 Schematic diagram of the main process of obtaining similar users corresponding to seed users based on knowledge graph and graph neural network algorithm according to an embodiment of the present invention. Figure 4 As shown, the main process of obtaining similar users corresponding to the seed user may include:
[0072] Step S401, based on the user relationship graph corresponding to the knowledge graph, seed users are used as positive samples and non-seed users are used as negative samples, and combined with user portrait data, a graph neural network algorithm is used to perform model training to obtain feature vectors corresponding to seed users and feature vectors corresponding to non-seed users;
[0073] Step S402, calculating a similarity value between the seed user and the non-seed user based on the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user;
[0074] Step S403: selecting a similar user corresponding to the seed user from the non-seed users according to the calculated similarity value between the seed user and the non-seed user.
[0075] Non-seed users are users other than seed users in the user relationship graph, and the number of non-seed users is one or more. For example, if the business scenario data is users B1 and B3 who have purchased item P1, then the seed users are B1 and B3, and the non-seed users are B2 and B4.
[0076] The user relationship graph refers to a relationship graph between users obtained through the knowledge graph. The embodiment of the present invention can generate the user relationship graph according to the following process:
[0077] (1) Get all users in the knowledge graph, such as Figure 3 Users B1, B2, B3, and B4 in .
[0078] (2) For each user among all users, obtain the users who have common neighbors with the user from the knowledge graph, and then calculate the similarity value between the user and the obtained user to obtain the similarity value between all users.
[0079] Analyze each user in the knowledge graph to obtain the similarity value between the user and other users. Specifically, for each user, obtain the users who have common neighbors with the user, and then calculate the similarity value between the user and the obtained users. For a node, a neighbor refers to the node connected to the node, such as Figure 3 In , the neighbors of user B1 are items P1, P2 and address C1. Common neighbors means that if two or more nodes have the same neighbors, then the same neighbors are the common neighbors of these two or more nodes. Figure 3 It can be seen that user B1 and user B2 have common neighbors, namely item P2 and address C1, so the similarity value between user B1 and user B2 needs to be calculated.
[0080] Furthermore, the similarity value between the user and the acquired user is calculated, including: determining the common neighbors corresponding to the user and the acquired user; counting the number of nodes corresponding to the common neighbors according to the knowledge graph; calculating the similarity value between the user and the acquired user according to the relationship between the user and the common neighbors, the relationship between the acquired user and the common neighbors, and the number of nodes corresponding to the common neighbors, and in combination with the set weights.
[0081] The number of nodes corresponding to the common neighbor refers to the number of nodes connected to the common neighbor, such as Figure 3 In the example, the number of nodes corresponding to item P2 is 2, and the number of nodes corresponding to address C1 is 4. Considering the different relationships between users and items, the degree of preference of users for items is different. Therefore, in the process of calculating the similarity between users, different weights can be set for different relationships between users and items, such as setting the weight ratio of click relationship, collection relationship, and purchase relationship to 1:2:3. In addition, weights can also be set for the relationship between users and addresses. Therefore, the calculation formula for the similarity between users is obtained as follows:
[0082]
[0083] Among them, sim(a,b) represents the similarity between user a and user b; degree(c) represents the number of nodes corresponding to the common neighbor c of user a and user b; ((a,c)∈edgelist,w1) means that c is a neighbor of user a, and the weight value of the relationship between users a and c is w1; ((b,c)∈edgelist,w2) means that c is a neighbor of user b, and the weight value of the relationship between users a and b is w2.
[0084] In summary, if two users have common neighbors, then the similarity between the two users can be calculated according to the above formula; if two users do not have common neighbors, then the similarity between the two users can be considered to be 0. Therefore, the similarity between all users, that is, the similarity between every two users, can be obtained.
[0085] (3) Generate a user relationship graph based on the similarity values between all users.
[0086] Figure 5 Schematic diagram of the structure of a user relationship graph generated according to an embodiment of the present invention. Figure 3 It is found that there are common neighbors between users B1 and B2, between users B1 and B3, between users B2 and B4, and between users B3 and B4. Therefore, we can get Figure 5 The user relationship diagram shown in Figure 5 In the example, the similarity values between users can also be marked as d1, d2, d3 and d4.
[0087] A graph neural network is a neural network that runs directly on a graph structure. The embodiment of the present invention may use the GraphSAGE algorithm (i.e., a graph neural network algorithm), which may re-represent each node in a graph as an aggregation of its neighboring nodes.
[0088] For scenarios with seed users, based on the user relationship graph, seed users are used as positive samples and non-seed users are used as negative samples. The GraphSAGE algorithm is used for supervised learning, and its loss function can be:
[0089]
[0090] Where N represents the number of users, that is, the total number of seed users and non-seed users; y represents the user's preference for the recommended item, the y corresponding to the positive sample is 1, and the y corresponding to the negative sample is 0; z u is the representation of user u; p(z u ) represents the predicted probability value corresponding to user u, that is, the predicted degree of user u’s liking for the recommended item.
[0091] The core operation of the GraphSAGE algorithm includes two steps: the first step is to fuse the features of the target neighborhood, such as fusing the features of neighboring nodes; the second step is to splice the features of the fused target neighborhood with the features of the node itself to update the features of each node. The specific formula is:
[0092]
[0093]
[0094] in, represents the features of the neighboring nodes of fused node i; x j represents the feature of node j, x i represents the characteristics of node i; N i represents the neighboring nodes of node i; aggregate() represents feature fusion; y i is the updated feature of node i; σ is the activation function; concat() represents feature concatenation; W represents the network weight. In addition, aggregate() can use methods such as maximum pooling and average pooling. Repeat the first and second steps K times, that is, iteratively update the features of each node, so that the features of each node and its K-degree neighbors can be fused.
[0095] In addition, in the process of obtaining the feature vector of the node based on the user relationship graph and the GraphSAGE algorithm, the user's portrait data can also be combined to better represent the user's characteristics, so as to improve the accuracy of the similarity values between seed users and non-seed users calculated later. In addition, since e-commerce data is updated frequently, new nodes are added from time to time, and it is costly to repeatedly train the entire network. When new nodes are added, the proposed aggregation method can make GraphSAGE unnecessary to repeat training in order to obtain the latest feature vector. In other words, according to the aggregation method that has been learned, the features of the newly added nodes can be aggregated.
[0096] In step S401, based on the user relationship graph and the GraphSAGE algorithm, and in combination with the user's portrait data, the feature vector corresponding to each user in the user relationship graph is obtained, that is, the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user are obtained. Then, in step S402, the similarity value between the seed user and the non-seed user is calculated using the obtained feature vector. Then, in step S403, based on the calculated similarity value, a similar user corresponding to the seed user is selected from the non-seed users. Specifically, a first similarity threshold can be set. If the similarity value between the seed user and the non-seed user is greater than the first similarity threshold, the non-seed user is determined to be a similar user corresponding to the seed user. Of course, the first similarity threshold can also be set according to the required number of expandable users.
[0097] It should be noted that the number of seed users can be one or more, and the number of non-seed users can also be one or more. Therefore, it is necessary to calculate the similarity value between each seed user and each non-seed user, and then obtain the similar users corresponding to the seed user. If the seed users are B1 and B3, and the non-seed users are B2 and B4, then it is necessary to calculate the similarity value between user B1 and user B2, and the similarity value between user B1 and user B4, and then it can be determined whether users B2 and B4 are similar users corresponding to user B1. In addition, it is also necessary to calculate the similarity value between user B3 and user B2, and the similarity value between user B3 and user B4, and then it can be determined whether users B2 and B4 are similar users corresponding to user B3.
[0098] In summary, for scenarios with seed users, the user network is trained in a supervised manner to obtain the user's feature vector, so that similar users in the network topology structure are closer, and scalable users can be directly obtained from seed users.
[0099] (II) Scenarios for users without a seed
[0100] Figure 6 FIG. 1 is a schematic diagram of the main process of determining expandable users through items to be recommended according to an embodiment of the present invention. Figure 6As shown, the main process of determining expandable users through items to be recommended may include steps S601 to S604.
[0101] Step S601: Determine whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph. If so, execute step S602; if not, execute step S603.
[0102] The user-item relationship graph refers to a relationship graph between users and items obtained through the knowledge graph. The embodiment of the present invention can generate the user-item relationship graph according to the following process:
[0103] (1) Based on the knowledge graph, obtain the relationship between users and items, such as the purchase relationship between users and items, the click relationship between users and items, and the collection relationship between users and items;
[0104] (2) Based on the relationship between the user and the item and the set weight, the association value between the user and the item is calculated.
[0105] The association value between a user and an item can be understood as the user's preference for the item. Considering the different relationships between users and items, the user's preference for the item is different. Therefore, in the process of calculating the user's preference for the item, different weights can be set for different relationships between users and items, such as setting the weight ratio of click relationship, collection relationship, and purchase relationship to 1:2:3.
[0106] (3) Generate a user-item relationship graph based on the association value between the user and the item.
[0107] Figure 7 Schematic diagram of the structure of the user-item relationship graph generated according to an embodiment of the present invention. Figure 3 It is found that there is a relationship between user B1 and items P1 and P2, between user B2 and items P2, P4, and P5, between user B3 and items P1 and P3, and between user B4 and items P3 and P5. Therefore, we can get Figure 7 The user-item relationship diagram shown in Figure 1. Figure 7 In the example, the association values between user items can also be marked as f1 to f9.
[0108] Step S602: Obtain similar items based on the user-item relationship graph and the graph neural network algorithm.
[0109] If the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph, the GraphSAGE algorithm can be used to obtain similar items corresponding to the item to be recommended. The specific implementation is:
[0110] (1) Based on the user-item relationship graph, combined with the user's portrait data and the item's attribute data, a graph neural network algorithm is used to train the model to obtain feature vectors corresponding to the item to be recommended and feature vectors corresponding to other items. The other items are items other than the item to be recommended in the user-item relationship graph, and the number of other items is one or more.
[0111] For scenarios without seed users, the GraphSAGE algorithm is used for unsupervised learning based on the user-item relationship graph, and its loss function can be:
[0112]
[0113] Among them, z u is the feature vector of node u, z v is the feature vector of node v. u and v appear together in a random walk of a certain length. In the embodiment of the present invention, node v can be considered as a neighbor node of node u. σ is the activation function. v n is a negative sample that does not appear with node u, that is, v n is a non-neighbor node of node u; p n is the probability distribution of negative samples; Q is the number of negative samples.
[0114] The core operation of the GraphSAGE algorithm has been described above and will not be repeated here. In the embodiment of the present invention, the feature vector corresponding to each item and the feature vector corresponding to each user in the user-item relationship graph can be obtained based on the user-item relationship graph and the GraphSAGE algorithm. In addition, in the process of generating feature vectors, the user's portrait data and the item's attribute data can also be combined, so as to better represent the characteristics of the item and the characteristics of the user, so as to improve the accuracy of the calculated similarity value between the recommended item and other items.
[0115] (2) Based on the feature vector corresponding to the item to be recommended and the feature vectors corresponding to other items, calculate the similarity value between the item to be recommended and other items.
[0116] (3) Based on the calculated similarity value between the item to be recommended and other items, select similar items corresponding to the item to be recommended from other items.
[0117] After obtaining the feature vector corresponding to the item to be recommended and the feature vector corresponding to other items, the obtained feature vector is used to calculate the similarity value between the item to be recommended and the other items, and then similar items corresponding to the item to be recommended are selected from other items based on the calculated similarity value. Specifically, a second similarity threshold can be set. If the similarity value between the item to be recommended and the other items is greater than the second similarity threshold, the other items are determined to be similar items corresponding to the item to be recommended. Of course, the second similarity threshold can also be set according to the number of expandable user requirements. It should be noted that the number of items to be recommended can be one or more, and the number of other items can also be one or more. Therefore, it is necessary to calculate the similarity value between each item to be recommended and each other item, and then obtain the similar items corresponding to the item to be recommended.
[0118] Step S603: Based on the user-item relationship graph and according to the specific attribute tags of the items to be recommended, similar items are obtained.
[0119] If the item to be recommended is not in the user-item relationship graph corresponding to the knowledge graph, then you can specify a specific attribute label for the item to be recommended, and then select items with specific attribute labels from the user-item relationship graph based on the item's attribute data to determine that the selected items are similar items. For example, if the item to be recommended is a certain brand of mid-to-high-end milk powder, and there is no mid-to-high-end milk powder of this brand in the user-item relationship graph, then you can locate other brands of mid-to-high-end milk powder that exist in the user-item relationship graph.
[0120] Step S604: Obtain neighbor users corresponding to similar items from the user-item relationship graph, and determine that the neighbor users are expandable users.
[0121] After obtaining similar items corresponding to the item to be recommended, users who have interacted with the similar items can be queried from the user-item relationship graph, that is, neighbor users corresponding to the similar items, and the neighbor users can be determined as expandable users.
[0122] In summary, for scenarios where there are no seed users and the items to be recommended are in the user-item relationship graph corresponding to the knowledge graph, the user-item network can be trained unsupervised to obtain the user's feature vector and the item's feature vector, so that similar items in the network topology are closer, and then the population is expanded in the user-item relationship graph based on the items to be recommended and similar items. For scenarios where there are no seed users and the items to be recommended are not in the user-item relationship graph corresponding to the knowledge graph, the specific attribute labels of the items to be recommended can be used to perform multi-hop queries in the user-item relationship graph, first determine similar items in the user-item relationship graph, and then expand the population.
[0123] Figure 8 FIG. 1 is a schematic diagram of the main process of the method for recommending items according to an embodiment of the present invention. Figure 8 As shown, the main process of the item recommendation method may include:
[0124] Step S801, obtaining business scenario data;
[0125] Step S802, determining whether the business scenario data contains a seed user, if so, executing step S803, if not, executing step S806;
[0126] Step S803: Based on the user relationship graph corresponding to the knowledge graph, seed users are used as positive samples and non-seed users are used as negative samples. In combination with user portrait data, the GraphSAGE algorithm is used to perform model training to obtain feature vectors corresponding to seed users and feature vectors corresponding to non-seed users.
[0127] Step S804, calculating a similarity value between the seed user and the non-seed user based on the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user;
[0128] Step S805, selecting a similar user corresponding to the seed user from the non-seed users according to the calculated similarity value between the seed user and the non-seed user, and determining the similar user as an expandable user;
[0129] Step S806, determining whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph, if so, executing step S807, if not, executing step S810;
[0130] Step S807, based on the user-item relationship graph, and in combination with the user's portrait data and the item's attribute data, the GraphSAGE algorithm is used to perform model training to obtain feature vectors corresponding to the item to be recommended and feature vectors corresponding to other items;
[0131] Step S808, calculating the similarity value between the item to be recommended and the other items based on the feature vector corresponding to the item to be recommended and the feature vectors corresponding to the other items;
[0132] Step S809, selecting a similar item corresponding to the item to be recommended from other items according to the calculated similarity value between the item to be recommended and other items;
[0133] Step S810, selecting an item with a specific attribute label from the user-item relationship graph according to the attribute data of the item, and determining that the selected item is a similar item corresponding to the item to be recommended;
[0134] Step S811, obtaining neighbor users corresponding to similar items from the user-item relationship graph, and determining that the neighbor users are expandable users;
[0135] Step S812: recommend the item to be recommended to the expandable user.
[0136] Among them, the business scenario data includes items to be recommended, and the number of items to be recommended is one or more; seed users are users who have operated items to be recommended, and the number of seed users is one or more; non-seed users are users other than seed users in the user relationship graph, and the number of non-seed users is one or more; other items are items other than items to be recommended in the user-item relationship graph, and the number of other items is one or more. In addition, the knowledge graph, user relationship graph, and user-item relationship graph have been described in detail above, and will not be repeated.
[0137] In summary, for scenarios with seed users, supervised learning can be performed based on the user relationship graph using the Graph SAGE algorithm, and similar users corresponding to the seed users can be obtained in combination with the user's portrait data, and similar users can be determined as expandable users; for scenarios without seed users, expandable users can be determined based on the user-item relationship graph using a multi-hop query method, that is, first determine similar items corresponding to the recommended item, and then determine the neighbor users corresponding to the similar items as expandable users. In addition, if the recommended item is in the user-item relationship graph, supervised learning can be performed based on the user-item relationship graph using the GraphSAGE algorithm, and similar items corresponding to the recommended item can be obtained in combination with the user's portrait data and the item's attribute data; if the recommended item is not in the user-item relationship graph, specific attribute labels of the recommended item can be specified, and items with specific attribute labels can be selected from the user-item relationship graph to determine that the selected items are similar items corresponding to the recommended item.
[0138] In addition, since the number of items to be recommended is one or more, the business scenario data may include seed users corresponding to some of the items to be recommended. At this time, for items to be recommended that have seed users, the expandable users corresponding to the items to be recommended are obtained according to the scenario with seed users; for items to be recommended that do not have seed users, the expandable users corresponding to the items to be recommended are obtained according to the scenario without seed users.
[0139] According to the item recommendation method of the embodiment of the present invention, for business scenarios with seed users and business scenarios without seed users, different methods can be used to determine the expandable population, and then recommend the items to be recommended to the expandable population, which solves the noise problem caused by relying on artificial rules to construct positive and negative samples in the prior art when there are few or no seed users, and can obtain an expanded population that meets the needs, improve the accuracy of item recommendation, and provide a better experience for merchants and users. In addition, in the process of determining the expandable users, the knowledge graph with users, items and addresses as nodes is used, which solves the problem that the prior art does not fully utilize the rich associations between items and users, and fully utilizes the interactive relationship between items and users, user portrait data and item attribute data. And, for business scenarios with seed users, the knowledge graph and graph neural network algorithm are combined to further improve the accuracy of item recommendation. In addition, for business scenarios without seed users, a multi-hop query method is adopted, first using the knowledge graph to obtain similar items corresponding to the items to be recommended, and then determining the neighbor users corresponding to the similar items as expandable users.
[0140] Fig. 9 Schematic diagram of the main modules of the item recommendation device according to an embodiment of the present invention. Fig. 9 As shown, the main modules of the item recommendation device 900 may include: an acquisition module 901 , a judgment module 902 , a first determination module 903 , a second determination module 904 and a recommendation module 905 .
[0141] Among them, the acquisition module 901 can be used to: acquire business scenario data, wherein the business scenario data includes items to be recommended; the judgment module 902 can be used to: determine whether the business scenario data includes seed users, wherein the seed users are users who have operated the items to be recommended; the first determination module 903 can be used to: if so, then based on the knowledge graph and graph neural network algorithm, obtain similar users corresponding to the seed users, and determine that the similar users are expandable users; the second determination module 904 can be used to: if not, then based on the knowledge graph, obtain similar items corresponding to the items to be recommended, and determine that the neighbor users corresponding to the similar items are expandable users; the recommendation module 905 can be used to: recommend the items to be recommended to the expandable users.
[0142] As an embodiment of the present invention, the first determination module 903 can also be used to: based on the user relationship graph corresponding to the knowledge graph, take the seed user as a positive sample and the non-seed user as a negative sample, and combine the user's portrait data, use the graph neural network algorithm to perform model training, and obtain the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; calculate the similarity value between the seed user and the non-seed user according to the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; select similar users corresponding to the seed user from the non-seed users according to the calculated similarity value between the seed user and the non-seed user; wherein the non-seed user is a user other than the seed user in the user relationship graph, and the number of non-seed users is one or more.
[0143] As an embodiment of the present invention, the second determination module 904 can also be used to: determine whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph; if so, obtain similar items based on the user-item relationship graph and the graph neural network algorithm; if not, obtain similar items based on the user-item relationship graph and according to specific attribute tags of the item to be recommended; obtain neighbor users corresponding to the similar items from the user-item relationship graph, and determine that the neighbor users are expandable users.
[0144] As an embodiment of the present invention, the second determination module 904 can also be used to: based on the user-item relationship graph, and in combination with the user's portrait data and the item's attribute data, use the graph neural network algorithm to perform model training to obtain feature vectors corresponding to the item to be recommended and feature vectors corresponding to other items; calculate the similarity value between the item to be recommended and the other items based on the feature vectors corresponding to the item to be recommended and the feature vectors corresponding to the other items; select similar items corresponding to the item to be recommended from other items based on the calculated similarity value between the item to be recommended and the other items; wherein the other items are items other than the items to be recommended in the user-item relationship graph, and the number of other items is one or more.
[0145] As an embodiment of the present invention, the second determination module 904 may also be used to: select items with specific attribute tags from the user-item relationship graph according to the attribute data of the items, and determine that the selected items are similar items.
[0146] from Fig. 9 It can be seen that the item recommendation device 900 may further include a graph construction module 906. The graph construction module 906 may be used to: obtain user historical behavior data; obtain the relationship between the user and the item based on the user historical behavior data; obtain the relationship between the user and the address, and the relationship between the item and the address based on the user order data in the user historical behavior data; and construct a knowledge graph with users, items, and addresses as nodes based on the relationship between the user and the item, the relationship between the user and the address, and the relationship between the item and the address.
[0147] As an embodiment of the present invention, the graph construction module 906 can also be used to: add the user's portrait data to the knowledge graph, and add the item's attribute data to the knowledge graph.
[0148] As an embodiment of the present invention, the graph construction module 906 can also be used to: obtain all users in the knowledge graph; for each user among all users, obtain users who have common neighbors with the user from the knowledge graph, and then calculate the similarity value between the user and the obtained user to obtain the similarity value between all users; generate a user relationship graph based on the similarity values between all users.
[0149] As an embodiment of the present invention, the graph construction module 906 can also be used to: determine the common neighbors corresponding to the user and the acquired user; count the number of nodes corresponding to the common neighbors based on the knowledge graph; calculate the similarity value between the user and the acquired user based on the relationship between the user and the common neighbors, the relationship between the acquired user and the common neighbors, and the number of nodes corresponding to the common neighbors, and combined with the set weights.
[0150] As an embodiment of the present invention, the graph construction module 906 can also be used to: obtain the relationship between users and items based on the knowledge graph; calculate the association value between users and items based on the relationship between users and items in combination with the set weights; and generate a user-item relationship graph based on the association value between users and items.
[0151] According to the item recommendation device of the embodiment of the present invention, for business scenarios with seed users and business scenarios without seed users, different methods can be used to determine the expandable population, and then recommend the items to be recommended to the expandable population, which solves the noise problem caused by relying on artificial rules to construct positive and negative samples in the prior art when there are few or no seed users, and can obtain an expanded population that meets the needs, improve the accuracy of item recommendation, and provide a better experience for merchants and users. In addition, in the process of determining the expandable users, the knowledge graph with users, items and addresses as nodes is used, which solves the problem that the prior art does not fully utilize the rich associations between items and users, and fully utilizes the interactive relationship between items and users, user portrait data and item attribute data. And, for business scenarios with seed users, the knowledge graph and graph neural network algorithm are combined to further improve the accuracy of item recommendation. In addition, for business scenarios without seed users, a multi-hop query method is adopted, first using the knowledge graph to obtain similar items corresponding to the items to be recommended, and then determining the neighbor users corresponding to the similar items as expandable users.
[0152] Fig.10 An exemplary system architecture 1000 is shown to which the item recommendation method or item recommendation apparatus according to the embodiments of the present invention can be applied.
[0153] like Fig.10 As shown, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0154] Users can use terminal devices 1001, 1002, 1003 to interact with server 1005 through network 1004 to receive or send messages, etc. Terminal devices 1001, 1002, 1003 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.
[0155] Server 1005 may be a server that provides various services, for example, a background management server that provides support for users who use terminal devices 1001, 1002, and 1003 to recommend items (only as an example); for another example, server 1005 may complete the item recommendation of an embodiment of the present invention.
[0156] It should be noted that the item recommendation method provided in the embodiment of the present invention is generally executed by the server 1005 , and accordingly, the item recommendation device is generally disposed in the server 1005 .
[0157] It should be understood that Fig.10 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0158] Reference below Fig.11 , which shows a schematic diagram of the structure of a computer system 1100 of a terminal device suitable for implementing an embodiment of the present invention. Fig.11 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0159] like Fig.11As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0160] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0161] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present invention are executed.
[0162] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0163] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0164] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes an acquisition module, a judgment module, a first determination module, a second determination module, and a recommendation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the acquisition module may also be described as a "module for acquiring business scenario data."
[0165] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining business scenario data, wherein the business scenario data includes items to be recommended; determining whether the business scenario data includes seed users, wherein the seed users are users who have operated the items to be recommended; if so, based on the knowledge graph and graph neural network algorithm, obtaining similar users corresponding to the seed users, and determining that the similar users are expandable users; if not, based on the knowledge graph, obtaining similar items corresponding to the items to be recommended, and determining that the neighbor users corresponding to the similar items are expandable users; recommending the items to be recommended to the expandable users.
[0166] According to the technical solution of the embodiment of the present invention, for business scenarios with seed users and business scenarios without seed users, different methods can be used to determine the expandable population, and then recommend the items to be recommended to the expandable population, which solves the noise problem caused by relying on artificial rules to construct positive and negative samples in the prior art when there are few or no seed users, and can obtain an expanded population that meets the needs, improve the accuracy of item recommendations, and provide a better experience for merchants and users. In addition, in the process of determining expandable users, a knowledge graph with users, items and addresses as nodes is used, which solves the problem that the prior art does not fully utilize the rich associations between items and users, and fully utilizes the interactive relationship between items and users, user portrait data and item attribute data. And, for business scenarios with seed users, the knowledge graph and graph neural network algorithm are combined to further improve the accuracy of item recommendations. In addition, for business scenarios without seed users, a multi-hop query method is adopted, first using the knowledge graph to obtain similar items corresponding to the items to be recommended, and then determining the neighbor users corresponding to the similar items as expandable users.
[0167] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An item recommendation method, characterized in that: include: Acquire business scenario data, wherein the business scenario data is data related to item recommendation acquired when planning to recommend items, including items to be recommended; Determining whether the business scenario data includes a seed user, wherein the seed user is a user who has operated the item to be recommended; If so, based on the knowledge graph and graph neural network algorithm, similar users corresponding to the seed user are obtained, and the similar users are determined to be expandable users; If not, similar items corresponding to the item to be recommended are obtained based on the knowledge graph, and the neighbor users corresponding to the similar items are determined to be expandable users; wherein the process of obtaining similar items is: judging whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph; if so, obtaining the similar items based on the user-item relationship graph and the graph neural network algorithm; if not, obtaining the similar items based on the user-item relationship graph and according to the specific attribute labels of the item to be recommended; neighbor users are users who have interacted with similar items in the user-item relationship graph, and for a node, neighbors refer to nodes connected to the node; The to-be-recommended item is recommended to the expandable user.
2. The method according to claim 1, characterized in that The obtaining similar users corresponding to the seed user based on the knowledge graph and graph neural network algorithm includes: Based on the user relationship graph corresponding to the knowledge graph, the seed user is used as a positive sample and the non-seed user is used as a negative sample. In combination with the user's portrait data, a graph neural network algorithm is used to perform model training to obtain a feature vector corresponding to the seed user and a feature vector corresponding to the non-seed user. Calculating a similarity value between the seed user and the non-seed user according to the feature vector corresponding to the seed user and the feature vector corresponding to the non-seed user; According to the calculated similarity value between the seed user and the non-seed user, a similar user corresponding to the seed user is selected from the non-seed users; wherein, The non-seed users are users other than the seed users in the user relationship graph, and the number of the non-seed users is one or more.
3. The method according to claim 1, characterized in that The determining that the neighbor users corresponding to the similar items are expandable users includes: From the user-item relationship graph, neighbor users corresponding to the similar items are obtained, and the neighbor users are determined to be the expandable users.
4. The method according to claim 3, characterized in that The acquiring the similar items based on the user-item relationship graph and the graph neural network algorithm includes: Based on the user-item relationship graph, and in combination with the user's portrait data and the item's attribute data, a graph neural network algorithm is used to perform model training to obtain a feature vector corresponding to the item to be recommended and a feature vector corresponding to other items; Calculating a similarity value between the item to be recommended and the other items according to the feature vector corresponding to the item to be recommended and the feature vector corresponding to the other items; According to the calculated similarity value between the item to be recommended and the other items, a similar item corresponding to the item to be recommended is selected from the other items; wherein, The other items are items other than the to-be-recommended items in the user-item relationship graph, and the number of the other items is one or more.
5. The method according to claim 3, characterized in that: The acquiring the similar items based on the user-item relationship graph and according to the specific attribute tags of the items to be recommended includes: According to the attribute data of the item, an item with the specific attribute label is selected from the user-item relationship graph, and the selected item is determined to be the similar item.
6. The method according to any one of claims 1 to 5, characterized in that: The knowledge graph is constructed according to the following process: Obtain user historical behavior data; According to the user's historical behavior data, the relationship between the user and the item is obtained; According to the user order data in the user historical behavior data, the relationship between the user and the address, and the relationship between the item and the address are obtained; According to the relationship between the user and the item, the relationship between the user and the address, and the relationship between the item and the address, a knowledge graph with users, items, and addresses as nodes is constructed.
7. The method according to claim 6, characterized in that After constructing a knowledge graph with users, items and addresses as nodes, the method further includes: The user's portrait data is added to the knowledge graph, and the item's attribute data is added to the knowledge graph.
8. The method according to claim 6, characterized in that The user relationship graph is generated according to the following process: Obtain all users in the knowledge graph; For each user among all the users, obtain users having common neighbors with the user from the knowledge graph, and then calculate a similarity value between the user and the obtained user to obtain a similarity value between all the users; The user relationship graph is generated according to the similarity values between all the users.
9. The method according to claim 8, characterized in that The calculating the similarity value between the user and the acquired user includes: Determining common neighbors corresponding to the user and the acquired user; According to the knowledge graph, counting the number of nodes corresponding to the common neighbors; The similarity value between the user and the common neighbor is calculated according to the relationship between the user and the common neighbor, the relationship between the acquired user and the common neighbor, and the number of nodes corresponding to the common neighbor, and in combination with the set weight.
10. The method according to claim 6, characterized in that The user-item relationship graph is generated according to the following process: According to the knowledge graph, obtaining the relationship between the user and the item; Calculate the association value between the user and the item based on the relationship between the user and the item and the set weight; The user-item relationship graph is generated according to the association value between the user and the item.
11. The method according to any one of claims 1 to 4, characterized in that: The graph neural network algorithm is the GraphSAGE algorithm.
12. An item recommendation device, characterized in that: include: An acquisition module, used to acquire business scenario data, wherein the business scenario data is data related to item recommendation acquired when planning to recommend items, including items to be recommended; A judgment module, used to judge whether the business scenario data contains a seed user, wherein the seed user is a user who has operated the item to be recommended; A first determination module is used to obtain similar users corresponding to the seed user based on the knowledge graph and graph neural network algorithm, and determine that the similar users are expandable users; The second determination module is used for, if not, obtaining similar items corresponding to the item to be recommended based on the knowledge graph, and determining that the neighbor user corresponding to the similar item is an expandable user; wherein the process of obtaining similar items is: judging whether the item to be recommended is in the user-item relationship graph corresponding to the knowledge graph; if so, obtaining the similar items based on the user-item relationship graph and the graph neural network algorithm; if not, obtaining the similar items based on the user-item relationship graph and according to the specific attribute label of the item to be recommended; the neighbor user is a user who has interacted with the similar item in the user-item relationship graph, and for a node, the neighbor refers to the node connected to the node; A recommendation module is used to recommend the item to be recommended to the expandable user.
13. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 11.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
