Item recommendation data processing method, device and storage medium
By building a training model and using the interactive data of users and items for training, the problems of data sparsity and deviation in the recommendation system are solved, and more accurate and robust item recommendation effects are achieved.
Patent Information
- Application Number
- CN202210110852.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-01-29
AI Technical Summary
The existing recommendation system has problems with data sparsity and data deviation, resulting in poor recommendation results.
By building a training model, using the user set, the positive sample set of items and the negative sample set of items for training, the item recommendation model is obtained, and the negative sample set of items is input into the model to obtain the recommended results.
It solves the problem of data sparsity, enhances the anti-interference ability of recommendations, alleviates the problem of data deviation, and improves the accuracy and robustness of recommendations.
Smart Images

Figure CN114463090B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of data analysis technology, and specifically to an item recommendation data processing method, device and storage medium. Background Art
[0002] Existing recommendation systems have long had the following problems: (1) Data sparsity: Each user interacts with only a small number of items. Compared with the huge set of candidate items, the data is very sparse; (2) Data bias: Most recommendation system data sets come from implicit feedback (such as clicks, purchases, etc.). User needs are unclear, and the location, popularity, and exposure of items will affect item clicks, interfering with users' real preferences. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide an item recommendation data processing method, device and storage medium in view of the deficiencies in the prior art.
[0004] The technical solution of the present invention to solve the above technical problem is as follows: A method for processing item recommendation data comprises the following steps:
[0005] Importing a data set to be processed, wherein the data set to be processed includes a user set, an item positive sample set, and an item negative sample set;
[0006] Constructing a training model, and training the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model;
[0007] The item negative sample set is input into the item recommendation model, and an item recommendation result is obtained according to the item recommendation model.
[0008] Another technical solution of the present invention to solve the above technical problem is as follows: an item recommendation data processing device, comprising:
[0009] A data set import module is used to import a data set to be processed, wherein the data set to be processed includes a user set, a positive sample set of items, and a negative sample set of items;
[0010] A model training module is used to construct a training model, and train the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model;
[0011] The item recommendation result obtaining module is used to input the item negative sample set into the item recommendation model and obtain the item recommendation result according to the item recommendation model.
[0012] Another technical solution of the present invention to solve the above-mentioned technical problem is as follows: an item recommendation data processing device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the item recommendation data processing method as described above is implemented.
[0013] Another technical solution of the present invention to solve the above technical problem is as follows: a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the item recommendation data processing method as described above is implemented.
[0014] The beneficial effects of the present invention are as follows: by constructing a training model, an item recommendation model is obtained by training the training model according to a user set, an item positive sample set and an item negative sample set, the item negative sample set is input into the item recommendation model, and an item recommendation result is obtained according to the item recommendation model, thereby solving the problem of data sparsity, enhancing the anti-interference ability of the recommendation, and alleviating the problem of data bias. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a method for processing item recommendation data provided by an embodiment of the present invention;
[0016] Figure 2 A module block diagram of an item recommendation data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0018] Figure 1 A flowchart of a method for processing item recommendation data provided by an embodiment of the present invention.
[0019] like Figure 1 As shown, a method for processing item recommendation data includes the following steps:
[0020] Importing a data set to be processed, wherein the data set to be processed includes a user set, an item positive sample set, and an item negative sample set;
[0021] Constructing a training model, and training the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model;
[0022] The item negative sample set is input into the item recommendation model, and an item recommendation result is obtained according to the item recommendation model.
[0023] It should be understood that a data set (i.e., the data set to be processed) is defined and the embedding vector representations of users and items are initialized.
[0024] It should be understood that the best item is selected from the candidate items (ie, the item negative sample set) for recommendation.
[0025] Specifically, through the historical interaction records of users and products, all users and products are sorted and marked with digital IDs to obtain:
[0026] The user set U={u1,u2,u3···u n}, indicating n users;
[0027] Item set I = {i1,i2,i3...i m}, indicating m items;
[0028] Positive sample set (i.e., the positive sample set of the item) + ={(u,i + )|u∈U,i + ∈I}, (u,i) represents that user u and item i interact, that is, user u likes item i;
[0029] Candidate sample set (i.e., the negative sample set of the item) - ={i - ∈I}, the set of items with which the user has no interaction.
[0030] In the above embodiment, by constructing a training model, an item recommendation model is obtained by training the training model according to a user set, an item positive sample set and an item negative sample set, the item negative sample set is input into the item recommendation model, and the item recommendation result is obtained according to the item recommendation model, thereby solving the problem of data sparsity, enhancing the anti-interference ability of the recommendation, and alleviating the problem of data bias.
[0031] Optionally, as an embodiment of the present invention, the user set includes a plurality of user data, the item positive sample set includes a plurality of item positive sample data corresponding to each of the user data, and the item negative sample set includes a plurality of item negative sample data corresponding to each of the user data; the process of constructing a training model, training the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model includes:
[0032] S21: performing random initialization processing on each user data to obtain a user initial vector corresponding to each user data;
[0033] S22: performing random initialization processing on each of the positive sample data of the item to obtain a plurality of initial vectors of positive sample of the item corresponding to each of the user data;
[0034] S23: performing random initialization processing on each of the negative sample data of the item to obtain a plurality of initial vectors of the negative sample of the item corresponding to each of the user data;
[0035] S24: Encode each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data respectively to obtain a first user target vector corresponding to each of the user data and a second user target vector corresponding to each of the user data;
[0036] S25: Calculate the total loss value for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain a total loss value;
[0037] S26: updating the parameters of all user initial vectors, all item positive sample initial vectors and all item negative sample initial vectors according to the total loss value, and returning to step S24 until a preset number of iterations is reached, and then executing step S27;
[0038] S27: Filter the minimum value of all the total loss values to obtain the minimum total loss value, and use the training model corresponding to the minimum total loss value as the item recommendation model.
[0039] It should be understood that the random initialization processing steps of step S21, step S22 and step S23 are the same, and only different data are substituted into the random initialization processing steps for processing.
[0040] It should be understood that the random initialization process is to represent a random vector as a user or an item, and each number in the vector is randomly generated, just like randomly obtaining a number from 100; the random initialization process can be implemented by the Xavier function, that is, using Xavier to initialize the embedded vector.
[0041] It should be understood that the preset number of iterations may be 100.
[0042] It should be understood that the loss value (i.e., the total loss value) of each round is calculated and recorded, and the model (i.e., the training model) with the smallest loss value (i.e., the total loss value) is selected as the item recommendation model.
[0043] Specifically, an encoder and data enhancement are used to encode the original vector (i.e., the user initial vector or the item positive sample initial vector or the item negative sample initial vector) to obtain a final vector representation (i.e., the first user target vector or the second user target vector); a training task is defined, and an objective function (i.e., the total loss value) is calculated through the final vector representation (i.e., the first user target vector or the second user target vector); and a model is trained according to the objective function (i.e., the total loss value) until convergence.
[0044] It should be understood that all users (or items) are matched one-to-one with a randomly initialized n-dimensional embedding vector, and a dictionary set E (i.e., the user initial vector or the item positive sample initial vector or the item negative sample initial vector) from which the embedding vector can be retrieved by id is constructed, for example, E(u1) = e u1 .
[0045] Specifically, the Loss value (i.e., the total loss value) is calculated through the forward propagation algorithm. In order to make the Loss value (i.e., the total loss value) continuously decrease, the e in the vector dictionary set is updated through the back propagation algorithm. u (i.e. the user initial vector) and e i (i.e., the initial vector of the positive sample of the item or the initial vector of the negative sample of the item), and repeat step S24 until the Loss value (i.e., the total loss value) no longer decreases.
[0046] It should be understood that this recommendation algorithm solves the data sparsity problem by aggregating the information of positive samples that interact with the user into the vector representation of the user itself. By comparing different vector representations of the same user, the anti-interference ability of the recommendation system is enhanced and the problem of data bias is alleviated.
[0047] In the above embodiment, a training model is constructed, and an item recommendation model is obtained by training the training model based on a user set, an item positive sample set, and an item negative sample set, which solves the problem of data sparsity, enhances the anti-interference ability of the recommendation, and alleviates the problem of data bias.
[0048] Optionally, as an embodiment of the present invention, the process of step S24 includes:
[0049] Calculating the first user target vector for each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data, respectively, to obtain the first user target vector corresponding to each of the user data;
[0050] Randomly deleting a plurality of initial vectors of positive samples of items corresponding to each of the user data, respectively, to obtain a plurality of initial vectors of positive samples of items after deletion corresponding to each of the user data;
[0051] The second user target vector is calculated for each of the user initial vectors and a plurality of deleted item positive sample initial vectors corresponding to each of the user data, to obtain a second user target vector corresponding to each of the user data.
[0052] It should be understood that the first user target vector is the result of data processing of the user initial vector and the item positive sample initial vector, and the second user target vector is the result of data processing of the user initial vector and the deleted item positive sample initial vector.
[0053] It should be understood that the data enhancement method is used to randomly delete several positive samples (i.e., the initial vector of the positive samples of the item) from all positive samples that have interacted with a certain user u (i.e., the initial vector of the positive samples of the item), thereby obtaining the initial vector of the positive samples of the item after deletion.
[0054] It should be understood that the data enhancement method solves the problem of data sparsity in the recommendation system and improves the accuracy and robustness of the recommendation.
[0055] In the above embodiment, the first user target vector and the second user target vector are obtained by respectively encoding each user initial vector and multiple item positive sample initial vectors, which solves the problem of data sparsity in the recommendation process and improves the accuracy and robustness of the recommendation.
[0056] Optionally, as an embodiment of the present invention, the process of calculating the first user target vector for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data to obtain the first user target vector corresponding to each of the user data includes:
[0057] The first user target vector is calculated for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data through the first formula to obtain the first user target vector corresponding to each of the user data. The first formula is:
[0058] E u1 = k·e u +(1-k)·W1N u1 ,
[0059] Among them, N u1 =∑ i1+ W2E i1 ,
[0060] Among them, E u1 is the first user target vector, k is a trainable variable, W1 and W2 are both trainable weight matrices, e u is the user initial vector of user u, ei1 is the initial vector of positive samples of item i, N u1 is the sum of the initial vectors of all positive samples of items that have interacted with user u.
[0061] It should be understood that the user's final vector E u (ie, the first user target vector) is encoded by the user (ie, the user initial vector) and the item initial vector (ie, the item positive sample initial vector).
[0062] It should be understood that N u (ie, the N u1 ) is composed of all positive sample items i that have interacted with a user u. + The vector (i.e., the initial vector of the positive sample of the item) is calculated, k is a trainable variable, and W1 and W2 are trainable weight matrices.
[0063] In the above embodiment, the first user target vector is calculated for each user initial vector and the first user target vector of multiple item positive sample initial vectors through the first formula, which provides a basis for subsequent data processing and improves the accuracy and robustness of recommendation.
[0064] Optionally, as an embodiment of the present invention, the process of calculating the second user target vector for each of the user initial vectors and the multiple deleted item positive sample initial vectors corresponding to each of the user data to obtain the second user target vector corresponding to each of the user data includes:
[0065] The second user target vector is calculated for each of the user initial vectors and the multiple deleted item positive sample initial vectors corresponding to each of the user data by the second formula to obtain the second user target vector corresponding to each of the user data. The second formula is:
[0066] E u2 = k·e u +(1-k)·W1N u2 ,
[0067] Among them, N u2 =∑ i2 +W2e i2 ,
[0068] Among them, E u2 is the second user target vector, k is a trainable variable, W1 and W2 are both trainable weight matrices, e u is the user initial vector of user u, e i2 is the initial vector of positive samples of item i after deletion, N u2 is the sum of the initial vectors of all deleted item positive samples that have interacted with user u.
[0069] It should be understood that the user's final vector E u (ie, the second user target vector) is obtained by encoding the user (ie, the user initial vector) and the item initial vector (ie, the deleted item positive sample initial vector).
[0070] It should be understood that N u (ie, the N u2 ) is composed of all positive sample items i that have interacted with a user u. + The vector (i.e., the initial vector of the positive sample of the deleted item) is calculated, k is a trainable variable, and W1 and W2 are trainable weight matrices.
[0071] In the above embodiment, the second user target vector is calculated by the second formula for each user initial vector and the second user target vector of multiple deleted item positive sample initial vectors, which solves the problem of data sparsity in the recommendation process and improves the accuracy and robustness of the recommendation.
[0072] Optionally, as an embodiment of the present invention, the process of step S25 includes:
[0073] The total loss value is calculated by the third formula for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain the total loss value. The third formula is:
[0074] Loss = Loss1 + w * Loss2,
[0075] in,
[0076] Among them, S ui =cos(E u1 ,e i1 ), S uj =cos(E u1 ,e j ),
[0077] Among them, Loss is the total loss value, Loss1 is the first loss value, Loss2 is the second loss value, w is the weight parameter, U is the total number of user data, E u1 is the first user target vector of user u, E u2 is the second user target vector of user u, E v is the first user target vector of user v, τ is the preset parameter, O+ is the total number of positive sample data of items, O - is the total number of negative sample data of items, p and q are both preset thresholds, S uiis the similarity between the first user target vector of user u and the initial vector of the positive sample of item i, e i1 is the initial vector of positive samples of item i, S uj is the similarity between the first user target vector of user u and the initial vector of the negative sample of item j, e j is the initial vector of negative samples of item j, and cos() is the cosine similarity function.
[0078] Specifically, different vector representations of the same user tend to be consistent, and different vector representations of different users tend to be dispersed, so the objective function is as follows:
[0079]
[0080] Among them, E u1 ,E u2 are different vector representations of the same user u, E v is the vector representation of other users v, τ is a manually set parameter, and cos() represents the cosine similarity function.
[0081] The user has a higher vector similarity with the positive sample i and a lower similarity with the candidate sample j. The candidate sample is extracted from the candidate sample set. The objective function is as follows:
[0082] S ui =cos(E u ,e i ),
[0083] S uj =cos(E u ,e j ),
[0084]
[0085] Among them, p and q are manually set parameters used to adjust the proportion of negative samples.
[0086] Then the overall objective function is Loss = Loss1 + w*Loss2, where w is the weight parameter.
[0087] It should be understood that in the candidate sample set (i.e., the item negative sample set), the one with the highest similarity to user u (i.e., S uj The sample j with the largest value is recommended to the user.
[0088] In the above embodiment, the total loss value is calculated by the third formula for the total loss values of all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors, thereby realizing personalized recommendations for users, solving the problem of data sparsity in the recommendation system, and improving the accuracy and robustness of recommendations.
[0089] Optionally, as another embodiment of the present invention, the present invention uses the historical interaction records between users and commodities to infer the user's preference for other commodities, thereby realizing personalized recommendations for users. The data enhancement method solves the problem of data sparsity in the recommendation system and improves the accuracy and robustness of recommendations.
[0090] Figure 2 A module block diagram of an item recommendation data processing device provided by an embodiment of the present invention.
[0091] Optionally, as another embodiment of the present invention, Figure 2 As shown, an item recommendation data processing device includes:
[0092] A data set import module is used to import a data set to be processed, wherein the data set to be processed includes a user set, a positive sample set of items, and a negative sample set of items;
[0093] A model training module is used to construct a training model, and train the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model;
[0094] The item recommendation result obtaining module is used to input the item negative sample set into the item recommendation model and obtain the item recommendation result according to the item recommendation model.
[0095] Optionally, as an embodiment of the present invention, the user set includes a plurality of user data, the item positive sample set includes a plurality of item positive sample data corresponding to each of the user data, and the item negative sample set includes a plurality of item negative sample data corresponding to each of the user data; and the model training module is specifically used for:
[0096] Performing random initialization processing on each of the user data to obtain a user initial vector corresponding to each of the user data;
[0097] Each of the positive sample data of the item is randomly initialized to obtain a plurality of initial vectors of positive sample of the item corresponding to each of the user data;
[0098] Each of the negative sample data of the item is randomly initialized to obtain a plurality of initial vectors of negative sample of the item corresponding to each of the user data;
[0099] Encode each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data respectively, to obtain a first user target vector corresponding to each of the user data and a second user target vector corresponding to each of the user data;
[0100] Calculate the total loss value for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain a total loss value;
[0101] According to the total loss value, parameters of all user initial vectors, all item positive sample initial vectors and all item negative sample initial vectors are updated, and the updated user initial vectors and the updated item positive sample initial vectors are encoded again until a preset number of iterations is reached. The minimum value of all the total loss values is screened to obtain the minimum total loss value, and the training model corresponding to the minimum total loss value is used as the item recommendation model.
[0102] Optionally, another embodiment of the present invention provides an item recommendation data processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the item recommendation data processing method described above is implemented. The device may be a computer or other device.
[0103] Optionally, another embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the item recommendation data processing method as described above is implemented.
[0104] It should be noted that, in this article, relational terms such as first and second, etc. are only used 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 "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0107] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0108] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for processing item recommendation data, characterized in that: The steps include: Importing a data set to be processed, wherein the data set to be processed includes a user set, an item positive sample set, and an item negative sample set; Constructing a training model, and training the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model; Inputting the item negative sample set into the item recommendation model, and obtaining an item recommendation result according to the item recommendation model; The user set includes a plurality of user data, the item positive sample set includes a plurality of item positive sample data corresponding to each of the user data, and the item negative sample set includes a plurality of item negative sample data corresponding to each of the user data; the process of constructing a training model, training the training model according to the user set, the item positive sample set and the item negative sample set to obtain an item recommendation model includes: S21: performing random initialization processing on each user data to obtain a user initial vector corresponding to each user data; S22: performing random initialization processing on each of the positive sample data of the item to obtain a plurality of initial vectors of the positive sample of the item corresponding to each of the user data; S23: performing random initialization processing on each of the negative sample data of the item to obtain a plurality of initial vectors of the negative sample of the item corresponding to each of the user data; S24: Encode each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data respectively to obtain a first user target vector corresponding to each of the user data and a second user target vector corresponding to each of the user data; S25: Calculate the total loss value for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain a total loss value; S26: updating the parameters of all user initial vectors, all item positive sample initial vectors and all item negative sample initial vectors according to the total loss value, and returning to step S24 until a preset number of iterations is reached, and then executing step S27; S27: Screening the minimum value of all the total loss values to obtain a minimum total loss value, and using the training model corresponding to the minimum total loss value as an item recommendation model; The process of step S24 includes: Calculating the first user target vector for each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data, respectively, to obtain the first user target vector corresponding to each of the user data; Randomly deleting a plurality of initial vectors of positive samples of items corresponding to each of the user data, respectively, to obtain a plurality of initial vectors of positive samples of items after deletion corresponding to each of the user data; Calculating the second user target vector for each of the user initial vectors and a plurality of deleted item positive sample initial vectors corresponding to each of the user data, respectively, to obtain the second user target vector corresponding to each of the user data; The process of calculating the first user target vector for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data to obtain the first user target vector corresponding to each of the user data includes: The first user target vector is calculated for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data through the first formula to obtain the first user target vector corresponding to each of the user data. The first formula is: E u1 =k·e u +(1-k)·W1N u1 , Among them, N u1 =∑ i1 +W2e i1 , Among them, E u1 is the first user target vector, k is a trainable variable, W1 and W2 are both trainable weight matrices, e u is the user initial vector of user u, e i1 is the initial vector of positive samples of item i, N u1 is the sum of the initial vectors of all positive samples of items that have interacted with user u.
2. The method for processing item recommendation data according to claim 1, characterized in that: The process of calculating the second user target vector for each of the user initial vectors and a plurality of deleted item positive sample initial vectors corresponding to each of the user data to obtain the second user target vector corresponding to each of the user data comprises: The second user target vector is calculated for each of the user initial vectors and the multiple deleted item positive sample initial vectors corresponding to each of the user data by the second formula to obtain the second user target vector corresponding to each of the user data. The second formula is: E u2 =k·e u +(1-k)·W1N u2 , Among them, N u2 =∑ i2 +W2e i2 , Among them, E u2 is the second user target vector, k is a trainable variable, W1 and W2 are both trainable weight matrices, e u is the user initial vector of user u, e i2 is the initial vector of positive samples of item i after deletion, N u2 is the sum of the initial vectors of all deleted item positive samples that have interacted with user u.
3. The method for processing item recommendation data according to claim 1, characterized in that: The process of step S25 includes: The total loss value is calculated by the third formula for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain the total loss value. The third formula is: Loss = Loss1 + w * Loss2, in, Among them, S ui =cos(E u1 , e i1 ), S uj =cos(E u1 , e j ), Among them, Loss is the total loss value, Loss1 is the first loss value, Loss2 is the second loss value, w is the weight parameter, U is the total number of user data, E u1 is the first user target vector of user u, E u2 is the second user target vector of user u, E v is the first user target vector of user v, τ is the preset parameter, O+ is the total number of positive sample data of items, O - is the total number of negative sample data of items, p and q are both preset thresholds, S ui is the similarity between the first user target vector of user u and the initial vector of the positive sample of item i, e i1 is the initial vector of positive samples of item i, S uj is the similarity between the first user target vector of user u and the initial vector of the negative sample of item j, e j is the initial vector of negative samples of item j, and cos() is the cosine similarity function.
4. An item recommendation data processing device, characterized in that: include: A data set import module is used to import a data set to be processed, wherein the data set to be processed includes a user set, a positive sample set of items, and a negative sample set of items; A model training module is used to construct a training model, and train the training model according to the user set, the item positive sample set, and the item negative sample set to obtain an item recommendation model; An item recommendation result obtaining module, used for inputting the item negative sample set into the item recommendation model, and obtaining an item recommendation result according to the item recommendation model; The user set includes a plurality of user data, the item positive sample set includes a plurality of item positive sample data corresponding to each of the user data, and the item negative sample set includes a plurality of item negative sample data corresponding to each of the user data; the model training module is specifically used for: Performing random initialization processing on each of the user data to obtain a user initial vector corresponding to each of the user data; Each of the positive sample data of the item is randomly initialized to obtain a plurality of initial vectors of positive sample of the item corresponding to each of the user data; Each of the negative sample data of the item is randomly initialized to obtain a plurality of initial vectors of negative sample of the item corresponding to each of the user data; Encode each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data respectively, to obtain a first user target vector corresponding to each of the user data and a second user target vector corresponding to each of the user data; Calculate the total loss value for all first user target vectors, all second user target vectors, all item positive sample initial vectors, and all item negative sample initial vectors to obtain a total loss value; According to the total loss value, all user initial vectors, all item positive sample initial vectors and all item negative sample initial vectors are updated with parameters, and the updated user initial vectors and the updated item positive sample initial vectors are encoded again until a preset number of iterations is reached, then the minimum value of all the total loss values is screened to obtain the minimum total loss value, and the training model corresponding to the minimum total loss value is used as the item recommendation model; In the model training module, the process of respectively encoding each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data to obtain a first user target vector corresponding to each of the user data and a second user target vector corresponding to each of the user data includes: Calculating the first user target vector for each of the user initial vectors and a plurality of item positive sample initial vectors corresponding to each of the user data, respectively, to obtain the first user target vector corresponding to each of the user data; Randomly deleting a plurality of initial vectors of positive samples of items corresponding to each of the user data, respectively, to obtain a plurality of initial vectors of positive samples of items after deletion corresponding to each of the user data; Calculating the second user target vector for each of the user initial vectors and a plurality of deleted item positive sample initial vectors corresponding to each of the user data, respectively, to obtain the second user target vector corresponding to each of the user data; In the model training module, the process of calculating the first user target vector for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data to obtain the first user target vector corresponding to each of the user data includes: The first user target vector is calculated for each of the user initial vectors and the multiple item positive sample initial vectors corresponding to each of the user data through the first formula to obtain the first user target vector corresponding to each of the user data. The first formula is: E u1 =k·e u +(1-k)·W1N u1 , Among them, N u1 =∑ i1 +W2e i1 , Among them, E u1 is the first user target vector, k is a trainable variable, W1 and W2 are both trainable weight matrices, e u is the user initial vector of user u, e i1 is the initial vector of positive samples of item i, N u1 is the sum of the initial vectors of all positive samples of items that have interacted with user u.
5. An item recommendation data processing system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the item recommendation data processing method according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the item recommendation data processing method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Multi-target sorting model training method and device and user behavior prediction method and device
CN110569427A
Commodity information recommendation method and device and storage medium
CN112800207A