Product recommendation method and device, electronic device, and storage medium
By constructing a co-occurrence matrix and hidden vector screening between customers and products, combined with the purchase prediction model, the problems of large amount of calculation and general accuracy in the existing technology are solved, and efficient and accurate product recommendations are achieved.
Patent Information
- Application Number
- CN202211499638.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-11-28
AI Technical Summary
When recommending products of interest to customers, the prior art has large calculation volume and average accuracy, and it is impossible to efficiently utilize computing resources.
By constructing a co-occurrence matrix between customers and products, identifying hidden vectors, filtering primary target products, and using pre-trained purchase prediction models to predict purchase probability, filtering selected target products to recommend to customers.
Effectively reduce the demand for computing resources, improve processing efficiency, and improve the accuracy of recommendations by considering model training of products that are interested in and uninterested by customers.
Smart Images

Figure CN115731000B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of product recommendation, and in particular to a product recommendation method and device, electronic equipment, and storage medium. Background Art
[0002] As the company continues to develop, the number and types of products it launches are also growing rapidly, so customers need to spend a lot of time to find the products they want to buy, which undoubtedly wastes a lot of customers' time and is not conducive to product marketing. Therefore, it is particularly important to effectively recommend products that suit their interests to customers.
[0003] The current method of recommending products that suit customers' interests is mainly based on the customer's personal information. A neural network model is trained based on the information of the products the customer has purchased and the products the user has browsed. Then, based on the information of each customer and each product, the trained neural network model is directly used to determine the products that each customer is interested in and recommend them to the customer.
[0004] However, due to the sheer volume of product data and the sheer number of customers, directly using the model to filter out products of interest to each customer is computationally intensive, requiring significant computing resources and resulting in relatively low efficiency. Furthermore, because the model training process only considers information about products that users might be interested in, the model's effectiveness is relatively limited. Summary of the Invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a product recommendation method and device, electronic device, and storage medium to solve the problems of excessive computational complexity and general accuracy of the results in the prior art.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a product recommendation method, comprising:
[0008] Obtain product purchase records of multiple target customers;
[0009] Based on the product purchase records of each target customer, construct a co-occurrence matrix between each target customer and each target product;
[0010] Determining, based on a co-occurrence matrix of each target customer and each target product, a latent vector corresponding to each target customer and a latent vector corresponding to each target product;
[0011] For each target customer, based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product, screen out a plurality of preliminary target products corresponding to the target customer from among the target products;
[0012] Based on the customer information of the target customer and the product information of each of the initially selected target products corresponding to the target customer, a pre-trained purchase prediction model is used to predict the purchase probability of each of the initially selected target products corresponding to the target customer; wherein the purchase prediction model is pre-trained using multiple positive samples and negative samples; the positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer; the negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer;
[0013] Based on the purchase probability of each of the initially selected target products corresponding to the target customer, a plurality of selected target products corresponding to the target customer are screened out from the initially selected target products corresponding to the target customer;
[0014] The selected target products corresponding to the target customers are recommended to the target customers.
[0015] Optionally, in the above-mentioned product recommendation method, determining the latent vector corresponding to each target customer and the latent vector corresponding to each target product based on the co-occurrence matrix of each target customer and each target product includes:
[0016] Decomposing the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix;
[0017] A latent vector corresponding to each target customer is extracted from the customer embedding matrix, and a latent vector corresponding to each target product is extracted from the product embedding matrix.
[0018] Optionally, in the above-mentioned product recommendation method, the step of screening out a plurality of preliminary target products corresponding to the target customer from the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product includes:
[0019] Calculating the distance between the target customer and each target product based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product;
[0020] Sort the target products in ascending order according to their distance from the target customers;
[0021] The target products ranked in the top N positions are determined as a plurality of preliminary target products corresponding to the target customers.
[0022] Optionally, in the above-mentioned product recommendation method, the method for training the purchase prediction model includes:
[0023] Obtaining user information of a plurality of the sample users, product information of a plurality of the sample products, historical purchase records of each of the sample users, and historical marketing records of each of the sample products;
[0024] Based on the historical purchase records of each of the sample users, user information of each of the sample users and product information of the sample products purchased by the sample users are respectively used to form the positive samples;
[0025] Based on the comparison results of the historical purchase records of each of the sample users and the historical marketing records of each of the sample products, the product information of each first sample product and the user information of the sample user corresponding to the first sample product are respectively used to form the negative sample; wherein the first sample product refers to the sample product recommended to the sample user but not purchased by the sample user; the sample user corresponding to the first sample product refers to the sample user to whom the first sample product was recommended but did not purchase the first sample product;
[0026] Based on the positive samples and the negative samples, the purchase prediction model is obtained by training using a random forest algorithm.
[0027] Optionally, in the above-mentioned product recommendation method, screening out a plurality of selected target products corresponding to the target customer from the respective preliminarily selected target products corresponding to the target customer based on the purchase probability of the respective preliminarily selected target products corresponding to the target customer includes:
[0028] Sort in descending order according to purchase probability to get the product sorting results;
[0029] According to the order of the preliminary selected target products corresponding to the target customer in the product ranking result, M preliminary selected target products that the target customer has not purchased are selected in sequence as the multiple selected target products corresponding to the target customer.
[0030] A second aspect of the present application provides a product recommendation device, comprising:
[0031] A record acquisition unit, used to acquire product purchase records of multiple target customers;
[0032] a matrix construction unit, configured to construct a co-occurrence matrix between each target customer and each target product based on the product purchase records of each target customer;
[0033] a decomposition unit, configured to determine a latent vector corresponding to each target customer and a latent vector corresponding to each target product based on a co-occurrence matrix of each target customer and each target product;
[0034] a preliminary selection unit, configured to screen, for each target customer, a plurality of preliminary selected target products corresponding to the target customer from among the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product;
[0035] a prediction unit configured to predict, based on the customer information of the target customer and the product information of each of the pre-selected target products corresponding to the target customer, a purchase probability of each of the pre-selected target products corresponding to the target customer using a pre-trained purchase prediction model; wherein the purchase prediction model is pre-trained using a plurality of positive samples and negative samples; the positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer; the negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer;
[0036] a selecting unit, configured to select a plurality of selected target products corresponding to the target customer from the respective initially selected target products corresponding to the target customer based on a purchase probability of the respective initially selected target products corresponding to the target customer;
[0037] The recommendation unit is used to recommend each of the selected target products corresponding to the target customer to the target customer.
[0038] Optionally, in the above-mentioned product recommendation device, the decomposition unit includes:
[0039] a matrix decomposition unit, configured to decompose the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix;
[0040] An extraction unit is used to extract a latent vector corresponding to each target customer from the customer embedding matrix, and to extract a latent vector corresponding to each target product from the product embedding matrix.
[0041] Optionally, in the above-mentioned product recommendation device, the preliminary selection unit includes:
[0042] a distance calculation unit, configured to calculate the distance between the target customer and each of the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each of the target products;
[0043] A first sorting unit, configured to sort the target products in ascending order according to their distance from the target customers;
[0044] The first selection unit is configured to determine the target products ranked in the top N positions as a plurality of preliminarily selected target products corresponding to the target customers.
[0045] Optionally, the above-mentioned product recommendation device further includes:
[0046] a data acquisition unit, configured to acquire user information of a plurality of the sample users, product information of a plurality of the sample products, historical purchase records of each of the sample users, and historical marketing records of each of the sample products;
[0047] A first composition unit is configured to respectively combine user information of each sample user and product information of the sample product purchased by the sample user into the positive sample based on the historical purchase record of each sample user;
[0048] The second component unit is configured to form the negative sample by combining the product information of each first sample product and the user information of the sample user corresponding to the first sample product based on a comparison result of the historical purchase record of each sample user and the historical marketing record of each sample product; wherein the first sample product refers to the sample product recommended to the sample user but not purchased by the sample user; and the sample user corresponding to the first sample product refers to the sample user to whom the first sample product was recommended but did not purchase the first sample product;
[0049] The model training unit is used to train the purchase prediction model using a random forest algorithm based on the positive samples and the negative samples.
[0050] Optionally, in the above-mentioned product recommendation device, the selection unit includes:
[0051] The second sorting unit is used to sort the products in descending order according to purchase probability to obtain product sorting results;
[0052] The second selection unit is used to select M of the preliminary target products that the target customer has not purchased as the multiple selected target products corresponding to the target customer in sequence according to the order of the preliminary target products corresponding to the target customer in the product ranking result.
[0053] A third aspect of the present application provides an electronic device, including:
[0054] memory and processor;
[0055] Wherein, the memory is used to store programs;
[0056] The processor is used to execute the program, and when the program is executed, it is specifically used to implement the product recommendation method as described in any one of the above items.
[0057] In a fourth aspect, the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement the product recommendation method as described in any one of the above.
[0058] The present application provides a product recommendation method, which first obtains the product purchase records of multiple target customers, then constructs a co-occurrence matrix of each target customer and each target product based on the product purchase records of each target customer, and determines the latent vector corresponding to each target customer and the latent vector corresponding to each target product based on the co-occurrence matrix of each target customer and each target product, so that for each target customer, based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product, multiple preliminary target products corresponding to the target customer can be screened from each target product, and then subsequently refined, thereby achieving a preliminary screening of a large amount of data through the latent vectors of customers and products, thereby effectively reducing the amount of data for subsequent calculations, reducing the demand for computing resources, and improving processing efficiency. Based on the customer information of the target customer and the product information of each preliminary target product corresponding to the target customer, a pre-trained purchase prediction model is used to predict the purchase probability of each preliminary target product corresponding to the target customer, and based on the purchase probability of each preliminary target product corresponding to the target customer, multiple selected target products corresponding to the target customer are screened from each preliminary target product corresponding to the target customer, and finally, each selected target product corresponding to the target customer is recommended to the target customer. Wherein, the purchase prediction model is pre-trained using multiple positive samples and negative samples. Positive samples include the customer information of a sample customer and the product information of a sample product purchased by the sample customer. Negative samples include the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased. Therefore, model training not only considers products that customers are interested in, but also products that customers are not interested in, which can effectively improve the accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0060] Figure 1 A flowchart of a product recommendation method provided in an embodiment of the present application;
[0061] Figure 2 A flowchart of a method for determining latent vectors of target customers, targets, and target products provided in an embodiment of the present application;
[0062] Figure 3 A flowchart of a method for screening a preliminary target product provided in an embodiment of the present application;
[0063] Figure 4 A flowchart of a method for training a purchase prediction model provided in an embodiment of the present application;
[0064] Figure 5 A flowchart of a method for screening and selecting target products provided in an embodiment of the present application;
[0065] Figure 6 A schematic diagram of the architecture of a product recommendation device provided in an embodiment of the present application;
[0066] Figure 7 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0068] In this application, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0069] The present application embodiment provides a product recommendation method, such as Figure 1 As shown, the following steps are included:
[0070] S101. Obtain product purchase records of multiple target customers.
[0071] Among them, multiple target customers can be all customers or a specified part of customers.
[0072] In this embodiment, the recall phase initially screens out products with a relatively high probability of purchase by certain customers, thereby reducing the amount of subsequent computation. However, during the recall phase, a customer-product co-occurrence matrix must be constructed. Therefore, it is necessary to determine whether a target customer has purchased a specific target product, and thus obtain the product purchase records of each target customer.
[0073] Optionally, the scope of the product purchase records to be obtained can be set according to needs, for example, the product purchase records of the last three months, or the product purchase records of the last six months, etc. can be obtained.
[0074] S102: Construct a co-occurrence matrix between each target customer and each target product based on the product purchase records of each target customer.
[0075] The target product can be the full product or a designated portion of the product that needs to be marketed.
[0076] Specifically, when constructing a co-occurrence matrix, for any target customer and any target product, if the target customer's product purchase record records that the target customer has purchased the target product, then in the co-occurrence matrix, the value at the intersection of the row and column where the target customer and the target product are located is 1; if the target customer's product purchase record does not record that the target customer has purchased the target product, then the value is 0.
[0077] S103 : Based on the co-occurrence matrix of each target customer and each target product, determine a latent vector corresponding to each target customer and a latent vector corresponding to each target product.
[0078] From the above, we can see that the co-occurrence matrix of each target customer and each target product is constructed based on the record of whether the target customer has purchased the target product. Therefore, the co-occurrence matrix can reflect the relationship between each target customer and the target product he will purchase to a certain extent. Therefore, by analyzing the corresponding latent vectors of the target customers and the latent vectors corresponding to the target products in the co-occurrence matrix, we can analyze the possibility of each target customer purchasing each target product based on the latent vectors corresponding to the target customers and the latent vectors corresponding to the target products, thereby achieving preliminary screening.
[0079] Optionally, in another embodiment of the present application, a specific implementation of step S103 is as follows: Figure 2 As shown, the following steps are included:
[0080] S201. Decompose the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix.
[0081] Specifically, in the embodiment of the present application, a k-dimensional latent vector is introduced to decompose the co-occurrence matrix, that is, to decompose it into the product of two low-dimensional small matrices. The co-occurrence matrix is simulated by these two small matrices, and these two small matrices are the customer embedding matrix and the product embedding matrix.
[0082] S202: Extract the latent vector corresponding to each target customer from the customer embedding matrix, and extract the latent vector corresponding to each target product from the product embedding matrix.
[0083] Specifically, the customer embedding matrix includes the latent vectors for each target customer, so we can extract a k-dimensional latent vector for each target customer from the customer embedding matrix, or directly analyze the customer embedding matrix to obtain the latent vectors for each target customer. Similarly, the product embedding matrix includes the latent vectors for each target product, so we can extract a k-dimensional latent vector for each target product from it, or directly analyze the product embedding matrix to obtain the latent vectors for each target product.
[0084] S104 , for each target customer, based on the latent vector corresponding to the target customer and the latent vectors corresponding to the target products, screen out a plurality of preliminarily selected target products corresponding to the target customer from the target products.
[0085] Since the co-occurrence matrix can reflect the relationship between each target customer and the target product they will purchase to a certain extent, the latent vector corresponding to a target customer and the latent vector corresponding to a target product can analyze the possibility of the target customer purchasing the target product to a certain extent. Therefore, based on this, target products with a higher purchase possibility can be screened out as the preliminary target products.
[0086] Optionally, in another embodiment of the present application, a specific implementation of step S104 is as follows: Figure 3 As shown, the following steps are included:
[0087] S301: Calculate the distance between the target customer and each target product based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product.
[0088] Since the latent vector corresponding to the target customer and the latent vector corresponding to the target product are marked in space, the closer the distance between the two, the more likely the target customer is to purchase the target product. Therefore, in this embodiment of the application, the distance between the target customer and each target product is calculated based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product, so that the distance can reflect the likelihood of the target customer purchasing each target product.
[0089] S302: sort the target products in ascending order according to their distance from the target customer.
[0090] S303: Determine the target products ranked in the top N positions as the multiple pre-selected target products corresponding to the target customer.
[0091] Since the closer the distance between the target customer and the target product, the greater the possibility that the target customer will purchase the target product, and the target products are sorted in ascending order according to the distance, that is, the target product with a higher ranking has a closer distance to the target customer, so in the embodiment of the present application, the target products ranked in the top N are selected as the multiple preliminary target products corresponding to the target customer.
[0092] Wherein, N is a positive integer. Optionally, N can be set as needed, or calculated according to a fixed ratio of the total number of target products.
[0093] S105 : Based on the customer information of the target customer and the product information of each initially selected target product corresponding to the target customer, a pre-trained purchase prediction model is used to predict the purchase probability of each initially selected target product corresponding to the target customer.
[0094] In an embodiment of the present application, through the previous supplementary recall stage, some target products are screened out from a large number of target products as multiple preliminary target products corresponding to the target customer. The screening accuracy of the previous recall stage is limited, and the number of screened target products is relatively large. Therefore, it is necessary to subsequently use a neural network model to fine-rank the various preliminary target products corresponding to the target customer. After the preliminary screening in the previous recall stage, the amount of data that needs to be fine-ranked can be effectively reduced, thereby reducing the demand for computing resources and improving processing efficiency.
[0095] It should be noted that in the embodiments of the present application, the purchase prediction model is pre-trained using multiple positive and negative samples. The positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer. The negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer.
[0096] Therefore, in this embodiment of the application, not only products that customers have purchased or are willing to purchase are considered, but also products that customers will not purchase. This allows for more effective analysis of whether customers are interested in a product, thereby effectively improving the accuracy of the purchase prediction model. Because it is possible to obtain clear and direct negative customer feedback on products, such as dislike or low-frequency ratings, this embodiment of the application defines samples that were marketed but not purchased by customers as negative samples.
[0097] Specifically, the customer information of the target customer and the product information of each initially selected target product corresponding to the target customer are output to a pre-trained purchase prediction model, and the purchase probability of each initially selected target product corresponding to the target customer is calculated through the purchase prediction model.
[0098] Optionally, in another embodiment of the present application, a training method for a prediction model is purchased, such as Figure 4 As shown, including:
[0099] S401: Obtain user information of multiple sample users, product information of multiple sample products, historical purchase records of each sample user, and historical marketing records of each sample product.
[0100] S402 : Based on the historical purchase records of each sample user, the user information of each sample user and the product information of the sample product purchased by the sample user are respectively combined into positive samples.
[0101] S403: Based on the comparison results of the historical purchase records of each sample user and the historical marketing records of each sample product, the product information of each first sample product and the user information of the sample user corresponding to the first sample product are combined into a negative sample.
[0102] It should be noted that, since in the embodiment of the present application, samples that have been marketed but not purchased by customers are defined as negative samples, by comparing the historical purchase records of each sample user with the historical marketing records of each sample product, it is possible to determine which sample products have influenced customers, but there are no relevant records in the purchase records of the sample users, that is, the sample users did not purchase the products.
[0103] The first sample product refers to a sample product recommended to a sample user but not purchased by the sample user, and the sample user corresponding to the first sample product refers to a sample user to whom the first sample product is recommended but who does not purchase the first sample product.
[0104] Optionally, in order to better capture features and distinguish whether a customer is interested in a certain product, the data volume of positive and negative samples corresponding to each sample product is preferably controlled at 1:1.
[0105] S404: Based on the positive samples and the negative samples, a purchase prediction model is obtained by training using a random forest algorithm.
[0106] Specifically, in the embodiment of the present application, a random forest algorithm is used, product information and customer information are introduced as explanatory variables, and flushing training is performed through a large number of positive samples and negative samples obtained to construct a purchase prediction model.
[0107] S106 : Based on the purchase probability of each of the initially selected target products corresponding to the target customer, a plurality of selected target products corresponding to the target customer are screened out from the initially selected target products corresponding to the target customer.
[0108] Among them, the purchase probability of each preliminary target product corresponding to the target customer is the purchase probability of the target customer purchasing each preliminary target product, so the target products with relatively high purchase probability can be preferentially screened out as selected target products to recommend them to the target customer.
[0109] Optionally, in another embodiment of the present application, a specific implementation of step S106 is as follows: Figure 5 As shown, including:
[0110] S501. Sort in descending order according to purchase probability to obtain product sorting results.
[0111] S502 . According to the order of the preliminary target products corresponding to the target customer in the product ranking result, sequentially select M preliminary target products that the target customer has not purchased as the multiple selected target products corresponding to the target customer.
[0112] It should be noted that since a customer typically retains a purchase record for a target product that they have already purchased, if the customer wishes to repurchase, they can do so based on the purchase record. Therefore, in this embodiment, the primary focus is on recommending products to customers that they have not purchased. To ensure that target products of interest are recommended to target customers and to increase their purchase rate, it is necessary to prioritize recommending target products with a high purchase probability.
[0113] Therefore, specifically, in an embodiment of the present application, each preliminary target product is polled in sequence according to the product sorting results. If the target customer has not purchased the preliminary target product polled, it will be determined as the selected target product. If the target customer has purchased the preliminary target product polled, the next preliminary target product will be polled until the number of selected target products screened out reaches M.
[0114] Optionally, the target product that the target customer has not purchased may refer to a target product that the target customer has not purchased within a previous preset time range, and is not limited to a target product that the target customer has never purchased from the beginning.
[0115] Here, M can be a fixed value set according to demand, or a value that changes dynamically according to factors such as the number of initially selected target products.
[0116] S107: Recommend the selected target products corresponding to the target customers to the target customers.
[0117] The embodiment of the present application provides a product recommendation method, which first obtains the product purchase records of multiple target customers, then constructs a co-occurrence matrix of each target customer and each target product based on the product purchase records of each target customer, and determines the latent vector corresponding to each target customer and the latent vector corresponding to each target product based on the co-occurrence matrix of each target customer and each target product, so that for each target customer, based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product, multiple preliminary target products corresponding to the target customer can be screened from each target product, and then subsequently refined, thereby achieving a preliminary screening of a large amount of data through the latent vectors of customers and products, thereby effectively reducing the amount of data for subsequent calculations, reducing the demand for computing resources, and improving processing efficiency. Based on the customer information of the target customer and the product information of each preliminary target product corresponding to the target customer, a pre-trained purchase prediction model is used to predict the purchase probability of each preliminary target product corresponding to the target customer, and based on the purchase probability of each preliminary target product corresponding to the target customer, multiple selected target products corresponding to the target customer are screened from each preliminary target product corresponding to the target customer, and finally, each selected target product corresponding to the target customer is recommended to the target customer. Wherein, the purchase prediction model is pre-trained using multiple positive samples and negative samples. Positive samples include the customer information of a sample customer and the product information of a sample product purchased by the sample customer. Negative samples include the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased. Therefore, model training not only considers products that customers are interested in, but also products that customers are not interested in, which can effectively improve the accuracy of the model.
[0118] Another embodiment of the present application provides a product recommendation device, such as Figure 6 As shown, it includes the following units:
[0119] The record acquisition unit 601 is used to acquire product purchase records of multiple target customers.
[0120] The matrix construction unit 602 is configured to construct a co-occurrence matrix between each target customer and each target product based on the product purchase records of each target customer.
[0121] The decomposition unit 603 is configured to determine a latent vector corresponding to each target customer and a latent vector corresponding to each target product based on the co-occurrence matrix of each target customer and each target product.
[0122] The preliminary selection unit 604 is configured to select, for each target customer, a plurality of preliminary selected target products corresponding to the target customer from among the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product.
[0123] The prediction unit 605 is configured to predict the purchase probability of each of the initially selected target products corresponding to the target customer using a pre-trained purchase prediction model based on the customer information of the target customer and the product information of each of the initially selected target products corresponding to the target customer.
[0124] The purchase prediction model is pre-trained using multiple positive and negative samples. A positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer. A negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer.
[0125] The selecting unit 606 is configured to select a plurality of selected target products corresponding to the target customer from the various initially selected target products corresponding to the target customer based on the purchase probability of the various initially selected target products corresponding to the target customer.
[0126] The recommendation unit 607 is configured to recommend each selected target product corresponding to the target customer to the target customer.
[0127] Optionally, in a product recommendation device provided in another embodiment of the present application, the decomposition unit includes:
[0128] The matrix decomposition unit is used to decompose the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix.
[0129] The extraction unit is used to extract the latent vector corresponding to each target customer from the customer embedding matrix, and to extract the latent vector corresponding to each target product from the product embedding matrix.
[0130] Optionally, in a product recommendation device provided in another embodiment of the present application, the preliminary selection unit includes:
[0131] The distance calculation unit is used to calculate the distance between the target customer and each target product based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product.
[0132] The first sorting unit is used to sort each target product in ascending order according to the distance from the target customer.
[0133] The first selection unit is used to determine the target products ranked in the top N positions as a plurality of preliminary target products corresponding to the target customers.
[0134] Optionally, in another embodiment of the present application, the product recommendation device further includes:
[0135] The data acquisition unit is used to acquire user information of multiple sample users, product information of multiple sample products, historical purchase records of each sample user, and historical marketing records of each sample product.
[0136] The first composition unit is configured to compose positive samples from user information of each sample user and product information of a sample product purchased by the sample user based on the historical purchase records of each sample user.
[0137] The second component unit is used to form negative samples by combining the product information of each first sample product and the user information of the sample user corresponding to the first sample product based on the comparison results of the historical purchase records of each sample user and the historical marketing records of each sample product.
[0138] The first sample product refers to a sample product that is recommended to a sample user but not purchased by the sample user. The sample user corresponding to the first sample product refers to a sample user to whom the first sample product is recommended but who does not purchase the first sample product.
[0139] The model training unit is used to train a purchase prediction model using a random forest algorithm based on positive samples and negative samples.
[0140] Optionally, in the product recommendation device provided in another embodiment of the present application, the selection unit includes:
[0141] The second sorting unit is used to sort the products in descending order according to purchase probability to obtain a product sorting result.
[0142] The second selection unit is used to select M preliminary target products that the target customer has not purchased as the multiple selected target products corresponding to the target customer in sequence according to the order of the preliminary target products corresponding to the target customer in the product sorting result.
[0143] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the implementation process of the corresponding steps in the above method embodiments, and will not be repeated here.
[0144] Another embodiment of the present application provides an electronic device, such as Figure 7 As shown, including:
[0145] Memory 701 and processor 702 .
[0146] The memory 701 is used to store programs.
[0147] The processor 702 is used to execute the program stored in the memory 701. When the program is executed, it is specifically used to implement the product recommendation method provided in any of the above embodiments.
[0148] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement the product recommendation method provided in any of the above embodiments.
[0149] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0150] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0151] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A product recommendation method, characterized in that: include: Obtain product purchase records of multiple target customers; Based on the product purchase records of each target customer, construct a co-occurrence matrix between each target customer and each target product; Determining, based on the co-occurrence matrix of each target customer and each target product, a latent vector corresponding to each target customer and a latent vector corresponding to each target product; For each target customer, based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product, screen out a plurality of preliminary target products corresponding to the target customer from among the target products; Based on the customer information of the target customer and the product information of each of the initially selected target products corresponding to the target customer, a pre-trained purchase prediction model is used to predict the purchase probability of each of the initially selected target products corresponding to the target customer; wherein the purchase prediction model is pre-trained using multiple positive samples and negative samples; the positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer; the negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer; Based on the purchase probability of each of the initially selected target products corresponding to the target customer, a plurality of selected target products corresponding to the target customer are screened out from the initially selected target products corresponding to the target customer; The selected target products corresponding to the target customers are recommended to the target customers.
2. The method according to claim 1, characterized in that The determining, based on the co-occurrence matrix of each target customer and each target product, a latent vector corresponding to each target customer and a latent vector corresponding to each target product includes: Decomposing the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix; A latent vector corresponding to each target customer is extracted from the customer embedding matrix, and a latent vector corresponding to each target product is extracted from the product embedding matrix.
3. The method according to claim 1, characterized in that The step of screening out a plurality of preliminarily selected target products corresponding to the target customer from the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product includes: Calculating the distance between the target customer and each target product based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product; Sort the target products in ascending order according to their distance from the target customers; The target products ranked in the top N positions are determined as a plurality of preliminary target products corresponding to the target customers.
4. The method according to claim 1, wherein The training method of the purchase prediction model includes: Obtaining customer information of a plurality of the sample customers, product information of a plurality of the sample products, historical purchase records of each of the sample customers, and historical marketing records of each of the sample products; Based on the historical purchase records of each of the sample customers, the customer information of each of the sample customers and the product information of the sample products purchased by the sample customers are respectively used to form the positive samples; Based on the comparison results of the historical purchase records of each of the sample customers and the historical marketing records of each of the sample products, the product information of each first sample product and the customer information of the sample customer corresponding to the first sample product are respectively used to form the negative sample; wherein the first sample product refers to the sample product recommended to the sample customer but not purchased by the sample customer; the sample customer corresponding to the first sample product refers to the sample customer to whom the first sample product was recommended but did not purchase the first sample product; Based on the positive samples and the negative samples, the purchase prediction model is obtained by training using a random forest algorithm.
5. The method according to claim 1, wherein The selecting a plurality of selected target products corresponding to the target customer from the respective preliminarily selected target products corresponding to the target customer based on the purchase probability of the respective preliminarily selected target products corresponding to the target customer comprises: Sort in descending order according to purchase probability to get the product sorting results; According to the order of the preliminary selected target products corresponding to the target customer in the product ranking result, M preliminary selected target products that the target customer has not purchased are selected in sequence as the multiple selected target products corresponding to the target customer.
6. A product recommendation device, characterized in that: include: A record acquisition unit, used to acquire product purchase records of multiple target customers; a matrix construction unit, configured to construct a co-occurrence matrix between each target customer and each target product based on the product purchase records of each target customer; a decomposition unit, configured to determine a latent vector corresponding to each target customer and a latent vector corresponding to each target product based on a co-occurrence matrix of each target customer and each target product; a preliminary selection unit, configured to screen, for each target customer, a plurality of preliminary selected target products corresponding to the target customer from among the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each target product; a prediction unit configured to predict, based on the customer information of the target customer and the product information of each of the pre-selected target products corresponding to the target customer, a purchase probability of each of the pre-selected target products corresponding to the target customer using a pre-trained purchase prediction model; wherein the purchase prediction model is pre-trained using a plurality of positive samples and negative samples; the positive sample includes the customer information of a sample customer and the product information of a sample product purchased by the sample customer; the negative sample includes the customer information of a sample customer and the product information of a sample product recommended to the sample customer but not purchased by the sample customer; a selecting unit, configured to select a plurality of selected target products corresponding to the target customer from the respective initially selected target products corresponding to the target customer based on a purchase probability of the respective initially selected target products corresponding to the target customer; The recommendation unit is used to recommend each of the selected target products corresponding to the target customer to the target customer.
7. The device according to claim 6, characterized in that The decomposition unit comprises: a matrix decomposition unit, configured to decompose the co-occurrence matrix of each target customer and each target product to obtain a customer embedding matrix and a product embedding matrix; An extraction unit is used to extract a latent vector corresponding to each target customer from the customer embedding matrix, and to extract a latent vector corresponding to each target product from the product embedding matrix.
8. The device according to claim 6, characterized in that The primary selection unit includes: a distance calculation unit, configured to calculate the distance between the target customer and each of the target products based on the latent vector corresponding to the target customer and the latent vector corresponding to each of the target products; A first sorting unit, configured to sort the target products in ascending order according to their distance from the target customers; The first selection unit is configured to determine the target products ranked in the top N positions as a plurality of preliminarily selected target products corresponding to the target customers.
9. An electronic device, characterized in that: include: memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the product recommendation method according to any one of claims 1 to 5.
10. A computer storage medium, characterized in that Used to store a computer program, which, when executed, is used to implement the product recommendation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Recommended method, apparatus and device, and storage medium
CN107273438A
Product recommendation method and device based on collaborative filtering, equipment and storage medium
CN114168862A