Product recommendation method, device, medium and electronic device
By traversing and adjusting relationship paths in the relationship knowledge graph between users and products and training neural network models, the problem that traditional recommendation systems cannot dig deep information is solved, and accurate and interpretable product recommendations are achieved.
Patent Information
- Application Number
- CN202210029839.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-01-12
AI Technical Summary
Traditional recommendation systems based on collaborative filtering and other methods cannot effectively mine the information in the knowledge graph, resulting in low recommendation accuracy and lack of interpretability.
Traversing multi-class relationship paths in the user-product relationship knowledge graph, perform path counting and matrix construction, adjust initial weight values, train neural network models to generate product recommendation models, and determine target class relationship paths based on the number of relationship paths and weight values , generate a recommendation reason.
It realizes accurate personalized product recommendations and improves the interpretability of recommendation results, making recommendation results more suitable for application in assisted marketing and other scenarios.
Smart Images

Figure CN114385828B_ABST
Abstract
Description
Background Art
[0002] Recommendation systems are an indispensable and important technology in the advanced Internet. Because the speed of information generation in the Internet era is growing explosively, it is very inefficient for users to retrieve information by themselves, so a good recommendation system can greatly improve the efficiency of users in obtaining information and bring higher profits to content platforms. There is a wealth of information hidden in the graph structure of the knowledge graph. Traditional recommendation systems based on collaborative filtering and other methods often cannot mine the information, so the recommendation accuracy is low and the recommendation effect is very limited. Summary of the invention
[0003] In the field of artificial intelligence and big data technology, in order to solve the above technical problems, the purpose of the present disclosure is to provide a product recommendation method, device, medium and electronic device.
[0004] According to one aspect of the present disclosure, a product recommendation method is provided, the method comprising:
[0005] Traversing the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user-product pair, wherein each type of relationship path includes at least one relationship path;
[0006] For each type of relationship path, path counting is performed to obtain the number of relationship paths included in each type of relationship path;
[0007] According to the number of relationship paths included in each type of relationship path, a matrix corresponding to each type of relationship path is constructed;
[0008] According to the initial weight values corresponding to the various relationship paths, the elements in the matrix corresponding to the various relationship paths are adjusted to obtain an adjusted matrix;
[0009] The adjusted matrices corresponding to various relationship paths are concatenated to obtain a concatenated matrix;
[0010] The neural network model is trained according to the splicing matrix to obtain a product recommendation model, and the initial weight values corresponding to various relationship paths are adjusted to obtain final weight values;
[0011] recommending a target product to a target user based on the product recommendation model;
[0012] Determine a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and the final weight value corresponding to each type of relationship path;
[0013] Based on the reason information corresponding to the target class relationship path, a recommendation reason is generated and the recommendation reason is output.
[0014] According to another aspect of the present disclosure, a product recommendation device is provided, the device comprising:
[0015] A traversal module is configured to traverse the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user and product pair, wherein each type of relationship path includes at least one relationship path;
[0016] A counting module is configured to count the paths of each type of relationship path to obtain the number of relationship paths included in each type of relationship path;
[0017] A construction module is configured to construct a matrix corresponding to each type of relationship path according to the number of relationship paths included in each type of relationship path;
[0018] The matrix adjustment module is configured to adjust the elements in the matrix corresponding to each type of relationship path according to the initial weight values corresponding to each type of relationship path to obtain an adjusted matrix;
[0019] A splicing module is configured to splice the adjusted matrices corresponding to various relationship paths to obtain a splicing matrix;
[0020] A training and adjustment module is configured to train the neural network model according to the splicing matrix to obtain a product recommendation model, and adjust the initial weight values corresponding to various relationship paths to obtain final weight values;
[0021] A recommendation module, configured to recommend a target product to a target user based on the product recommendation model;
[0022] A determination module is configured to determine a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and a final weight value corresponding to each type of relationship path;
[0023] The generation module is configured to generate a recommendation reason based on the reason information corresponding to the target class relationship path, and output the recommendation reason.
[0024] According to another aspect of the present disclosure, a computer-readable program medium is provided, which stores computer program instructions. When the computer program instructions are executed by a computer, the computer is caused to execute the method as described above.
[0025] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0026] processor;
[0027] A memory having computer-readable instructions stored therein, wherein the computer-readable instructions, when executed by the processor, implement the aforementioned method.
[0028] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0029] For the product recommendation method, device, medium and electronic device provided by the present disclosure, the method includes the following steps: traversing the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user and product pair, wherein each type of relationship path includes at least one relationship path; for each type of relationship path, counting the paths to obtain the number of relationship paths included in each type of relationship path; constructing a matrix corresponding to each type of relationship path according to the number of relationship paths included in each type of relationship path; adjusting the elements in the matrix corresponding to each type of relationship path according to the initial weight values corresponding to each type of relationship path to obtain an adjusted matrix; splicing the adjusted matrices corresponding to each type of relationship path to obtain a spliced matrix; training a neural network model according to the spliced matrix to obtain a product recommendation model, and adjusting the initial weight values corresponding to each type of relationship path to obtain a final weight value; recommending a target product to a target user based on the product recommendation model; determining a target type relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and the final weight values corresponding to each type of relationship path; generating a recommendation reason based on the reason information corresponding to the target type relationship path, and outputting the recommendation reason.
[0030] Under this method, the various relationship paths in the user-product relationship knowledge graph are first counted, and then a matrix is constructed based on the counting results. After the matrix is adjusted using the initial weight value, on the one hand, the product recommendation model is trained using the spliced matrix obtained by splicing the adjusted matrices, and the target product is recommended to the target user through the product recommendation model. Since the training of the product recommendation model uses more extensive information, accurate personalized recommendations can be achieved; on the other hand, each initial weight value is adjusted to obtain the final weight value, and the target class relationship path is determined based on the number of relationship paths and the final weight value. Finally, based on the reason information corresponding to the target class relationship path, the recommendation reason is generated, which can make the recommendation result more explainable.
[0031] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0033] Figure 1 is a schematic diagram of a system architecture of a product recommendation method according to an exemplary embodiment;
[0034] Figure 2 is a flow chart of a product recommendation method according to an exemplary embodiment;
[0035] Figure 3 is a flowchart showing a method of recommending a target product to a target user based on a product recommendation model according to an exemplary embodiment;
[0036] Figure 4 is a flow chart showing a method of generating a recommendation reason according to an exemplary embodiment;
[0037] Figure 5 is a block diagram of a product recommendation device according to an exemplary embodiment;
[0038] Figure 6 is an example block diagram of an electronic device for implementing the above product recommendation method according to an exemplary embodiment;
[0039] Figure 7 A program product for implementing the product recommendation method is shown according to an exemplary embodiment. DETAILED DESCRIPTION
[0040] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0041] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0042] As mentioned in the background technology section, traditional recommendation methods have limited data mining capabilities and are unable to mine deep information, resulting in low recommendation accuracy and poor recommendation effects. Moreover, related technologies are often not explainable, making it impossible for relevant personnel to know the real reasons for making specific recommendations, making it impossible to further apply the recommendation results.
[0043] To this end, the present disclosure first provides a product recommendation method. This method can overcome the above defects, not only can accurately recommend, but also can improve the interpretability, so that the recommendation results can be further applied to auxiliary marketing and other scenarios.
[0044] The implementation terminal of the present disclosure can be any device with computing, processing and communication functions, which can be connected to an external device for receiving or sending data. Specifically, it can be a portable mobile device, such as a smart phone, a tablet computer, a laptop computer, a PDA (Personal Digital Assistant), etc., or it can be a fixed device, such as a computer device, a field terminal, a desktop computer, a server, a workstation, etc. It can also be a collection of multiple devices, such as the physical infrastructure of cloud computing or a server cluster.
[0045] Optionally, the implementation terminal of the present disclosure may be a server or a physical infrastructure of cloud computing.
[0046] Figure 1 FIG. 1 is a schematic diagram of a system architecture of a product recommendation method according to an exemplary embodiment. Figure 1 As shown, the system architecture includes a mobile terminal 110, a server 120, and a graph database 130. The mobile terminal 110 and the server 120, and the graph database 130 and the server 120 are connected via communication links. The server 120 is an implementation terminal of the embodiment of the present disclosure. The server 120 is deployed with a neural network model and a service end of the platform; the mobile terminal 110 is deployed with a client end of the platform; and the graph database 130 is provided with a knowledge graph of the relationship between users and products. When the product recommendation method provided by the present disclosure is applied to Figure 1 In the system architecture shown, the specific process may be as follows: first, the server 120 traverses the relational knowledge graph in the graph database 130, counts the paths of each type of relational path obtained by the traversal, and constructs a matrix corresponding to each type of relational path; then, the server 120 adjusts the matrix according to the initial weights of each type of relational path, and then splices the adjusted matrix to obtain a spliced matrix, and uses the spliced matrix to train a product recommendation model. At the same time, the initial weights of each type of relational path may be adjusted to obtain the final weight; next, after the target user of the mobile terminal 110 requests to log in to the server 120 through the client, the server 120 may use the product recommendation model to return the target product to the client, thereby recommending the target product to the target user; in addition, the server 120 may also generate a recommendation reason based on the relational path between the target user and the target product and the final weights of each type of relational path, and return the recommendation reason to the target user of the mobile terminal 110.
[0047] In one embodiment of the present disclosure, the platform is a shopping platform or an online video platform.
[0048] It is worth mentioning that Figure 1 This is only one embodiment of the present disclosure. Figure 1 In the embodiment, the terminal where the target user is located is a mobile terminal, but in other embodiments of the present application, the terminal where the target user is located may also be a fixed terminal such as a desktop computer; Figure 1 In the embodiment, the implementation terminal provides the recommended target product and the corresponding recommendation reason to the same terminal device, but in other embodiments of the present application, the implementation terminal can also provide the recommended target product and the recommendation reason to different terminal devices respectively. The present disclosure does not make any limitation to this, and the protection scope of the present disclosure should not be limited in any way.
[0049] Figure 2 FIG. 1 is a flowchart of a product recommendation method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:
[0050] Step 210, traverse the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user and product pair.
[0051] Each type of relationship path includes at least one relationship path.
[0052] The products here can be various product information represented in digital form, specifically service products such as movies and insurance, or physical products such as home appliances, digital products, snacks, etc.
[0053] The relationship knowledge graph between users and products can be stored in a graph database. In the relationship knowledge graph between users and products, users and products exist in the form of entities, and users and products are connected based on the relationship path in the relationship knowledge graph. Therefore, each user and product pair represents a set of associations between users and products.
[0054] For example, in the movie recommendation scenario, there can be two types of relationship paths between users and movies:
[0055] The first type of relationship path: user->movie->movie category->movie;
[0056] The second type of relationship path: user->user->movie.
[0057] The first type of relationship path represents movies of the same category as the movie that the user likes; the second type of relationship path represents movies that the user's friends like. The movies pointed to by the two types of relationship paths are the movies that the user is more likely to like. A total of K types of relationship paths can be set, and each type of relationship path can include one or more relationship paths.
[0058] In one embodiment, the traversal in the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user-product pair includes:
[0059] Based on the breadth-first traversal method, the relationship knowledge graph between users and products is traversed to obtain multiple types of relationship paths corresponding to each user and product pair.
[0060] In this embodiment, by traversing the relational knowledge graph in a breadth-first traversal manner, the traversal efficiency can be improved, thereby improving the efficiency of product recommendations.
[0061] Step 220: Count the paths of each type of relationship path to obtain the number of relationship paths included in each type of relationship path.
[0062] By performing a path counting operation on a type of relationship paths, the number of relationship paths included in the type of relationship paths can be obtained.
[0063] As mentioned above, each type of relationship path may include one or more relationship paths, so by performing a path counting operation on the relationship paths included in each type of relationship path, the number of corresponding relationship paths can be obtained. Specifically, taking the movie recommendation scenario as an example, for the second type of relationship path mentioned above, for each user and each movie, the number of friends of the user who like the movie is determined.
[0064] For the first type of relationship paths, the specific relationship paths that can be included are:
[0065] Xiao Ming likes Avatar, which is a science fiction movie, and The Wandering Earth
[0066] Xiao Wang likes Fast and Furious, which belongs to action movies, and Police Stories, which belongs to police stories.
[0067] Among them, Xiao Wang and Xiao Ming are users, Avatar, The Wandering Earth, Fast and Furious, and Police Stories are movies, and science fiction and action movies are movie categories; through path counting, it can be obtained that the number of relationship paths included in the first type of relationship path is 2.
[0068] Step 230: construct a matrix corresponding to each type of relationship path according to the number of relationship paths included in each type of relationship path.
[0069] In the matrix, each user can be used as a row and each product can be used as a column. The number of relationship paths between each user and product pair under this type of relationship path can be used as an element in the constructed matrix. Finally, K matrices A can be obtained. i , where K is the number of various relationship paths, i represents the i-th matrix in the K-th matrix, and matrix A i The size is number of users * number of products.
[0070] Step 240 , adjusting the elements in the matrix corresponding to each type of relationship path according to the initial weight values corresponding to each type of relationship path, to obtain an adjusted matrix.
[0071] For each type of relationship path, the elements in the corresponding matrix are adjusted according to the corresponding initial weight value.
[0072] Adjusting the elements in the matrix according to the initial weight value can be done by multiplying the initial weight value with each element in the matrix. The initial weight value corresponding to each type of relationship path can be x i By adjusting the K matrices separately, K adjusted matrices can be obtained.
[0073] A i Each element in k By multiplying it with the initial weight value, we can get the adjusted matrix, where i represents the i-th matrix in the K-th matrix, and j and k represent the positions of the elements in the matrix.
[0074] The initial weight values corresponding to various relationship paths can be set manually based on expert experience.
[0075] Step 250 , concatenate the adjusted matrices corresponding to the various relationship paths to obtain a concatenated matrix.
[0076] By combining the K adjusted matrices in a certain order, a concatenated matrix can be obtained.
[0077] Step 260 , training the neural network model according to the splicing matrix to obtain a product recommendation model, and adjusting the initial weight values corresponding to each type of relationship path to obtain a final weight value.
[0078] The neural network model here can be of various types, for example, it can be a multi-layer neural network such as a multi-layer perceptron (MLP) or a deep neural network.
[0079] The corresponding objective function is set, and learning is performed based on the objective function when training the neural network model. Whether the user likes the product is the output result, and the parameters of each layer in the neural network model are adjusted according to the output result and the objective function, so that the neural network model can be trained. For each type of relationship path, the initial weight value corresponding to the relationship path is adjusted and updated, and a final weight value corresponding to the relationship path can be obtained.
[0080] In one embodiment, the neural network model is trained according to the splicing matrix to obtain a product recommendation model, and the initial weight values corresponding to various relationship paths are adjusted to obtain final weight values, including:
[0081] The neural network model is trained according to the splicing matrix, and during the training process, the initial weight values corresponding to various relationship paths in the neural network model are adjusted to obtain final weight values.
[0082] Since the present embodiment can adjust the initial weight values during the model training process, the initial weight values exist in the form of parameters of the neural network model. Specifically, a connection path for adjusting each initial weight value can be set in the neural network model, and the initial weight values can be adjusted by back propagation during the model training process.
[0083] In one embodiment, the neural network model is trained according to the splicing matrix to obtain a product recommendation model, and the initial weight values corresponding to various relationship paths are adjusted to obtain final weight values, including:
[0084] The neural network model is trained according to the splicing matrix to obtain a product recommendation model;
[0085] The initial weight values corresponding to the various relationship paths are used as initialization parameters in the product prediction model, the product prediction model is trained, and the parameters in the trained product prediction model are used as final weight values.
[0086] The product prediction model and the product recommendation model are two different models. However, the product prediction model and the product recommendation model are similar and can both be used to output the products required by users. The product prediction model and the product recommendation model can both use neural network models. The product prediction model can also use other types of models such as logistic regression models.
[0087] The difference between this embodiment and the above embodiment is that the weight value is trained as a parameter alone, and there is no need to add a corresponding path in the neural network model, which can reduce the cost of a single training.
[0088] Step 270: recommend a target product to a target user based on the product recommendation model.
[0089] The target user can be one user or multiple users. On some network platforms, the target user is uniquely identified by an account. Specifically, the information of the target user and the target product can be added to the relational knowledge graph, a splicing matrix corresponding to the target user can be constructed, and then the splicing matrix can be input into the product recommendation model for recommendation. The product recommendation model can output the target user's recommendation score for each product.
[0090] In one embodiment, recommending a target product to a target user based on the product recommendation model includes: obtaining a recommendation score for each product output by the product recommendation model for the target user; taking the product with the highest recommendation score as the target product, and recommending the target product to the target user.
[0091] In this embodiment, by recommending the product with the highest recommendation score to the user, the accuracy of the recommended product is ensured.
[0092] In one embodiment, recommending target products to target users based on the product recommendation model includes: sorting the recommendation scores of the products output by the product recommendation model for the target users from large to small; taking a predetermined number of products ranked first as target products, adding the target products to a recommendation list, and pushing the recommendation list to the target user.
[0093] The predetermined number may be any number set based on experience, for example, 3.
[0094] In this embodiment, multiple products are recommended simultaneously in a list format.
[0095] Figure 3 FIG. 1 is a flowchart showing a method of recommending a target product to a target user based on a product recommendation model according to an exemplary embodiment. Figure 3 As shown, the following steps may be included:
[0096] Step 310: Determine a first candidate target product to be recommended to a target user according to the product recommendation model.
[0097] As mentioned above, the obtained product recommendation model can make product recommendations to users.
[0098] Step 320: Determine a second candidate target product to be recommended to the target user based on a preset backup product recommendation model.
[0099] The backup product recommendation model is a recommendation system established based on other methods, such as a recommendation system based on collaborative filtering and the like. Therefore, the backup product recommendation model can also be used to recommend products to users.
[0100] Step 330: If the first candidate target product and the second candidate target product are consistent, the first candidate target product or the second candidate target product is used as the target product, and the target product is recommended to the target user.
[0101] When the first candidate target product and the second candidate target product are consistent, it indicates that the accuracy of the recommendation by the product recommendation model is high. Therefore, the accuracy of the product recommended to the target user can be ensured.
[0102] Step 340: If the first candidate target product and the second candidate target product are inconsistent, one of the first candidate target product and the second candidate target product is selected as a target product, and the target product is recommended to a target user.
[0103] Since the recommendation mechanism of a single recommendation model is fixed and user preferences may be constantly changing, using a single recommendation model may recommend products that are not liked by users in some cases. In this embodiment, by adding a backup product recommendation model, only when the products recommended by the two product recommendation models are consistent, the products determined by the product recommendation model will be directly recommended to the user, thereby breaking the fixed mechanism and making it more likely that users will obtain their favorite products to a certain extent.
[0104] In one embodiment, selecting one of the first candidate target product and the second candidate target product as the target product includes: arbitrarily selecting one of the first candidate target product and the second candidate target product as the target product.
[0105] In one embodiment, selecting one of the first candidate target product and the second candidate target product as a target product includes: selecting one of the first candidate target product and the second candidate target product as a target product according to a preset probability, wherein the probability of selecting the first candidate target product is greater than the probability of selecting the second candidate target product.
[0106] Specifically, the probability of selecting the first candidate target product may be 0.6, and the probability of selecting the second candidate target product may be 0.4. The candidate target product may be selected according to probability by generating a random number. For example, a number in the interval [0,10] may be randomly generated. If the number is greater than 6, the second candidate target product is selected, otherwise, the first candidate target product is selected.
[0107] Since the accuracy of the product recommendation model is higher than that of the backup product recommendation model, this embodiment ensures the accuracy of the recommendation while breaking the rigid recommendation mechanism by making the probability of selecting the first candidate target product greater than the probability of selecting the second candidate target product.
[0108] In one embodiment, recommending a target product to a target user based on the product recommendation model includes: using the product recommended to the target user by the product recommendation model as a candidate recommended product; selecting a popular product belonging to a popular product list from the candidate recommended products, and recommending the selected popular product to the target user as a target product.
[0109] The popular products in the popular product list are products with large sales, such as products with monthly sales reaching a certain threshold. Therefore, selecting popular products belonging to the popular product list from the candidate recommended products is equivalent to determining the intersection of the candidate recommended products and the popular products in the popular product list. In this embodiment, by selecting the popular products as the target products from the products recommended by the model, the possibility of users liking the recommended products is further increased.
[0110] Step 280 , determining a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and the final weight value corresponding to each type of relationship path.
[0111] Specifically, for each type of relationship path, the number of relationship paths included in this type of relationship path is multiplied by the final weight value corresponding to this type of relationship path to obtain the weight score corresponding to this type of relationship path, and the relationship path with the largest corresponding weight score is used as the target relationship path. Therefore, the target relationship path reflects that it plays the greatest role in recommending the target product to the target user.
[0112] In addition, the various types of relationship paths may be sorted from large to small according to the corresponding weight scores, and a predetermined number of the various types of relationship paths that are ranked first may be used as target type relationship paths.
[0113] Step 290: Generate a recommendation reason based on the reason information corresponding to the target class relationship path, and output the recommendation reason.
[0114] The recommendation reason can be output together with the target product or separately from the target product. The recommendation reason can be output to the target user or to other users.
[0115] The reason information corresponding to each type of relationship path can be preset. For example, the reason information corresponding to the second type of relationship path mentioned above can be: the user's friends like the movie.
[0116] In one embodiment, generating a recommendation reason based on the reason information corresponding to the target class relationship path includes: using the reason information corresponding to the target class relationship path as a template, filling the template with information related to the target user and / or the target product to obtain a recommendation reason.
[0117] Specifically, the information related to the target user and / or the target product may include the name of the target user, the category of the target product, the percentage of the target user's friends who like the target product, and the like.
[0118] In this embodiment, the recommendation reasons are generated by filling the information into the template, so that the obtained recommendation reasons can conform to the reading habits of humans.
[0119] Figure 4 FIG. 1 is a flowchart of generating a recommendation reason according to an exemplary embodiment. Figure 4 As shown, the following steps are included:
[0120] Step 410: Generate an original recommendation reason according to the reason information corresponding to the target class relationship path.
[0121] The original reason for recommendation can be generated by filling the information into the template, which will not be repeated here.
[0122] Step 420, using the trained text rewriting model, rewrite the original recommendation reason to obtain the recommendation reason.
[0123] In some cases, the generated recommendation reasons may have problems such as grammatical errors, incoherent context, repeated expressions, etc. In this embodiment, by first using the model to rewrite the recommendation reasons and then outputting them, the output recommendation reasons can be grammatically standardized and more fluent.
[0124] In one embodiment, before using a trained text rewriting model to rewrite the original recommendation reason to obtain the recommendation reason, the method also includes: using a text data set to perform model training to obtain a trained text rewriting model, wherein the text data set includes the original text and the text after manually rewriting the original text.
[0125] Specifically, the original text and the manually rewritten text can be used to train a text rewriting model. The text rewriting model is trained by predicting the rewriting label, that is, each word is labeled with labels such as addition / deletion / modification, and trained using an end-to-end model. The model can use a Transformer-based text processing model. In this way, the text can be rewritten to generate a coherent recommendation reason.
[0126] In one embodiment, the method further includes: stopping recommending the target product to the target user based on the recommendation reason satisfying a predetermined condition.
[0127] The predetermined condition may be set based on experience, for example, when the recommendation reason contains a specified word, it is determined that the predetermined condition is satisfied.
[0128] In other words, in this embodiment, step 270 is executed first. During the execution of step 270, the target product can be determined first, and no recommendation is made. Then step 290 is executed to determine whether the generated recommendation reason satisfies the predetermined conditions to determine whether to execute the recommendation part in step 270. If the predetermined conditions are met, the recommendation part in step 270 is executed, otherwise the target product is no longer recommended.
[0129] In this embodiment, by controlling whether to recommend a target product based on a recommendation reason, the possibility of recommending an inappropriate product to a user is reduced.
[0130] In summary, according to the product recommendation method provided by the embodiment of the present disclosure, by first counting the paths of various types of relationship paths in the knowledge graph of the relationship between users and products, and then constructing a matrix based on the counting results, after adjusting the matrix using the initial weight value, on the one hand, the product recommendation model is trained using the spliced matrix obtained by splicing the adjusted matrices, and the target product is recommended to the target user through the product recommendation model. Based on the powerful reasoning ability of the knowledge graph, the training of the product recommendation model utilizes more extensive information, so that accurate personalized recommendations can be achieved; on the other hand, each initial weight value is also adjusted to obtain the final weight value, and the target class relationship path is determined according to the number of relationship paths and the final weight value. Finally, based on the reason information corresponding to the target class relationship path, a coherent recommendation reason is generated, which can make the recommendation result more explainable.
[0131] The present disclosure also provides a product recommendation device, and the following are device embodiments of the present disclosure.
[0132] Figure 5 FIG. 1 is a block diagram of a product recommendation device according to an exemplary embodiment. Figure 5 As shown, the device 500 includes:
[0133] The traversal module 510 is configured to traverse the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user-product pair, wherein each type of relationship path includes at least one relationship path;
[0134] The counting module 520 is configured to count the paths of each type of relationship path to obtain the number of relationship paths included in each type of relationship path;
[0135] A construction module 530 is configured to construct a matrix corresponding to each type of relationship path according to the number of relationship paths included in each type of relationship path;
[0136] The matrix adjustment module 540 is configured to adjust the elements in the matrix corresponding to each type of relationship path according to the initial weight values corresponding to each type of relationship path to obtain an adjusted matrix;
[0137] The splicing module 550 is configured to splice the adjusted matrices corresponding to various relationship paths to obtain a splicing matrix;
[0138] The training and adjustment module 560 is configured to train the neural network model according to the splicing matrix to obtain a product recommendation model, and adjust the initial weight values corresponding to each type of relationship path to obtain a final weight value;
[0139] A recommendation module 570 is configured to recommend a target product to a target user based on the product recommendation model;
[0140] The determination module 580 is configured to determine a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and the final weight value corresponding to each type of relationship path;
[0141] The generation module 590 is configured to generate a recommendation reason based on the reason information corresponding to the target class relationship path, and output the recommendation reason.
[0142] According to a third aspect of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0143] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0144] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 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.
[0145] like Figure 6As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0146] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.
[0147] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .
[0148] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0149] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0150] The electronic device 600 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650, such as communicating with a display unit 640. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0151] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0152] According to a fourth aspect of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present specification.
[0153] refer to Figure 7 As shown, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0154] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The 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 (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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.
[0155] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0156] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0157] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0158] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0159] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be performed without departing from its scope. The scope of the present invention is limited only by the appended claims.
Claims
1. A product recommendation method, characterized in that: The method comprises: Traversing the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user-product pair, wherein each type of relationship path includes at least one relationship path; For each type of relationship path, path counting is performed to obtain the number of relationship paths included in each type of relationship path; According to the number of relationship paths included in each type of relationship path, a matrix corresponding to each type of relationship path is constructed; According to the initial weight values corresponding to the various relationship paths, the elements in the matrix corresponding to the various relationship paths are adjusted to obtain an adjusted matrix; The adjusted matrices corresponding to various relationship paths are concatenated to obtain a concatenated matrix; The neural network model is trained according to the splicing matrix to obtain a product recommendation model, and the initial weight values corresponding to various relationship paths are adjusted to obtain final weight values; recommending a target product to a target user based on the product recommendation model; Determine a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and the final weight value corresponding to each type of relationship path; Based on the reason information corresponding to the target class relationship path, a recommendation reason is generated and the recommendation reason is output.
2. The method according to claim 1, characterized in that The neural network model is trained according to the splicing matrix to obtain a product recommendation model, and the initial weight values corresponding to various relationship paths are adjusted to obtain final weight values, including: The neural network model is trained according to the splicing matrix, and during the training process, the initial weight values corresponding to various relationship paths in the neural network model are adjusted to obtain final weight values.
3. The method according to claim 1, characterized in that: The recommending a target product to a target user based on the product recommendation model includes: Determining a first candidate target product to be recommended to a target user according to the product recommendation model; Determine a second candidate target product to be recommended to the target user based on a preset backup product recommendation model; If the first candidate target product and the second candidate target product are consistent, the first candidate target product or the second candidate target product is used as the target product, and the target product is recommended to the target user; If the first candidate target product and the second candidate target product are inconsistent, one of the first candidate target product and the second candidate target product is selected as a target product, and the target product is recommended to a target user.
4. The method according to claim 3, characterized in that The selecting one of the first candidate target product and the second candidate target product as a target product comprises: Select one of the first candidate target product and the second candidate target product as a target product according to a preset probability, wherein the probability of selecting the first candidate target product is greater than the probability of selecting the second candidate target product.
5. The method according to claim 1, characterized in that The recommending a target product to a target user based on the product recommendation model includes: taking the product recommended by the product recommendation model to the target user as a candidate recommended product; A hot product belonging to a hot product list is selected from the candidate recommended products, and the selected hot product is recommended to a target user as a target product.
6. The method according to claim 1, characterized in that The generating a recommendation reason based on the reason information corresponding to the target class relationship path includes: Using the reason information corresponding to the target class relationship path as a template, information related to the target user and / or the target product is filled into the template to obtain a recommendation reason.
7. The method according to claim 1, characterized in that The generating a recommendation reason based on the reason information corresponding to the target class relationship path includes: Generate an original recommendation reason according to the reason information corresponding to the target class relationship path; The original recommendation reason is rewritten using the trained text rewriting model to obtain the recommendation reason.
8. A product recommendation device, characterized in that: The device comprises: A traversal module is configured to traverse the user-product relationship knowledge graph to obtain multiple types of relationship paths corresponding to each user and product pair, wherein each type of relationship path includes at least one relationship path; A counting module is configured to count the paths of each type of relationship path to obtain the number of relationship paths included in each type of relationship path; A construction module is configured to construct a matrix corresponding to each type of relationship path according to the number of relationship paths included in each type of relationship path; The matrix adjustment module is configured to adjust the elements in the matrix corresponding to each type of relationship path according to the initial weight values corresponding to each type of relationship path to obtain an adjusted matrix; A splicing module is configured to splice the adjusted matrices corresponding to various relationship paths to obtain a splicing matrix; A training and adjustment module is configured to train the neural network model according to the splicing matrix to obtain a product recommendation model, and adjust the initial weight values corresponding to various relationship paths to obtain final weight values; A recommendation module, configured to recommend a target product to a target user based on the product recommendation model; A determination module is configured to determine a target class relationship path according to the number of relationship paths included in each type of relationship path corresponding to the target user and the target product and a final weight value corresponding to each type of relationship path; The generation module is configured to generate a recommendation reason based on the reason information corresponding to the target class relationship path, and output the recommendation reason.
9. A computer-readable program medium, characterized in that: The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
