Collaborative filtering model generation method, item recommendation method, and device
By using a collaborative filtering model, leveraging ResNet and AlBert neural networks based on image and text features, and combining KNN and LightGCN algorithms to generate undirected graphs, a BPR loss function is created. This solves the accuracy problem of item recommendation in e-commerce systems and significantly improves recommendation performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2026-03-27
AI Technical Summary
Existing e-commerce systems struggle to effectively utilize users' historical interaction data in project recommendations, resulting in lower recommendation accuracy and a lower likelihood of users purchasing projects.
A collaborative filtering model is adopted. By acquiring the image and text features of the training samples, ResNet and AlBert neural networks are used for feature extraction. KNN algorithm and LightGCN neural network are combined for clustering. An undirected graph is generated and a collaborative filtering model with BPR loss function is created for training to optimize project recommendation.
It improves the accuracy of item recommendations and the likelihood of users purchasing items. Experiments show that it has excellent recall, NDCG and precision on multiple datasets, significantly improving recommendation performance.
Smart Images

Figure CN116467510B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of item recommendation, and in particular to a collaborative filtering model generation method, an item recommendation method and device thereof. BACKGROUND
[0002] With the progress of society and the development of information technology, more and more users use e-commerce systems for online shopping, online ordering of takeout, online ordering of movie tickets, etc. When a user accesses, purchases, or evaluates an item (which can be a product, takeout, movie ticket, etc.), the e-commerce system stores these interaction data. It can be understood that if the e-commerce system can process these interaction data and then obtain a number of items that the user is likely to access or purchase in the future, and then recommend the number of items to the user, the likelihood of the user purchasing the item can be greatly improved. SUMMARY
[0003] Therefore, the main purpose of the present application is to provide a collaborative filtering model generation method, an item recommendation method and device thereof.
[0004] To achieve the above purpose, the technical solution of the present application is as follows: a collaborative filtering model generation method for item recommendation, comprising the following steps:
[0005] Obtain a plurality of training samples, each of which contains a user and an item that has interacted with the user; obtain image features corresponding to each training sample, and obtain text features corresponding to each training sample;
[0006] Obtain all different items from all training samples, obtain K most similar items corresponding to each item based on a clustering algorithm, wherein K is a natural number and K≥2; divide all training samples into a plurality of clusters based on the feature representation of each training sample; obtain all users and all items in all training samples, and generate an undirected graph G by taking all users and all items as nodes; if any second user and second item are located in the same training sample, the second user and the second item have a connection between them in the undirected graph G; in the undirected graph G, the minimum hop number between the first items is an even number, and the minimum number of items is less than 2 N all items and form a set A; for any first item, the true sample corresponding to the first item is , wherein K is a set of K most similar items corresponding to the first item, and C is a set of all items in the same cluster as the first item;
[0007] Create a collaborative filtering model, wherein the loss function of the collaborative filtering model is ; wherein, item1 is any user, item2 is any training sample in the true sample corresponding to item1, item3 is any training sample in the negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples minus the true sample corresponding to item1, the result of the function ID(x) is the feature representation of the training sample x, and the total loss of the joint training is calculated as ; wherein, is the loss function in the recommendation algorithm, and are the losses of the contrast learning obtained in the visual and text modalities, respectively, is the set of model parameters; and are hyperparameters of the contrast learning task strength in the image and text modalities, respectively, is the regularization strength; the BPR loss function wherein, σ is an activation function, u is any user, i is any item, and the item is the item that has interacted with the user u, and the item is the item that has not interacted with the user u, is the similarity score of the sample that has interacted, represents the similarity score of the sample pair that has not interacted.
[0008] The collaborative filtering model is trained using a plurality of training sample pairs.
[0009] As an improvement of the embodiment of the present application, the "obtaining the image feature corresponding to each training sample" specifically comprises: obtaining the image feature corresponding to each training sample using a ResNet neural network.
[0010] As an improvement of the embodiment of the present application, the "obtaining the text feature corresponding to each training sample" specifically comprises: obtaining the text feature corresponding to each training sample using an AlBert neural network.
[0011] As an improvement of the embodiment of the present application, the "obtaining the K most similar items corresponding to each item based on a clustering algorithm" specifically comprises: obtaining the K most similar items corresponding to each item based on a KNN algorithm, wherein, in the KNN algorithm, the similarity between two image features corresponding to any two different items = the cosine similarity between the two image features, and the similarity between two text features = the cosine similarity between the two text features.
[0012] As an improvement of the embodiment of the application, the "dividing all the training samples into several clusters based on the feature representation corresponding to each training sample" specifically includes: obtaining the feature representation corresponding to each training sample by using the LightGCN neural network, and dividing all the training samples into several clusters based on the feature representation corresponding to each training sample.
[0013] As an improvement of the embodiment of the application, the "dividing all the training samples into several clusters based on the feature representation corresponding to each training sample" specifically includes: dividing all the training samples into several clusters based on the k-means algorithm and the feature representation corresponding to each training sample.
[0014] As an improvement of the embodiment of the application, the "obtaining the minimum hop number between the first items as an even number, and the minimum number of edges less than 2 The "obtaining all the items of N and forming a set A" specifically includes: generating a connection matrix R corresponding to the undirected graph G, wherein if there is a connection between the third user and the third item, the value of the element corresponding to the third user and the third item in the connection matrix R is one, otherwise it is zero; generating a matrix wherein N is a natural number; when the value of the element corresponding to the first item and any fourth item in the matrix A is greater than 0, the fourth item is located in the set A.
[0015] The embodiment of the application also provides a device for generating a collaborative filtering model for item recommendation, comprising the following modules:
[0016] The data acquisition module is configured to acquire a plurality of training samples, each of which contains a user and an item that has interacted with the user; acquire image features corresponding to each training sample, and acquire text features corresponding to each training sample.
[0017] The data preprocessing module is configured to acquire all different items from all the training samples, acquire K most similar items corresponding to each item based on a clustering algorithm, wherein K is a natural number and K≥2; divide all the training samples into several clusters based on the feature representation corresponding to each training sample; acquire all users and all items in all the training samples, and generate an undirected graph G by taking all the users and all the items as nodes; if any second user and second item are located in the same training sample, the second user and the second item have a connection in the undirected graph G; and obtain the minimum hop number between the first items as an even number, and the minimum number of edges less than 2 N and form a set A; for any first item, the true sample corresponding to the first item is wherein K is a set composed of the K most similar items corresponding to the first item, and C is a set composed of all items in the same cluster as the first item.
[0018] a model creating module configured to create a collaborative filtering model in which a loss function is ; wherein item1 is any user, item2 is any training sample in a true sample corresponding to item1, item3 is any training sample in a negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples minus the true sample corresponding to item1, the result of the function ID(x) is a feature representation corresponding to the training sample x, and the total loss of joint training is calculated as ; wherein is a loss function in a recommendation algorithm, and are losses of contrast learning obtained in visual and text modalities respectively, is a set of model parameters; and are hyperparameters of the strength of contrast learning tasks in the image and text modalities respectively, is the strength of regularization; the BPR loss function wherein sigma is an activation function, u is any user, i is any item, and the item is an item that has interacted with the user u, and the item is an item that has not interacted with the user u, is a similarity score of a sample that has interacted, denotes a similarity score of a sample pair that has not interacted;
[0019] a training module configured to train the collaborative filtering model using a plurality of training sample pairs.
[0020] Embodiments of the present application also provide an item recommendation method, comprising the following steps: performing the generation method described above and obtaining a collaborative filtering model; obtaining a plurality of items that have interacted with a preset user, inputting the plurality of items into the collaborative filtering model, and thereby obtaining a recommended item.
[0021] Embodiments of the present application also provide an item recommendation device, comprising the following modules: a preprocessing module configured to perform the generation method described above and obtain a collaborative filtering model; and a processing module configured to obtain a plurality of items that have interacted with a preset user, input the plurality of items into the collaborative filtering model, and thereby obtain a recommended item.
[0022] The collaborative filtering model generation method, the item recommendation method and the device thereof provided by the embodiments of the present application have the following advantages: the collaborative filtering model generation method, the item recommendation method and the device thereof are disclosed, the generation method comprises the following steps: obtaining a plurality of training samples, each training sample comprising a user and an item that has interacted with the user; obtaining image features corresponding to each training sample and text features corresponding to each training sample; preprocessing the plurality of training samples, creating a collaborative filtering model, and training the collaborative filtering model by using the plurality of training samples. In summary, the collaborative filtering model can recommend a plurality of items that are most likely to be interacted with in the future, thereby greatly improving the possibility of the user purchasing the item. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 A flowchart of the generation method in the embodiments. DETAILED DESCRIPTION
[0024] The present application will be described in detail below with reference to the embodiments shown in the drawings. However, the embodiments do not limit the present application, and the changes in structure, method or function made by those skilled in the art based on the embodiments are included in the protection scope of the present application.
[0025] The following description and drawings sufficiently illustrate specific embodiments of the present application to enable one skilled in the art to practice them. Portions and features of some embodiments can be included in, or substituted for, portions and features of other embodiments. The range of the embodiments of the present application includes the entire range of the claims, and all available equivalents of the claims. In this document, the terms "first", "second", and so on are used only to distinguish one element from another, and do not require or imply any actual relationship or order between the elements. In fact, the first element can also be called the second element, and vice versa. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the structure, device or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such structure, device or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the structure, device or equipment including the element. In this document, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between each embodiment can be referred to each other.
[0026] The terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like in the present text indicate the orientation or positional relationship shown in the drawings, which are only for the convenience of the description herein and the simplification of the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In the description herein, unless otherwise specified and limited, the terms "mounting", "connection", "connection" should be understood broadly, for example, it can be a mechanical connection or an electrical connection, it can also be a communication between two elements inside, it can be directly connected, or indirectly connected through an intermediate medium, and the specific meaning of the above terms can be understood by the person skilled in the art according to the specific circumstances.
[0027] The embodiment one of the present application provides a generation method of a collaborative filtering model for project recommendation, as shown in the figure, comprising the following steps: Figure 1
[0028] Step 101: obtaining a plurality of training samples, each training sample containing a user and a project interacted with the user; obtaining image features corresponding to each training sample, and obtaining text features corresponding to each training sample;
[0029] Here, when a user visits, purchases or evaluates a project, the user and the project constitute a training sample, in order to better describe the relationship between the user and the project, the training sample can also include image features and text features.
[0030] In practice, in order to better distinguish users and projects, each user corresponds to a unique user code, and each project also corresponds to a unique project code, for example, the user code can be one-hot code.
[0031] Here, it is assumed that the user set is represented by U, and the project set is represented by I. According to the interaction data, the user-project interaction matrix R is given If the user u and the project i interact, otherwise 0. Then, the interaction matrix R is converted into a graph G , wherein , which represents the node set, represents the edge set. Then the user code extracted from the interaction data , the project code , wherein, .
[0032] Step 102: obtaining all different items from all training samples, obtaining K most similar items corresponding to each item based on a clustering algorithm, wherein K is a natural number and K≥2; dividing all training samples into several clusters based on the feature representation corresponding to each training sample; obtaining all users and all items in all training samples, taking all users and all items as nodes to generate an undirected graph G; if any second user and second item are located in the same training sample, then the second user and the second item have a connection between them in the undirected graph G; obtaining the minimum number of hops between the first items in the undirected graph G as an even number and the minimum number of paths as less than 2 all items of N and constitute a set A; for any first item, the true sample corresponding to the first item is , wherein K is a set composed of K most similar items corresponding to the first item, and C is a set composed of all items in the same cluster as the first item;
[0033] Step 103: creating a collaborative filtering model, wherein the loss function of the collaborative filtering model is ; wherein item1 is any user, item2 is any training sample in the true sample corresponding to item1, item3 is any training sample in the negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples except the true sample corresponding to item1, and the result of the function ID(x) is the feature representation corresponding to the training sample x; the total loss of joint training is calculated as ; wherein is the loss function in the recommendation algorithm, and are the losses of contrast learning obtained in the visual and text two modalities respectively, is a set of model parameters; and are hyperparameters of the image modal and text modal contrast learning task strength respectively, is the regularization strength; the BPR loss function , wherein σ is an activation function, u is any user, i is any item, and item is an item that has interacted with user u, item is an item that has not interacted with user u, is the similarity score of the sample that has interacted, indicates the similarity score of the sample pair that has not interacted;
[0034] Step 104: training the collaborative filtering model using multiple training samples.
[0035] In the embodiment, the "obtaining image features corresponding to each training sample" specifically includes: obtaining image features corresponding to each training sample using a ResNet neural network.
[0036] In the embodiment, the "obtaining text features corresponding to each training sample" specifically includes: obtaining text features corresponding to each training sample using an AlBert neural network.
[0037] In the embodiment, the "obtaining K most similar items corresponding to each item based on a clustering algorithm" specifically includes: obtaining K most similar items corresponding to each item based on a KNN algorithm, in which the similarity between two image features corresponding to any two different items = the cosine similarity between the two image features, and the similarity between two text features = the cosine similarity between the two text features. Here, the full name of KNN is K-NearestNeighbor, and the Chinese name is Neighboring K-NearestNeighbor. Assuming that two image features corresponding to two different items are and , the similarity between the two image features is ; and two text features corresponding to two different items are and , the similarity between the two image features is .
[0038] In the embodiment, the "dividing all training samples into several clusters based on the feature representation corresponding to each training sample" specifically includes: obtaining the feature representation corresponding to each training sample using a LightGCN neural network, and dividing all training samples into several clusters based on the feature representation corresponding to each training sample.
[0039] In the embodiment, the "dividing all training samples into several clusters based on the feature representation corresponding to each training sample" specifically includes: dividing all training samples into several clusters based on a k-means algorithm and the feature representation corresponding to each training sample.
[0040] In the embodiment, the "obtaining all items with an even minimum hop count and a minimum number of less than 2 N and forming a set A" specifically includes: generating a connection matrix R corresponding to an undirected graph G, in which if a third user and a third item have a connection, the value of the element corresponding to the third user and the third item is one, otherwise it is zero; generating a matrix , where N is a natural number; when the value of the element corresponding to the first item and any fourth item in the matrix A is > 0, the fourth item is located in the set A.
[0041] To evaluate the collaborative filtering model described above, the inventors conducted experiments on four widely used datasets for recommendation. The datasets are Amazon-Clothing, Amazon-Sports, and Amazon-Toys, and the detailed data of the datasets are shown in the following table:
[0042] Dataset Users Items Interactions Density Clothing 22553 13795 154008 0.050% Sport 22687 12180 183633 0.067% Toys 15529 9624 133025 0.089%
[0043] The inventors adopted three most commonly used performance evaluation indicators, namely recall, normalized discounted cumulative gain (NDCG), and precision. Recall is the accuracy of ground-truth items appearing in the top N recommendations. NDCG is a ranking loss used to measure the position of true items in the top N recommendations. For each user, the inventors sorted each item in descending order according to the predicted score and generated a recommendation list, and truncated the top 10 items to calculate the top 10 results of the evaluation indicators. In addition, the inventors compared with common sequential recommendation models, and the specific recommendation performance is shown in the following table:
[0044]
[0045] Embodiment two of the present application provides a collaborative filtering model generation device for item recommendation, comprising the following modules:
[0046] The data acquisition module is configured to acquire a plurality of training samples, each of which contains a user and an item that has interacted with the user; acquire image features corresponding to each training sample, and acquire text features corresponding to each training sample;
[0047] The data preprocessing module is configured to acquire all different items from all training samples, acquire K most similar items corresponding to each item based on a clustering algorithm, wherein K is a natural number and K≥2; divide all training samples into a plurality of clusters based on the feature representation corresponding to each training sample; acquire all users and all items in all training samples, and generate an undirected graph G by taking all users and all items as nodes; if any second user and second item are located in the same training sample, the second user and the second item have a connection between them in the undirected graph G; in the undirected graph G, the minimum hop number between the first items is an even number, and the minimum number of items is less than 2 all items corresponding to N, and form a set A; for any first item, the true sample corresponding to the first item is wherein K is a set composed of K most similar items corresponding to the first item, and C is a set composed of all items in the same cluster as the first item.
[0048] a model creating module, configured to create a collaborative filtering model, in which a loss function is ; wherein item1 is any user, item2 is any training sample in a true sample corresponding to item1, item3 is any training sample in a negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples minus the true sample corresponding to item1, the result of the function ID(x) is a feature representation corresponding to the training sample x; and the total loss of joint training is calculated as ; wherein, is a loss function in a recommendation algorithm, and are losses of contrast learning obtained in visual and text modalities respectively, is a set of model parameters; and are hyperparameters of the strength of contrast learning tasks in image and text modalities respectively, is a regularization strength; and the BPR loss function is wherein sigma is an activation function, u is any user, i is any item, and the item is an item that has interacted with the user u, and the item is an item that has not interacted with the user u, is a similarity score of a sample that has interacted, represents a similarity score of a sample pair that has not interacted;
[0049] a training module, configured to train the collaborative filtering model using a plurality of training sample pairs.
[0050] Embodiment three of the present application provides a project recommendation method, comprising the following steps:
[0051] performing the generation method in embodiment one and obtaining a collaborative filtering model;
[0052] obtaining a plurality of items that have interacted with a preset user, inputting the plurality of items into the collaborative filtering model, and thereby obtaining a recommended item.
[0053] Embodiment three of the present application provides a project recommendation device, comprising the following modules:
[0054] a preprocessing module, configured to perform the generation method in embodiment one and obtain a collaborative filtering model;
[0055] a processing module, configured to obtain a plurality of items that have interacted with a preset user, input the plurality of items into the collaborative filtering model, and thereby obtain a recommended item.
[0056] It is to be understood that even though various embodiments can be described in conjunction with a specific order, the order is not absolute and the steps can be performed in other orders.
[0057] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0058] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se.
[0059] Embodiments of the application have been described above, with reference to specific embodiments. It is to be understood that the description is merely exemplary of the present application and is not intended to limit the scope of the application unless otherwise specifically stated. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The description is intended to cover any alternatives, modifications, and equivalents of the provided embodiments. The terms "comprise," "include," and "contain" as used throughout this description are meant to be interpreted in a non-limiting manner.
Claims
1. A method for generating a collaborative filtering model for project recommendation, characterized in that, The method comprises the following steps: obtaining a plurality of training samples, each of which comprises a user and an item that has interacted with the user; obtaining image features corresponding to each training sample, and obtaining text features corresponding to each training sample; All different items are obtained from all training samples, K most similar items corresponding to each item are obtained based on a clustering algorithm, wherein K is a natural number and K≥2; all training samples are divided into a plurality of clusters based on feature representations corresponding to each training sample; all users and all items in all training samples are obtained, all users and all items are taken as nodes, and an undirected graph G is generated; if any second user and second item are located in a same training sample, then the second user and the second item have a connection between them in the undirected graph G; in the undirected graph G, the minimum hop number between first items is an even number, and the minimum number is less than 2 all items of the first project and constitute a set A; for any first item, the true sample corresponding to the first item is , wherein K is a set composed of K most similar items corresponding to the first item, and C is a set composed of all items in a same cluster as the first item. A collaborative filtering model is created, in which the loss function is ; wherein item1 is any user, item2 is any training sample in the true sample corresponding to item1, item3 is any training sample in the negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples minus the true sample corresponding to item1, and the result of the function ID(x) is the feature representation corresponding to the training sample x; the total loss of joint training is calculated as ; wherein is the loss function in the recommendation algorithm, and are the losses of contrast learning obtained in the visual and text modalities respectively, is a set of model parameters; and are hyperparameters of the image modality and text modality contrast learning task intensity respectively, is the regularization intensity; the BPR loss function , wherein σ is an activation function, u is any user, i is any item, and the item is an item that has interacted with the user u, and the item is an item that has not interacted with the user u, is the similarity score of the sample that has interacted, indicates the similarity score of the sample pair that has not interacted. training the collaborative filtering model using the plurality of training samples.
2. The generation method of claim 1, wherein, The "obtaining image features corresponding to each training sample" specifically comprises: obtaining image features corresponding to each training sample using a ResNet neural network.
3. The generation method of claim 1, wherein, The "obtaining text features corresponding to each training sample" specifically comprises: obtaining text features corresponding to each training sample using an AlBert neural network.
4. The generation method of claim 1, wherein, The "obtaining K most similar items corresponding to each item based on a clustering algorithm" specifically comprises: obtaining K most similar items corresponding to each item based on a KNN algorithm, wherein the similarity between two image features corresponding to any two different items = the cosine similarity between the two image features, and the similarity between two text features = the cosine similarity between the two text features.
5. The method of claim 1, wherein, The "dividing all training samples into a plurality of clusters based on feature representations corresponding to each training sample" specifically comprises: obtaining feature representations corresponding to each training sample using a LightGCN neural network, and dividing all training samples into a plurality of clusters based on the feature representations corresponding to each training sample.
6. The method of claim 1, wherein, The "dividing all training samples into a plurality of clusters based on feature representations corresponding to each training sample" specifically comprises: dividing all training samples into a plurality of clusters based on a k-means algorithm and the feature representations corresponding to each training sample.
7. The method of claim 1, wherein, The "obtaining the minimum number of hops between the first items is an even number, and the minimum number of strips is less than 2 All the items of N and constitute a set A" specifically includes: A connection matrix R corresponding to the undirected graph G is generated, in which if there is a connection between the third user and the third item, the value of the elements corresponding to the third user and the third item is one, otherwise it is zero; a matrix where N is a natural number; when the value of the element corresponding to the first item and any fourth item in the matrix A is > 0, the fourth item is located in the set A.
8. An apparatus for generating a collaborative filtering model for project recommendation, characterized in that, The method comprises the following modules: a data obtaining module, configured to obtain a plurality of training samples, each of which comprises a user and an item that has interacted with the user; obtain image features corresponding to each training sample, and obtain text features corresponding to each training sample; The data preprocessing module is configured to obtain all different items from all training samples, obtain K most similar items corresponding to each item based on a clustering algorithm, wherein K is a natural number and K≥2; divide all training samples into several clusters based on feature representation corresponding to each training sample; obtain all users and all items in all training samples, take all users and all items as nodes, and generate an undirected graph G; if any second user and second item are located in the same training sample, the second user and the second item have a connection between them in the undirected graph G; in the undirected graph G, the minimum hop number between the first items is an even number, and the minimum number is less than 2 all items of the first project and constitute a set A; for any first item, the true sample corresponding to the first item is wherein K is a set composed of K most similar items corresponding to the first item, and C is a set composed of all items in the same cluster as the first item. A model creating module is configured to create a collaborative filtering model, in which a loss function is ; wherein item1 is any user, item2 is any training sample in the true sample corresponding to item1, item3 is any training sample in the negative sample corresponding to item1, wherein the negative sample corresponding to item1 = all test samples minus the true sample corresponding to item1, and the result of the function ID(x) is the feature representation corresponding to the training sample x; the total loss of joint training is calculated as ; wherein is the loss function in the recommendation algorithm, and are the losses of contrast learning obtained respectively under the visual and text two modalities, is a set of model parameters; and are hyperparameters of the image modal and text modal contrast learning task strength respectively, is the regularization strength; the BPR loss function , wherein σ is an activation function, u is any user, i is any item, and the item is the item that has interacted with the user u, and the item is the item that has not interacted with the user u, is the similarity score of the sample that has interacted, indicates the similarity score of the sample pair that has not interacted. a training module, configured to train the collaborative filtering model using the plurality of training samples.
9. An item recommendation method characterized by comprising: The method comprises the following steps: executing the generation method of any one of claims 1-7 to obtain a collaborative filtering model; obtaining a plurality of items that have interacted with a preset user, inputting the plurality of items into the collaborative filtering model, and thereby obtaining recommended items.
10. An item recommendation device characterized by comprising: The method comprises the following modules: a preprocessing module, configured to execute the generation method of any one of claims 1-7 to obtain a collaborative filtering model; a processing module, configured to obtain a plurality of items that have interacted with a preset user, input the plurality of items into the collaborative filtering model, and thereby obtain recommended items.
Citation Information
Patent Citations
Recommendation method and system based on collaborative filtering
CN101685458A
Recommendation method and system based on sorting comparison loss, medium and equipment
CN115689673A