Recommendation method, model training method and related products
By introducing noise into the embedding vector and performing noise reduction processing, combined with object information, the problem of low material diversity in existing recommendation systems is solved, and higher material diversity and exposure rate of newly generated materials are achieved.
Patent Information
- Application Number
- CN202510707066.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-09
AI Technical Summary
In existing recommendation systems, when recommending items based on embedding vector matching, it is easy to lead to low material diversity and fail to effectively increase the difference between the embedding vector and the material that the object has interacted with.
By introducing noise into the embedding vector and performing noise reduction processing, a target embedding vector with a similarity that meets the threshold is generated. Further noise reduction is performed based on the object information to increase the difference between the embedding vector and the object's interaction material.
It improves the diversity of recommended materials, avoids information cocoons, and enhances the material diversity of the recommendation system and the exposure rate of newly generated materials.
Smart Images

Figure CN120611095A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of recommendation technology, and in particular to a recommendation method, a model training method and related products. Background Art
[0002] In existing recommendation systems, an embedding vector containing feature information of items with which a subject has interacted is typically matched with the item to be recommended. Target items with a high degree of match to the embedding vector are then identified and recommended. Since items with which a subject has interacted are typically items of interest to the subject, the probability that the target item identified based on the embedding vector is the subject's interest is high. However, determining the target item based solely on the embedding vector can easily result in a high degree of similarity between the feature information contained in the target item and the feature information contained in the items with which the subject has interacted. Consequently, when the target item is recommended to the subject, the diversity of recommended items is low.
[0003] Therefore, a feasible solution is urgently needed to increase the difference between the embedding vectors used to determine the materials recommended to the object and the embedding vectors of the materials with which the object has interacted. Summary of the Invention
[0004] The present application provides a recommendation method, a model training method, and related products to increase the difference between the embedding vector used to determine the material recommended to the object and the embedding vector of the material with which the object has interacted. The related products include a recommendation device, a model training device, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] In a first aspect, a recommendation method is provided, the recommendation method comprising:
[0006] Obtaining a first target embedding vector and target noise, where the first target embedding vector includes feature information of a material of interest to the target object;
[0007] Noising the first target embedding vector based on the target noise to obtain a second target embedding vector;
[0008] Noise reduction is performed on the second target embedding vector to obtain a third target embedding vector, where a similarity between the third target embedding vector and the first target embedding vector is greater than a first threshold.
[0009] In combination with any embodiment of the present application, the denoising the second target embedding vector to obtain a third target embedding vector includes:
[0010] Get target object information of the target object;
[0011] The second target embedding vector is denoised based on the target object information to obtain the third target embedding vector, where a similarity between the third target embedding vector and the target object information is greater than a second threshold.
[0012] In combination with any embodiment of the present application, the denoising the second target embedding vector based on the target object information to obtain the third target embedding vector includes:
[0013] Extracting feature information of the target object information to obtain a target object embedding vector;
[0014] generating a target noise reduction condition according to the target object embedding vector, wherein the target noise reduction condition includes a similarity with the target object embedding vector being greater than the second threshold;
[0015] Noise reduction is performed on the second target embedding vector to obtain the third target embedding vector that meets the target noise reduction condition, and the similarity between the third target embedding vector and the target object embedding vector is greater than the second threshold.
[0016] In combination with any embodiment of the present application, the target noise obeys a continuous distribution.
[0017] In combination with any embodiment of the present application, the method further includes:
[0018] Get at least one material to be recommended;
[0019] Extracting feature information of the at least one material to be recommended to obtain at least one embedding vector to be recommended;
[0020] Determine, from the at least one embedding vector to be recommended, an embedding vector having a similarity with the third target embedding vector greater than the third threshold, as a fourth target embedding vector;
[0021] A material corresponding to the fourth target embedding vector is determined from the at least one material to be recommended, and a target material recommended to the target object is obtained.
[0022] In a second aspect, a model training method is provided, the model training method comprising:
[0023] Obtaining a first embedding vector, a first noise, and a first model to be trained, where the first embedding vector includes feature information of a first material;
[0024] Based on the first noise, using the first to-be-trained model to add noise to the first embedding vector to obtain a second embedding vector;
[0025] Denoising the second embedding vector using the first to-be-trained model to obtain a third embedding vector;
[0026] determining a target loss based on a first difference between the third embedding vector and the first embedding vector, wherein the target loss is positively correlated with the first difference;
[0027] Based on the target loss, parameters in the first to-be-trained model are updated to obtain a first target model.
[0028] In combination with any embodiment of the present application, the first embedding vector includes feature information of the first material;
[0029] Get the first embedding vector, including:
[0030] Acquire the first material, where the first material includes information of more than one modality;
[0031] Feature information of one or more modal information in the first material is extracted to obtain a first embedding vector.
[0032] In combination with any embodiment of the present application, the first noise obeys a continuous distribution.
[0033] In combination with any embodiment of the present application, obtaining the first noise includes:
[0034] Acquire T second noises, where the T second noises include T-1 third noises and the first noise;
[0035] The step of adding noise to the first embedding vector based on the first noise to obtain a second embedding vector includes:
[0036] Using the T-1 third noises, perform T-1 noise additions on the first embedding vector to obtain a fourth embedding vector, and perform denoising once on any of the third noises;
[0037] Noise is added to the fourth embedding vector using the first noise to obtain the second embedding vector.
[0038] In combination with any embodiment of the present application, the denoising the second embedding vector using the first to-be-trained model to obtain a third embedding vector includes:
[0039] The first embedding vector is denoised T times using the first to-be-trained model to obtain the third embedding vector.
[0040] In combination with any embodiment of the present application, the first embedding vector includes feature information of a first material, and the first material is a material of interest to the training subject;
[0041] The denoising the second embedding vector by using the first to-be-trained model to obtain a third embedding vector includes:
[0042] Acquiring training object information of the training object;
[0043] Based on the training object information, the second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector, where a similarity between the third embedding vector and the training object information is greater than a fifth threshold.
[0044] In combination with any embodiment of the present application, the step of denoising the second embedding vector using the first to-be-trained model based on the training object information to obtain the third embedding vector includes:
[0045] Obtain the second model to be trained;
[0046] Extracting feature information of the training object information using the second to-be-trained model to obtain a fifth embedding vector;
[0047] generating a training denoising condition based on the fifth embedding vector, the training denoising condition including a similarity with the fifth embedding vector being greater than a fifth threshold;
[0048] The second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector that satisfies the training denoising condition, and the similarity between the third embedding vector and the fifth embedding vector is greater than the fifth threshold.
[0049] In conjunction with any embodiment of the present application, the first material is a material with which the training subject has interacted, the first material is a material with which the training subject has interacted and whose similarity to the recommended material is greater than a sixth threshold, the recommended material is a material of interest to the training subject determined based on the materials with which the training subject has interacted, and the training subject has not interacted with the recommended material;
[0050] Determining a target loss according to a first difference between the third embedding vector and the first embedding vector includes:
[0051] Obtaining the recommended material;
[0052] Extracting feature information of the recommended material using the second to-be-trained model to obtain a training recommendation vector;
[0053] determining a first loss based on the first difference between the third embedding vector and the first embedding vector, wherein the first loss is positively correlated with the first difference;
[0054] determining a second loss based on a second difference between the fifth embedding vector and the training recommendation vector, wherein the second loss is positively correlated with the second difference;
[0055] determining the target loss according to the first loss and the second loss, wherein the target loss is positively correlated with the first loss and the target loss is positively correlated with the second loss;
[0056] The method further comprises:
[0057] The parameters of the second model to be trained are updated based on the target loss to obtain a second target model.
[0058] In combination with any embodiment of the present application, determining the target loss according to the first loss and the second loss includes:
[0059] determining a third loss based on a third difference between the third embedding vector and the training recommendation vector, wherein the third loss is positively correlated with the third difference;
[0060] The target loss is determined according to the first loss, the second loss, and the third loss, and the target loss is positively correlated with the third loss.
[0061] In a third aspect, a recommendation device is provided, comprising:
[0062] an acquisition unit, configured to acquire a first target embedding vector and target noise, wherein the first target embedding vector includes feature information of a material of interest to the target object;
[0063] a noise adding unit, configured to add noise to the first target embedding vector based on the target noise to obtain a second target embedding vector;
[0064] A denoising unit is configured to perform denoising on the second target embedding vector to obtain a third target embedding vector, where a similarity between the third target embedding vector and the first target embedding vector is greater than a first threshold.
[0065] In conjunction with any embodiment of the present application, the acquisition unit is further configured to:
[0066] Get target object information of the target object;
[0067] The above-mentioned noise reduction unit is specifically used for:
[0068] The second target embedding vector is denoised based on the target object information to obtain the third target embedding vector, where a similarity between the third target embedding vector and the target object information is greater than a second threshold.
[0069] In conjunction with any embodiment of the present application, the noise reduction unit is specifically configured to:
[0070] Extracting feature information of the target object information to obtain a target object embedding vector;
[0071] generating a target noise reduction condition according to the target object embedding vector, wherein the target noise reduction condition includes a similarity with the target object embedding vector being greater than the second threshold;
[0072] Noise reduction is performed on the second target embedding vector to obtain the third target embedding vector that meets the target noise reduction condition, and the similarity between the third target embedding vector and the target object embedding vector is greater than the second threshold.
[0073] In combination with any embodiment of the present application, the target noise obeys a continuous distribution.
[0074] In conjunction with any embodiment of the present application, the recommendation device 1 further includes a recommendation unit configured to:
[0075] Get at least one material to be recommended;
[0076] Extracting feature information of the at least one material to be recommended to obtain at least one embedding vector to be recommended;
[0077] Determine, from the at least one embedding vector to be recommended, an embedding vector having a similarity with the third target embedding vector greater than the third threshold, as a fourth target embedding vector;
[0078] A material corresponding to the fourth target embedding vector is determined from the at least one material to be recommended, and a target material recommended to the target object is obtained.
[0079] In a fourth aspect, a model training device is provided, comprising:
[0080] an acquisition unit, configured to acquire a first embedding vector, a first noise, and a first model to be trained, wherein the first embedding vector includes feature information of the first material;
[0081] a noise adding unit, configured to add noise to the first embedding vector using the first to-be-trained model based on the first noise to obtain a second embedding vector;
[0082] a denoising unit, configured to perform denoising on the second embedding vector using the first to-be-trained model to obtain a third embedding vector;
[0083] a loss calculation unit, configured to determine a target loss based on a first difference between the third embedding vector and the first embedding vector, wherein the target loss is positively correlated with the first difference;
[0084] An updating unit is used to update the parameters of the first to-be-trained model based on the target loss to obtain a first target model.
[0085] In combination with any embodiment of the present application, the first embedding vector includes feature information of the first material;
[0086] The acquisition unit is specifically used to:
[0087] Acquire the first material, where the first material includes information of more than one modality;
[0088] Feature information of one or more modal information in the first material is extracted to obtain a first embedding vector.
[0089] In combination with any embodiment of the present application, the first noise obeys a continuous distribution.
[0090] In conjunction with any embodiment of the present application, the acquisition unit is specifically configured to:
[0091] Acquire T second noises, where the T second noises include T-1 third noises and the first noise;
[0092] The noise adding unit is specifically used for:
[0093] Using the T-1 third noises, perform T-1 noise additions on the first embedding vector to obtain a fourth embedding vector, and perform denoising once on any of the third noises;
[0094] Noise is added to the fourth embedding vector using the first noise to obtain the second embedding vector.
[0095] In conjunction with any embodiment of the present application, the noise reduction unit is specifically configured to:
[0096] The first embedding vector is denoised T times using the first to-be-trained model to obtain the third embedding vector.
[0097] In combination with any embodiment of the present application, the first embedding vector includes feature information of a first material, where the first material is a material of interest to the training subject;
[0098] The above-mentioned noise reduction unit is specifically used for:
[0099] Acquiring training object information of the training object;
[0100] Based on the training object information, the second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector, where a similarity between the third embedding vector and the training object information is greater than a fifth threshold.
[0101] In conjunction with any embodiment of the present application, the noise reduction unit is specifically configured to:
[0102] Obtain the second model to be trained;
[0103] Extracting feature information of the training object information using the second to-be-trained model to obtain a fifth embedding vector;
[0104] generating a training denoising condition based on the fifth embedding vector, the training denoising condition including a similarity with the fifth embedding vector being greater than a fifth threshold;
[0105] The second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector that satisfies the training denoising condition, and the similarity between the third embedding vector and the fifth embedding vector is greater than the fifth threshold.
[0106] In conjunction with any embodiment of the present application, the first material is a material with which the training subject has interacted, the first material is a material with which the training subject has interacted and whose similarity to the recommended material is greater than a sixth threshold, the recommended material is a material of interest to the training subject determined based on the materials with which the training subject has interacted, and the training subject has not interacted with the recommended material;
[0107] The above-mentioned loss calculation unit is specifically used to:
[0108] Obtaining the recommended material;
[0109] Extracting feature information of the recommended material using the second to-be-trained model to obtain a training recommendation vector;
[0110] determining a first loss based on the first difference between the third embedding vector and the first embedding vector, wherein the first loss is positively correlated with the first difference;
[0111] determining a second loss based on a second difference between the fifth embedding vector and the training recommendation vector, wherein the second loss is positively correlated with the second difference;
[0112] determining the target loss according to the first loss and the second loss, wherein the target loss is positively correlated with the first loss and the target loss is positively correlated with the second loss;
[0113] The above-mentioned update unit is also used to:
[0114] The parameters of the second model to be trained are updated based on the target loss to obtain a second target model.
[0115] In conjunction with any embodiment of the present application, the loss calculation unit is specifically configured to:
[0116] determining a third loss based on a third difference between the third embedding vector and the training recommendation vector, wherein the third loss is positively correlated with the third difference;
[0117] The target loss is determined according to the first loss, the second loss, and the third loss, and the target loss is positively correlated with the third loss.
[0118] In a fifth aspect, an electronic device is provided, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the electronic device executes the first aspect and any embodiment thereof, or executes the second aspect and any embodiment thereof.
[0119] In a sixth aspect, another electronic device is provided, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the first aspect and any embodiment thereof, or executes the second aspect and any embodiment thereof.
[0120] In the seventh aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the first aspect and any embodiment thereof, or execute the second aspect and any embodiment thereof.
[0121] In an eighth aspect, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to execute the above-mentioned first aspect and any embodiment thereof, or execute the above-mentioned second aspect and any embodiment thereof.
[0122] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0123] In an embodiment of the present application, a recommendation device obtains a first target embedding vector and target noise, then adds noise to the first target embedding vector based on the target noise to obtain a second target embedding vector. The first target embedding vector represents the characteristics of the material of interest to the target subject. After obtaining the second target embedding vector, the device performs noise reduction on the second target embedding vector to obtain a third target embedding vector. The recommendation device adds noise to the first target embedding vector using the target noise to obtain the second target embedding vector, causing some feature information in the first target embedding vector to change. By performing noise reduction on the second target embedding vector, the device predicts the changed feature information in the second target embedding vector and restores the changed feature information to its pre-change state to obtain the third target embedding vector. However, because the noise reduction process makes it difficult to accurately predict the changed feature information in the second target embedding vector, the noise-reduced third target embedding vector still contains residual noise. The presence of residual noise can cause the feature information in the third target embedding vector to differ from that in the first target embedding vector, thereby increasing the difference between the third target embedding vector and the first target embedding vector. On the other hand, since the first target embedding vector is the feature of the material of interest to the target object, when the similarity between the third target embedding vector and the first target embedding vector is greater than the first threshold, the probability that the third target embedding vector contains the feature information of the material of interest to the target object is higher.
[0124] Therefore, based on the above two aspects, the third target embedding vector can contain the characteristic information of the material that the target object is interested in, and the difference between the third target embedding vector and the first target embedding vector can be increased. BRIEF DESCRIPTION OF THE DRAWINGS
[0125] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0126] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0127] Figure 1 A flowchart of a recommended method provided in an embodiment of the present application;
[0128] Figure 2 A flowchart of a model training method provided in an embodiment of the present application;
[0129] Figure 3 A flowchart of a model training method and a recommendation method provided in an embodiment of the present application;
[0130] Figure 4A schematic diagram of the structure of a recommended device provided in an embodiment of the present application;
[0131] Figure 5 A schematic diagram of the structure of a model training device provided in an embodiment of the present application;
[0132] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0133] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0134] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0135] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0136] The execution subject of the embodiment of the present application is a recommendation device, wherein the recommendation device can be any electronic device that can execute the technical solution disclosed in the embodiment of the method of the present application. Optionally, the recommendation device can be one of the following: a computer, a server.
[0137] It should be understood that the method embodiment of the present application can also be implemented by a processor executing computer program code. The following describes the embodiment of the present application in conjunction with the drawings in the embodiment of the present application. Figure 1 , Figure 1 A flowchart of a recommended method provided in an embodiment of the present application.
[0138] 101. Obtain a first target embedding vector and target noise.
[0139] In an embodiment of the present application, the first target embedding vector (embedding) contains a vector of feature information of the material of interest to the target object. For example, the first target embedding vector is [1, 0, 7, 3]. Different numerical values in the first target embedding vector represent feature information of different dimensions of the material of interest to the target object. The dimensions of the material include popularity dimension, timeliness dimension, etc.
[0140] Optionally, the material that the target object is interested in includes information of one or more modalities. For example, the material that the target object is interested in includes pictures and text. For another example, the material that the target object is interested in includes videos and text.
[0141] In one implementation method of obtaining a first target embedding vector, characteristic information of one or more modal information in a material of interest to a target object is extracted separately to obtain embedding vectors of the one or more modal information, and then the embedding vectors of the one or more modal information are concatenated to obtain a first target embedding vector.
[0142] In another implementation method of obtaining the first target embedding vector, characteristic information of one or more modal information in the material of interest to the target object is extracted separately to obtain embedding vectors of the one or more modal information, and then the embedding vectors of the one or more modal information are weightedly fused by weight values to obtain the first target embedding vector.
[0143] In the embodiment of the present application, the target noise is the noise used to add noise to the first target embedding vector.
[0144] In one possible implementation, target noise is generated according to the first target embedding vector, and a mean value of the target noise is positively correlated with the first target embedding vector.
[0145] In another possible implementation, the target noise is randomly generated noise based on a preset interval of noise intensity. For example, when the preset interval of noise intensity is [0, 4], the randomly generated target noise can be [0, 3, 1, 4] or [1, 3, 4, 2].
[0146] In one implementation of obtaining the first target embedding vector and target noise, the recommendation device receives the first target embedding vector and target noise from an input component. The input component includes at least one of the following: a keyboard, a mouse, a touch screen, a touchpad, and an audio input device.
[0147] In another implementation of obtaining the first target embedding vector and target noise, the recommendation device receives the first target embedding vector and target noise sent by a terminal. The terminal includes at least one of the following: a mobile phone, a computer, a tablet computer, and a server.
[0148] It should be understood that in the embodiment of the present application, the steps of obtaining the first target embedding vector and the target noise by the recommendation device can be performed separately or simultaneously, and the present application does not limit this.
[0149] 102. Add noise to the first target embedding vector based on the target noise to obtain a second target embedding vector.
[0150] In an embodiment of the present application, the second target embedding vector is obtained based on the first target embedding vector, so the second target embedding vector and the first target embedding vector have the same dimension, and since the second target embedding vector is obtained by adding noise to the first target embedding vector based on the target noise, the feature information at the same position of the second target embedding vector and the first target embedding vector may be the same or different. For example, the first target embedding vector is [1,2,3,4], and the target noise is [0,1,1,0]. The second target embedding vector obtained by adding noise to the first target embedding vector based on the target noise is [1,1,1,4]. The feature information at the 1st and 4th positions of the second target embedding vector and the first target embedding vector are the same, and the feature information at the 2nd and 3rd positions of the second target embedding vector and the first target embedding vector are different.
[0151] Optionally, the target noise follows a continuous distribution. Using the target noise for noise addition, since the target noise follows a continuous distribution, there is no discrete noise in the target noise, thereby avoiding the introduction of discrete noise, thereby reducing the complexity of subsequent denoising of the second target embedding vector and improving the accuracy of denoising. The target noise can follow any of the following continuous distributions: Gaussian distribution, exponential distribution, uniform distribution, Cauchy distribution, etc.
[0152] 103. Perform noise reduction on the second target embedding vector to obtain a third target embedding vector.
[0153] In an embodiment of the present application, the third target embedding vector is obtained by denoising the second target embedding vector, and the similarity between the denoised third target embedding vector and the first target embedding vector is greater than a first threshold, wherein the first threshold is used to determine whether the third target embedding vector contains characteristic information of the material of interest to the target object. Since the first target embedding vector is the characteristic of the material of interest to the target object, when the similarity between the third target embedding vector and the first target embedding vector is greater than the first threshold, the similarity between the third target embedding vector and the first target embedding vector is high, and the probability that the third target embedding vector is the characteristic of the material of interest to the target object is high.
[0154] In one possible implementation, a low-pass filter is used to remove high-frequency features in the second target embedding vector, thereby removing high-frequency noise in the second target embedding vector to obtain a third target embedding vector.
[0155] In another possible implementation, the diffusion model is used to inversely predict the noise during noise addition, thereby removing the predicted noise and obtaining the third target embedding.
[0156] In an embodiment of the present application, a recommendation device obtains a first target embedding vector and target noise, then adds noise to the first target embedding vector based on the target noise to obtain a second target embedding vector. The first target embedding vector represents the characteristics of the material of interest to the target subject. After obtaining the second target embedding vector, the device performs noise reduction on the second target embedding vector to obtain a third target embedding vector. The recommendation device adds noise to the first target embedding vector using the target noise to obtain the second target embedding vector, causing some feature information in the first target embedding vector to change. By performing noise reduction on the second target embedding vector, the device predicts the changed feature information in the second target embedding vector and restores the changed feature information to its pre-change state to obtain the third target embedding vector. However, because the noise reduction process makes it difficult to accurately predict the changed feature information in the second target embedding vector, the noise-reduced third target embedding vector still contains residual noise. The presence of residual noise can cause the feature information in the third target embedding vector to differ from that in the first target embedding vector, thereby increasing the difference between the third target embedding vector and the first target embedding vector. On the other hand, since the first target embedding vector is the feature of the material of interest to the target object, when the similarity between the third target embedding vector and the first target embedding vector is greater than the first threshold, the probability that the third target embedding vector contains the feature information of the material of interest to the target object is higher.
[0157] Therefore, based on the above two aspects, the third target embedding vector can contain the characteristic information of the material that the target object is interested in, and the difference between the third target embedding vector and the first target embedding vector can be increased.
[0158] In a possible implementation scenario, a third target embedding vector is used to match at least one material to be recommended, and a material similar to the third target embedding vector is determined from the at least one material to be recommended as a target material recommended to the target object. Compared with matching at least one material to be recommended using the first target embedding vector, the diversity of the matching embedding vectors can be improved, thereby making the feature information contained in the matched target material less similar to the first target embedding vector. When the target material is recommended to the target object, the diversity of the target materials recommended to the target object is higher.
[0159] As an optional implementation, the recommendation device performs the following steps during the process of executing step 102:
[0160] 2001. Obtain target object information of a target object.
[0161] In the embodiment of the present application, the target object information is the basic information of the target object, and the target object information is the unique identifier of the target object.
[0162] In one possible implementation, the target user is the target user who consumes materials on the material consumption platform. The target user's target information includes the target user's age, gender, city, etc. When it is necessary to collect the target user's target information, the personal information processing rules are clearly indicated using signs / information, and the individual's authorization is obtained through pop-up information or by the individual uploading their personal information. The personal information processing may include information such as the personal information processor, the purpose of the personal information processing, the processing method, and the type of personal information processed.
[0163] 2002. Denoise the second target embedding vector based on the target object information to obtain a third target embedding vector.
[0164] In an embodiment of the present application, the second target embedding vector is denoised based on the target object information, so that the similarity between the third target embedding vector obtained by denoising and the target object information is greater than a second threshold. When the similarity between the third target embedding vector and the target object information is greater than the second threshold, the third target embedding vector has a high similarity to the target object information. Since the first target embedding vector includes feature information of the material of interest to the target object, the first target embedding vector has a high similarity to the target object information, and the third target embedding vector has a high similarity to the first target embedding vector. The recommendation device uses the target object information to guide the recommendation device to denoise the second target embedding vector, generating a third target embedding vector that has a high similarity to the first target embedding vector, thereby increasing the probability that the third target embedding vector obtained by denoising includes feature information of the material of interest to the target object.
[0165] In one possible implementation, the embedding of target object information is extracted to obtain a target object embedding vector, and a target noise reduction condition is generated based on the target object embedding vector, where the target noise reduction condition includes a similarity with the target object embedding vector being greater than a second threshold. When noise reduction is performed on the second target embedding vector, the noise reduction process obtains a third target embedding vector that satisfies the target noise reduction condition, and the similarity between the third target embedding vector and the target object embedding vector is greater than the second threshold.
[0166] In another possible implementation, the target semantics of the target object information are extracted and used as positive samples of the comparative denoising model. The comparative denoising model fuses the positive samples in the comparative denoising model when denoising the second target embedding vector, so that the similarity between the denoised third target embedding vector and the target object information is greater than the second threshold.
[0167] In an embodiment of the present application, upon obtaining target object information of the target object, the recommendation device performs noise reduction on the second target embedding vector based on the target object information to obtain a third target embedding vector having a similarity with the target object information greater than a second threshold. Through the above steps, the similarity between the third target embedding vector obtained by the recommendation device and the target object information is greater than the second threshold, the third target embedding vector has a high similarity with the target object information, and the first target embedding vector includes feature information of the material of interest to the target object. Therefore, the first target embedding vector has a high similarity with the target object information, and the third target embedding vector has a high similarity with the first target embedding vector. The recommendation device uses the target object information to guide the recommendation device to perform noise reduction on the second target embedding vector, guiding the generation of a third target embedding vector with a high similarity to the first target embedding vector, thereby increasing the probability that the obtained third target embedding includes feature information of the material of interest to the target object.
[0168] As an optional implementation, the recommendation device performs the following steps during step 103:
[0169] 3001. Obtain at least one material to be recommended.
[0170] In the embodiment of the present application, the material to be recommended is a material that has not been recommended to the target object.
[0171] 3002. Extract feature information of at least one material to be recommended, and obtain at least one embedding vector to be recommended.
[0172] 3003. Determine, from the at least one embedding vector to be recommended, an embedding vector whose similarity to the third target embedding vector is greater than a third threshold, as a fourth target embedding vector.
[0173] In an embodiment of the present application, the third threshold is used to determine the similarity between the third target embedding vector and the embedding vector to be recommended. Since the third target embedding vector is likely to be a material of interest to the target object, the higher the similarity between the third target embedding vector and the embedding vector to be recommended, the higher the probability that the embedding vector to be recommended includes feature information of the material of interest to the target object.
[0174] 3004. Determine a material corresponding to the fourth target embedding vector from at least one material to be recommended, and obtain a target material recommended to the target object.
[0175] In an embodiment of the present application, since the third interaction embedding vector is more likely to be a material of interest to the target object, and the third interaction embedding vector contains feature information different from that of the first target embedding vector, the third interaction embedding vector is used to match at least one embedding vector to be recommended. This can increase the diversity of the embedding vectors to be matched, and avoid using the embedding vector of the material with which the target object has interacted to match at least one embedding vector to be recommended, resulting in a high degree of uniformity in the materials recommended to the target object, which in turn leads to the emergence of an information cocoon.
[0176] In one possible implementation scenario, the material to be recommended is a document to be recommended on an internet platform, and the document includes at least one of an image, text, video, and audio. A document having a similarity with the third embedding vector greater than a third threshold is determined from the at least one document to be recommended as a target document, and the target document is recommended to the target object.
[0177] Optionally, when there is a newly generated material in at least one of the materials to be recommended, it is also possible to avoid the situation where all the materials that the target object has interacted with are popular materials, resulting in the inability to recommend the newly generated material, thereby increasing the exposure rate of the newly generated material.
[0178] In one possible implementation scenario, a recommendation device obtains a first target model for adding noise to an embedding vector and for reducing noise from the added embedding vector, and a second target model for extracting feature information of an object's object information and feature information of a material. The first target model and the second target model are trained together using training data, the training data including training object information of the training object, a first embedding vector, and a training recommendation vector. The first embedding vector includes feature information of a material of interest to the training object, the training recommendation vector includes feature information of a material of interest to the training object, determined based on materials with which the training object has interacted, and the similarity between the first embedding vector and the training recommendation vector is greater than a fourth threshold. Optionally, the first target model is a diffusion model for adding noise and reducing noise, and the second target model is a dual-tower model for extracting feature information of the object's object information and feature information of a material. The first branch of the dual-tower model is used to extract feature information of the object's object information, and the second branch of the dual-tower model is used to extract feature information of the material.
[0179] After obtaining a first target model and a second target model, the second target model is used to extract feature information of the target object information of the target object to obtain a target object embedding vector, and the second target model is used to extract feature information of at least one material to be recommended to obtain at least one embedding vector to be recommended. A target noise reduction condition is determined based on the target object embedding vector, and a third target embedding vector obtained by denoising the second target embedding vector using the first target model satisfies the target noise reduction condition. After determining the third target embedding vector, the recommendation device determines a fourth target embedding vector from the at least one embedding vector to be recommended, whose similarity with the third target embedding vector is greater than a third threshold, and determines a material corresponding to the fourth target embedding vector from the at least one material to be recommended as the target material to be recommended to the target object.
[0180] See also Figure 2 , Figure 2 This is a flowchart of a model training method provided in an embodiment of the present application. The model training method is performed by a model training device, which can be any electronic device capable of executing the technical solutions disclosed in the method embodiments of the present application. Optionally, the model training device can be one of the following: a computer or a server.
[0181] 201. Obtain a first embedding vector, a first noise, and a first model to be trained.
[0182] In an embodiment of the present application, the first embedding vector includes characteristic information of the first material, the first noise is noise used to add noise to the first embedding vector, and the first model to be trained is used to add noise to the embedding vector and to reduce noise on the noisy embedding vector.
[0183] In a possible implementation, first noise is generated according to the first embedding vector, and a mean value of the first noise is positively correlated with the first embedding vector.
[0184] In another possible implementation, the first noise is noise randomly generated within a preset interval. For example, when the preset interval is [0, 4], the randomly generated first noise may be [0, 3, 1, 4] or [1, 3, 4, 2].
[0185] Optionally, the first material includes information of one or more modalities. The method for extracting the feature information of the first material can be found in the method for obtaining the first target embedding vector in step 101, which will not be described in detail here.
[0186] 202. Based on the first noise, use the first to-be-trained model to add noise to the first embedding vector to obtain a second embedding vector.
[0187] In an embodiment of the present application, the model training device adds noise to the first embedding vector using the first model to be trained based on the first noise to obtain a second embedding vector.
[0188] Optionally, the first noise follows a continuous distribution. Using the first noise that follows a continuous distribution for noise addition can avoid the introduction of discrete noise, thereby reducing the complexity of subsequent denoising of the second embedding vector and improving the accuracy of denoising. The first noise can follow any of the following continuous distributions: Gaussian distribution, exponential distribution, uniform distribution, Cauchy distribution, etc.
[0189] 203. Use the first to-be-trained model to perform noise reduction on the second embedding vector to obtain a third embedding vector.
[0190] In the embodiment of the present application, the second embedding vector is obtained by adding noise to the first embedding vector, so the second embedding vector is denoised using the first model to be trained to obtain the third embedding vector.
[0191] 204. Determine a target loss according to a first difference between the third embedding vector and the first embedding vector.
[0192] In an embodiment of the present application, a target loss is determined by a first difference between the third embedding vector obtained by denoising the first model to be trained and the first embedding vector, and the target loss is positively correlated with the first difference.
[0193] 205. Update the parameters of the first to-be-trained model based on the target loss to obtain a first target model.
[0194] In an embodiment of the present application, the parameters in the first model to be trained are updated based on the target loss, thereby improving the accuracy of denoising of the first model to be trained, and then training the first model to be trained to become the first target model.
[0195] In one possible implementation, the model training device determines the gradient of the first model to be trained based on the loss of the first model to be trained. Based on the gradient of the first model to be trained, the model to be trained is subjected to reverse gradient propagation, and the parameters of the first model to be trained are updated until the loss of the first model to be trained converges, thereby obtaining a first target model.
[0196] In an embodiment of the present application, a model training device obtains a first embedding vector, a first noise, and a first model to be trained, wherein the first embedding vector includes characteristic information of a first material, the first noise is noise used to add noise to the first embedding vector, and the first model to be trained is a model used to add noise to the embedding vector and to reduce noise on the noisy embedding vector. Based on the first noise, the model training device uses the first model to be trained to add noise to the first embedding vector to obtain a second embedding vector, and uses the first model to be trained to reduce noise on the first embedding vector to obtain a third embedding vector. Based on a first difference between the third embedding vector and the first embedding vector, a target loss is determined, and the parameters in the first model to be trained are updated based on the target loss to obtain a first target model. Specifically, by updating the parameters in the first model to be trained, the target loss is reduced until the target loss converges, and a first target model is obtained that can be used to add noise and reduce noise to the first embedding vector containing the characteristic information of the material, and a third embedding vector first target model that is different from the characteristic information in the first embedding vector is obtained.
[0197] When the target loss decreases, the difference between the third embedding vector and the first embedding vector decreases. The third embedding vector is obtained by denoising the first model to be trained. The smaller the difference between the third embedding vector and the first embedding vector, the higher the probability that the third embedding vector obtained by denoising the first target model contains the feature information of the first material carried by the first embedding vector.
[0198] In summary, the first target model can be used to add noise and reduce noise on the first embedding vector containing the feature information of the first material, to obtain a third embedding vector that contains the feature information in the first embedding vector and is different from the feature information in the first embedding vector.
[0199] As an optional implementation manner, the model training device performs the following steps in the process of obtaining the first noise:
[0200] 301. Obtain T second noises.
[0201] In the embodiment of the present application, T second noises include T-1 third noises and the first noise.
[0202] The model training device performs the following steps during the execution of step 202:
[0203] 302. Use T-1 third noises to perform T-1 noise additions on the first embedding vector to obtain a fourth embedding vector.
[0204] In this embodiment of the present application, the second embedding vector is noisyed T-1 times using T-1 third noises to obtain a fourth embedding vector, with each third noise being noisy once. For example, when third noises A1, A2, and A3 are present, the second embedding vector B0 is noisyed using A1 to obtain B1, B1 is noisyed using A2 to obtain B2, and B2 is noisyed using A3 to obtain the fourth embedding vector B3.
[0205] 303. Use the first noise to add noise to the fourth embedding vector to obtain a second embedding vector.
[0206] In the embodiment of the present application, when the first embedding vector is subjected to T-1 noise additions to obtain the fourth embedding vector, the fourth embedding vector is subjected to noise additions using the first noise to obtain the second embedding vector.
[0207] In a possible implementation scenario, the T second noises follow a Gaussian distribution. Optionally, the formula for performing T times of noise addition on the first embedding vector using the T second noises is as follows:
[0208]
[0209] Where t represents the number of times the first embedding vector is noised, and x t represents the embedding vector after the first embedding vector is noised t times, x0 represents the first embedding vector, β t represents the noise schedule, I represents the identity matrix, β t I represents the covariance matrix of the second noise added, p(x T |x0) represents the result of adding noise to x0 T times to get x T , p(x t |x t-1 ) represents x t-1 Add noise once to get x T , Characterization C1 to C T The product of Representation x t-1 The x obtained after adding noise t Obeying the normal distribution, x t The mean of the normal distribution is x t The variance of the normal distribution is β t I.
[0210] In an embodiment of the present application, after obtaining T second noises, the model training device uses T-1 third noises from the T second noises to perform T-1 noise additions on the first embedding vector to obtain a fourth embedding vector, and then uses the first noise from the T second noises to perform noise additions on the fourth embedding vector to obtain a second embedding vector. Through the above steps, the model training device performs T noise additions on the first embedding vector so that the noised second embedding vector approaches pure noise, thereby enabling the first model to be trained to denoise the second embedding vector approaching pure noise to obtain a third embedding vector with a high similarity to the first embedding vector, thereby improving the noise reduction capability of the first model to be trained and improving the noise reduction accuracy of the first model to be trained.
[0211] As an optional implementation, the model training device performs the following steps during the execution of step 203:
[0212] 401. Use the first to-be-trained model to perform T denoising on the first embedding vector to obtain a third embedding vector.
[0213] In this embodiment of the present application, the first embedding vector is subjected to T denoising using the first model to be trained to obtain a third embedding vector. It should be understood that the first model to be trained performs denoising based on the denoised embedding vector, and repeats the process T times to obtain the third embedding vector. Optionally, the formula for performing T denoising on the second embedding vector is as follows:
[0214]
[0215] Among them, t represents the number of noise reduction, x T Represents the second embedding vector, represents the embedding vector after the second embedding vector is denoised Tt times, x0 represents the third embedding vector, Characterization of x T Perform T times of denoising to get p(x T ) represents denoising the second embedding vector. Characterization pair Perform 1 denoising to get Characterization C1 to C T The product of Characterization Noise reduction obeys the normal distribution, The mean of the normal distribution is The mean is based on the noise-reduced and noise-canceled It also needs to be determined by the number of times the noise is reduced. The variance of the normal distribution is The variance is based on the noise and noise-canceled It also depends on the number of times the noise is reduced.
[0216] Optionally, during the T-times denoising process on the second embedding vector, the training object information of the training object is used as a guide so that the similarity between the third embedding vector obtained through denoising and the training object information is greater than a fifth threshold. Specifically, feature information of the training object information is extracted to obtain a fifth embedding vector, and a training denoising condition is determined based on the fifth embedding vector, wherein the training denoising condition includes a similarity with the fifth embedding vector being greater than a fifth threshold. When the first to-be-trained model denoises the second embedding vector, the denoised third embedding vector satisfies the training denoising condition, i.e., the similarity between the third embedding vector and the fifth embedding vector is greater than the fifth threshold.
[0217] Optionally, the training denoising condition is used to guide the denoising of the first to-be-trained model, and the formula for obtaining the third embedding vector is as follows:
[0218]
[0219] Among them, t represents the number of times that noise needs to be reduced. represents the embedding vector after the second embedding vector is denoised Tt times, c represents the training denoising condition, right Perform 1 denoising to get And when denoising, the training denoising condition c is used as a guide. Characterization Noise reduction obeys the normal distribution, The mean of the normal distribution is The mean is based on the noise-reduced Noise-reduced It also needs to be denoised for a certain number of times and the training denoising condition c. The variance of the normal distribution is The variance is based on the noise Noise-reduced It also needs to be determined by the number of times denoised and the training denoising condition c.
[0220] In this embodiment of the present application, the first model to be trained performs T denoising on the first embedding vector to obtain a third embedding vector. By performing T denoising, each time the first model to be trained performs denoising, only a portion of the noise needs to be identified and removed. Compared to directly performing denoising to generate the third embedding vector, this can reduce the difficulty of denoising the first model to be trained and improve the accuracy of denoising the first model to be trained.
[0221] As an optional embodiment, the first embedding vector includes feature information of the first material, and the first material is the material that the training object is interested in. The model training device performs the following steps during the execution of step 203:
[0222] 501. Obtain training object information of the training object.
[0223] In the embodiment of the present application, the training object information is the basic information of the training object, and the training object information is the unique identifier of the training object.
[0224] In one possible implementation, the training subjects are training users who consume materials on the material consumption platform. The training subject information for the training users includes their age, gender, and city of residence. When collecting training subject information, the personal information processing rules are clearly indicated using signs / information, and individual authorization is obtained through pop-up messages or by the individual uploading their personal information. Personal information processing may include information such as the personal information processor, the purpose of the personal information processing, the processing method, and the type of personal information processed.
[0225] 502. Based on the training object information, use the first to-be-trained model to perform noise reduction on the second embedding vector to obtain a third embedding vector.
[0226] In an embodiment of the present application, the second embedding vector is denoised using the first model to be trained, so that the similarity between the third embedding vector obtained by denoising and the training object information is greater than the fifth threshold, that is, the similarity between the third embedding vector and the training object information is high.
[0227] Because the first embedding vector includes characteristic information of the first material of interest to the training subject, the first embedding vector has a high degree of similarity to the training subject information. The third embedding vector also has a high degree of similarity to the training subject information, and therefore the first and third embedding vectors have a high degree of similarity. The model training device uses the training subject information to guide the first to-be-trained model to perform denoising on the second embedding vector, generating a third embedding vector with a high degree of similarity to the first embedding vector. This improves the accuracy of denoising performed by the first to-be-trained model and increases the probability that the denoised third embedding vector includes characteristic information of the material of interest to the training subject.
[0228] In one possible implementation, a second model to be trained is obtained, and feature information of the training object information is extracted using the second model to obtain a fifth embedding vector. A training denoising condition is generated based on the fifth embedding vector, wherein the training denoising condition includes a similarity with the fifth embedding vector being greater than a fifth threshold. When the first model to be trained denoises the second embedding vector, the third embedding vector obtained by denoising satisfies the training denoising condition, i.e., the similarity between the third embedding vector and the fifth embedding vector is greater than a fifth threshold. Optionally, the first model to be trained may further determine the denoising condition based on the feature information of the object, and the training denoising condition is generated based on the fifth embedding vector using the first model to be trained.
[0229] In an embodiment of the present application, the model training device introduces the training object information of the training object during the process of using the first model to be trained for denoising, and uses the training object information to guide the first model to be trained to denoise the second embedding vector to obtain a third embedding vector, wherein the similarity between the third embedding vector and the training object information is greater than a fifth threshold. Through the above steps, the model training device uses the object information of the training object to guide the denoising of the first model to be trained, so that the generated third embedding vector has a high similarity with the object information. The first embedding vector includes feature information of the material of interest to the training object, and the first embedding vector has a high similarity with the training object information. Therefore, using the object information of the training object to guide the denoising of the first model to be trained can also make the generated third embedding vector have a high similarity with the first embedding vector, thereby improving the accuracy of the denoising of the first model to be trained.
[0230] As an optional embodiment, the first material is a material that the training subject has interacted with, the first material is a material whose similarity with the recommended material is greater than a sixth threshold among the materials that the training subject has interacted with, the recommended material is a material that the training subject is interested in, determined based on the materials that the training subject has interacted with, and the training subject has not interacted with the recommended material. During step 204, the model training device performs the following steps:
[0231] 601. Get recommended materials.
[0232] In the embodiment of the present application, the recommended material is the material that the training subject is interested in, which is determined based on the materials that the training subject has interacted with. However, since the recommended material is predicted based on the materials that the training subject has interacted with, and the training subject has not interacted with the recommended material, there is a situation where the training subject is not interested in the recommended material, but is predicted to be interested in the recommended material. In order to avoid this situation, it is determined from the materials that the training subject has interacted with whether there is a material whose similarity with the recommended material is greater than a sixth threshold. In the case where there is a first material whose similarity with the recommended material is greater than the sixth threshold among the materials that the training subject has interacted with, the recommended material is predicted to be the material that the training subject is interested in, and the training subject has interacted with the first material (the material whose similarity with the recommended material is greater than the sixth threshold among the materials that the training subject has interacted with), indicating that the probability that the recommended material is the material that the target subject is interested in is high.
[0233] 602. Utilize the second to-be-trained model to extract feature information of the recommended material to obtain a training recommendation vector.
[0234] 603. Determine a first loss according to a first difference between the third embedding vector and the first embedding vector.
[0235] In the embodiment of the present application, the first loss is determined based on the first difference between the third embedding vector and the first embedding vector, and the first loss is positively correlated with the first difference. Optionally, the formula for determining the first loss is as follows:
[0236]
[0237] Among them, L1 is the first loss, mb lastnk is the first embedding vector, emb diffusion is the third embedding vector.
[0238] 604. Determine a second loss based on a second difference between the fifth embedding vector and the training recommendation vector.
[0239] In this embodiment of the present application, a second loss is determined based on the second difference between the fifth embedding vector and the training recommendation vector, and the second loss is positively correlated with the second difference. Optionally, the formula for determining the second loss is as follows:
[0240] L2=InfoNCE(emb user ,emb item )…Formula (7)
[0241] Among them, L2 is the second loss, emb user is the fifth embedding vector, emb item Recommend vectors for training.
[0242] 605. Determine a target loss based on the first loss and the second loss.
[0243] In the embodiment of the present application, the target loss is determined according to the first loss and the second loss, wherein the target loss is positively correlated with the first loss, and the target loss is positively correlated with the second loss.
[0244] After determining the target loss, the model training apparatus performs the following steps:
[0245] 606. Update the parameters of the second to-be-trained model based on the target loss to obtain a second target model.
[0246] In an embodiment of the present application, the parameters in the second model to be trained are updated based on the target loss, thereby improving the accuracy of the feature information of the object information extracted by the second model to be trained and the feature information of the extracted material, and then training the second model to be trained to become a second target model.
[0247] In one possible implementation, the model training device determines the gradient of the second model to be trained based on the loss of the second model to be trained. Based on the gradient of the second model to be trained, the model to be trained is subjected to reverse gradient propagation, and the parameters of the second model to be trained are updated until the loss of the second model to be trained converges, thereby obtaining a second target model.
[0248] In an embodiment of the present application, when obtaining recommended materials, the model training device uses the second model to be trained to extract feature information of the training object information of the training object to obtain a fifth embedding vector, and uses the second model to be trained to extract feature information of the recommended material to obtain a training recommendation vector. According to the first difference between the third embedding vector and the first embedding vector, the first loss is determined. According to the second difference between the fifth embedding vector and the training recommendation vector, the second loss is determined. According to the first loss and the second loss, the target loss is determined, and then the parameters of the first model to be trained are updated based on the target loss to obtain the first target model, and the parameters of the second model to be trained are updated based on the target loss to obtain the second target model. Specifically, by updating the parameters in the first model to be trained, the first loss is reduced, and by updating the parameters in the second model to be trained, the second loss is reduced, and then the target loss is reduced until the target loss converges to obtain the first target model and the second target model.
[0249] On the one hand, when the target loss decreases, the first loss decreases, and the difference between the third embedding vector and the first embedding vector decreases. The third embedding vector is obtained by denoising the first to-be-trained model. The smaller the difference between the first embedding vector and the first embedding vector, the higher the accuracy of the denoising result of the first to-be-trained model.
[0250] On the other hand, when the target loss decreases, the second loss also decreases, and the difference between the fifth embedding vector and the training recommendation vector decreases. The smaller the difference between the fifth embedding vector and the training recommendation vector, the closer the fifth embedding vector matches the training recommendation vector. The fifth embedding vector includes feature information of the training object extracted by the second to-be-trained model, and the training recommendation vector includes feature information of recommended items extracted by the second to-be-trained model. The recommended items are items of interest to the target object. Therefore, the closer the match between the fifth embedding vector and the training recommendation vector, the more accurate the feature information extracted by the second to-be-trained model. Furthermore, since the similarity between the first item and the recommended item is greater than the sixth threshold, the first embedding vector and the training recommendation vector have a high similarity. The smaller the difference between the fifth embedding vector and the training recommendation vector, the higher the similarity between the fifth embedding vector and the first embedding vector. Since the third embedding vector obtained by using the fifth embedding vector to guide the first to-be-trained model for denoising has a high similarity to the fifth embedding vector, and the fifth embedding vector has a high similarity to the first embedding vector, the third embedding vector has a high similarity to the first embedding vector, further improving the accuracy of the denoising results of the first to-be-trained model.
[0251] As an optional implementation, the model training device performs the following steps during the execution of step 605:
[0252] 701. Determine a third loss based on a third difference between the third embedding vector and the training recommendation vector.
[0253] In the embodiment of the present application, a third loss is determined based on a third difference between the third embedding vector and the training recommendation vector, and the third loss is positively correlated with the third difference. Optionally, the formula for the third loss is as follows:
[0254] L3=InfoNCE(emb diffusion ,emb item )…Formula (8)
[0255] Among them, L3 is the third loss, emb diffusion is the third embedding vector, emb item Recommend vectors for training.
[0256] 702. Determine the target loss based on the first loss, the second loss, and the third loss.
[0257] In the embodiment of the present application, the target loss is determined based on the first loss, the second loss, and the third loss, wherein the target loss is positively correlated with the first loss, the target loss is positively correlated with the second loss, and the target loss is positively correlated with the third loss. Optionally, the formula for the target loss is as follows:
[0258] L Total=L1+L2+L3…Formula (9)
[0259] Among them, L Total is the target loss, L1 is the first loss, L2 is the second loss, and L3 is the third loss.
[0260] In an embodiment of the present application, the model training device determines a third loss based on the third difference between the third embedding vector and the training recommendation vector, determines a target loss based on the first loss, the second loss, and the third loss, and then updates the parameters of the first model to be trained based on the target loss to obtain a first target model, and updates the parameters of the second model to be trained based on the target loss to obtain a second target model. Specifically, by updating the parameters in the first model to be trained, the first loss is reduced, and by updating the parameters in the second model to be trained, the second loss is reduced, and then the target loss is reduced, until the target loss converges, thereby obtaining the first target model and the second target model.
[0261] When the target loss decreases, the third loss also decreases. The third loss is determined based on the third embedding vector and the training recommendation vector. The smaller the third loss, the higher the similarity between the third embedding vector and the training recommendation vector. Since the training recommendation vector has a higher similarity to the first embedding vector, the higher the similarity between the third embedding vector and the second embedding vector, further improving the accuracy of the denoising results of the first to-be-trained model. Furthermore, by introducing the third vector, the target loss is increased when the accuracy of the denoising results of the first to-be-trained model decreases, thereby accelerating the training speed of the first to-be-trained model and speeding up the fitting of the first to-be-trained model.
[0262] In one possible implementation, Figure 3 The following is a flow chart of a model training method and a recommendation method provided in an embodiment of the present application. Specifically, Figure 3 The first model to be trained is used to add noise to the embedding vector and to reduce noise on the noisy embedding vector. The second model to be trained includes a first branch and a second branch, wherein the first branch is used to extract feature information of the object information and the second branch is used to extract feature information of the material. Figure 3 It also includes a material model for extracting feature information of materials that the user has interacted with. The model can be the second branch of the second model to be trained, or it can be any model for extracting feature information of materials.
[0263] During the training phase, by executing the model training method to achieve feature extraction, noise addition, and noise reduction, the first branch of the second model to be trained is used to extract feature information of the training object information of the training object to obtain a fifth embedding vector. The material model or the second branch of the second model to be trained is used to extract feature information of the recommended material to obtain a training recommendation vector. The material model is used to extract feature information of at least one material with which the training object has interacted, and feature information having a similarity with the training recommendation vector greater than a sixth threshold is determined to obtain a first embedding vector. The first embedding vector is then noised to obtain a second embedding vector. Optionally, the first embedding vector is noised T times to obtain a second embedding vector, so that the noised second embedding vector approaches pure noise. Specifically, the first embedding vector is noised once using the first model to be trained to obtain a sixth embedding vector, and the sixth embedding vector is then noised T-1 times to obtain a second embedding vector.
[0264] After generating the second embedding vector, the first model to be trained is used to perform denoising on the second embedding vector to obtain a third embedding vector. Optionally, the first model to be trained is used to guide the first model to perform denoising on the second embedding vector, so that the similarity between the denoising result and the fifth embedding vector is greater than a fifth threshold. Specifically, a training denoising condition is generated based on the fifth embedding vector, so that the third embedding vector generated by denoising the first model to be trained meets the training denoising condition, which includes a similarity with the fifth embedding vector being greater than a fifth threshold. After the first embedding vector is denoised T times to obtain the second embedding vector, the first model to be trained is used to perform denoising on the second embedding vector T times to obtain the third embedding vector.
[0265] A first loss is determined based on a first difference between the first embedding vector and the third embedding vector, a second loss is determined based on a second difference between the fifth embedding vector and the training recommendation vector, and a third loss is determined based on a third difference between the third embedding vector and the training recommendation vector. A target loss is determined based on the first loss, the second loss, and the third loss, wherein the target loss is positively correlated with the first loss, the target loss is positively correlated with the second loss, and the target loss is positively correlated with the third loss. The target loss is used to update the parameters of the first model to be trained to obtain a first target model, and the target loss is used to update the parameters of the second model to be trained to obtain a second target model.
[0266] During the inference phase, feature information of the material of interest to the target object is extracted to obtain a first target embedding vector. Based on target noise, the first target model is used to add noise to the first target embedding vector of the material of interest to the target object to obtain a second target embedding vector. The first target model is then used to reduce noise on the second target embedding vector to obtain a third target embedding vector. Optionally, when reducing noise on the second target embedding vector using the first target model, target object information of the target object can be introduced. Specifically, the second target model is used to extract feature information of the target object information to obtain a target object embedding vector. A target noise reduction condition is generated based on the target object embedding vector so that the third target embedding vector generated by noise reduction with the first target model meets the target noise reduction condition, wherein the target noise reduction condition includes a similarity with the target object embedding vector greater than a second threshold. After generating the third target embedding vector, the third target embedding vector is used to match at least one material to be recommended to obtain a target material recommended to the target object.
[0267] Those skilled in the art will appreciate that, in the above-described methods of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible inherent logic. The above details the method of the embodiment of the present application, and the following provides an apparatus of the embodiment of the present application.
[0268] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a recommendation device provided in an embodiment of the present application. The recommendation device 1 includes: an acquisition unit 11, a noise adding unit 12, and a noise reducing unit 13. Among them:
[0269] An acquisition unit 11 is configured to acquire a first target embedding vector and target noise, wherein the first target embedding vector includes feature information of a material of interest to a target object;
[0270] a noise adding unit 12, configured to add noise to the first target embedding vector based on the target noise to obtain a second target embedding vector;
[0271] The denoising unit 13 is configured to perform denoising on the second target embedding vector to obtain a third target embedding vector, where a similarity between the third target embedding vector and the first target embedding vector is greater than a first threshold.
[0272] In conjunction with any embodiment of the present application, the acquisition unit 11 is further configured to:
[0273] Get target object information of the target object;
[0274] The above-mentioned noise reduction unit is specifically used for:
[0275] The second target embedding vector is denoised based on the target object information to obtain the third target embedding vector, where a similarity between the third target embedding vector and the target object information is greater than a second threshold.
[0276] In conjunction with any embodiment of the present application, the noise reduction unit is specifically configured to:
[0277] Extracting feature information of the target object information to obtain a target object embedding vector;
[0278] generating a target noise reduction condition according to the target object embedding vector, wherein the target noise reduction condition includes a similarity with the target object embedding vector being greater than the second threshold;
[0279] Noise reduction is performed on the second target embedding vector to obtain the third target embedding vector that meets the target noise reduction condition, and the similarity between the third target embedding vector and the target object embedding vector is greater than the second threshold.
[0280] In combination with any embodiment of the present application, the target noise obeys a continuous distribution.
[0281] In conjunction with any embodiment of the present application, the recommendation device 1 further includes a recommendation unit 14, which is configured to:
[0282] Get at least one material to be recommended;
[0283] Extracting feature information of the at least one material to be recommended to obtain at least one embedding vector to be recommended;
[0284] Determine, from the at least one embedding vector to be recommended, an embedding vector having a similarity with the third target embedding vector greater than the third threshold, as a fourth target embedding vector;
[0285] A material corresponding to the fourth target embedding vector is determined from the at least one material to be recommended, and a target material recommended to the target object is obtained.
[0286] In an embodiment of the present application, a recommendation device obtains a first target embedding vector and target noise, then adds noise to the first target embedding vector based on the target noise to obtain a second target embedding vector. The first target embedding vector represents the characteristics of the material of interest to the target subject. After obtaining the second target embedding vector, the device performs noise reduction on the second target embedding vector to obtain a third target embedding vector. The recommendation device adds noise to the first target embedding vector using the target noise to obtain the second target embedding vector, causing some feature information in the first target embedding vector to change. By performing noise reduction on the second target embedding vector, the device predicts the changed feature information in the second target embedding vector and restores the changed feature information to its pre-change state to obtain the third target embedding vector. However, because the noise reduction process makes it difficult to accurately predict the changed feature information in the second target embedding vector, the noise-reduced third target embedding vector still contains residual noise. The presence of residual noise can cause the feature information in the third target embedding vector to differ from that in the first target embedding vector, thereby increasing the difference between the third target embedding vector and the first target embedding vector. On the other hand, since the first target embedding vector is the feature of the material of interest to the target object, when the similarity between the third target embedding vector and the first target embedding vector is greater than the first threshold, the probability that the third target embedding vector contains the feature information of the material of interest to the target object is higher.
[0287] Therefore, based on the above two aspects, the third target embedding vector can contain the characteristic information of the material that the target object is interested in, and the difference between the third target embedding vector and the first target embedding vector can be increased.
[0288] See also Figure 5 , Figure 5 This is a structural diagram of a model training device provided in an embodiment of the present application. The model training device 2 includes: an acquisition unit 21, a noise addition unit 22, a noise reduction unit 23, a loss calculation unit 24, and an update unit 25. Among them:
[0289] An acquisition unit 21 is configured to acquire a first embedding vector, a first noise, and a first model to be trained, wherein the first embedding vector includes feature information of a first material;
[0290] a noise adding unit 22, configured to add noise to the first embedding vector using the first to-be-trained model based on the first noise to obtain a second embedding vector;
[0291] a denoising unit 23, configured to perform denoising on the second embedding vector using the first to-be-trained model to obtain a third embedding vector;
[0292] a loss calculation unit 24, configured to determine a target loss based on a first difference between the third embedding vector and the first embedding vector, wherein the target loss is positively correlated with the first difference;
[0293] An updating unit 25 is configured to update parameters in the first to-be-trained model based on the target loss to obtain a first target model.
[0294] In combination with any embodiment of the present application, the first embedding vector includes feature information of the first material;
[0295] The acquisition unit 21 is specifically configured to:
[0296] Acquire the first material, where the first material includes information of more than one modality;
[0297] Feature information of one or more modal information in the first material is extracted to obtain a first embedding vector.
[0298] In combination with any embodiment of the present application, the first noise obeys a continuous distribution.
[0299] In conjunction with any embodiment of the present application, the acquisition unit 21 is specifically configured to:
[0300] Acquire T second noises, where the T second noises include T-1 third noises and the first noise;
[0301] The noise adding unit 22 is specifically used for:
[0302] Using the T-1 third noises, perform T-1 noise additions on the first embedding vector to obtain a fourth embedding vector, and perform denoising once on any of the third noises;
[0303] Noise is added to the fourth embedding vector using the first noise to obtain the second embedding vector.
[0304] In conjunction with any embodiment of the present application, the noise reduction unit 23 is specifically configured to:
[0305] The first embedding vector is denoised T times using the first to-be-trained model to obtain the third embedding vector.
[0306] In combination with any embodiment of the present application, the first embedding vector includes feature information of a first material, where the first material is a material of interest to the training subject;
[0307] The noise reduction unit 23 is specifically used to:
[0308] Acquiring training object information of the training object;
[0309] Based on the training object information, the second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector, where a similarity between the third embedding vector and the training object information is greater than a fifth threshold.
[0310] In conjunction with any embodiment of the present application, the noise reduction unit 23 is specifically configured to:
[0311] Obtain the second model to be trained;
[0312] Extracting feature information of the training object information using the second to-be-trained model to obtain a fifth embedding vector;
[0313] generating a training denoising condition based on the fifth embedding vector, the training denoising condition including a similarity with the fifth embedding vector being greater than a fifth threshold;
[0314] The second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector that satisfies the training denoising condition, and the similarity between the third embedding vector and the fifth embedding vector is greater than the fifth threshold.
[0315] In conjunction with any embodiment of the present application, the first material is a material with which the training subject has interacted, the first material is a material with which the training subject has interacted and whose similarity to the recommended material is greater than a sixth threshold, the recommended material is a material of interest to the training subject determined based on the materials with which the training subject has interacted, and the training subject has not interacted with the recommended material;
[0316] The loss calculation unit 24 is specifically used to:
[0317] Obtaining the recommended material;
[0318] Extracting feature information of the recommended material using the second to-be-trained model to obtain a training recommendation vector;
[0319] determining a first loss based on the first difference between the third embedding vector and the first embedding vector, wherein the first loss is positively correlated with the first difference;
[0320] determining a second loss based on a second difference between the fifth embedding vector and the training recommendation vector, wherein the second loss is positively correlated with the second difference;
[0321] determining the target loss according to the first loss and the second loss, wherein the target loss is positively correlated with the first loss and the target loss is positively correlated with the second loss;
[0322] The updating unit 25 is further configured to:
[0323] The parameters of the second model to be trained are updated based on the target loss to obtain a second target model.
[0324] In conjunction with any embodiment of the present application, the loss calculation unit 24 is specifically configured to:
[0325] determining a third loss based on a third difference between the third embedding vector and the training recommendation vector, wherein the third loss is positively correlated with the third difference;
[0326] The target loss is determined according to the first loss, the second loss, and the third loss, and the target loss is positively correlated with the third loss.
[0327] In an embodiment of the present application, a model training device obtains a first embedding vector, a first noise, and a first model to be trained, wherein the first embedding vector includes characteristic information of the first material, the first noise is noise used to add noise to the first embedding vector, and the first model to be trained is a model used to reduce the noise of the noisy embedding vector. The model training device uses the first noise to add noise to the first embedding vector to obtain a second embedding vector, and uses the first model to be trained to reduce the noise of the first embedding vector to obtain a third embedding vector. According to the first difference between the third embedding vector and the first embedding vector, the target loss is determined, and the parameters in the first model to be trained are updated based on the target loss to obtain the first target model. Specifically, by updating the parameters in the first model to be trained, the target loss is reduced until the target loss converges, thereby obtaining the first target model.
[0328] When the target loss decreases, the difference between the third embedding vector and the first embedding vector decreases. The third embedding vector is obtained by denoising the first model to be trained. The smaller the difference between the third embedding vector and the first embedding vector, the higher the accuracy of the denoising result of the first model to be trained.
[0329] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0330] Figure 6An embodiment of the present application provides a schematic diagram of the hardware structure of an electronic device. The electronic device 3 includes a processor 31 and a memory 32. Optionally, the electronic device 3 also includes an input device 33 and an output device 34. The processor 31, the memory 32, the input device 33 and the output device 34 are coupled via a connector, and the connector includes various interfaces, transmission lines or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.
[0331] The processor 31 may include one or more processors, for example, one or more central processing units (CPUs). In the case where the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. Alternatively, the processor 31 may be a processor group consisting of multiple CPUs, wherein the multiple processors are coupled to each other via one or more buses. Alternatively, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present application.
[0332] The memory 32 can be used to store computer program instructions and various computer program codes, including the program code for executing the solution of the present application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable compact disc read-only memory (CD-ROM), which is used for related instructions and data.
[0333] The input device 33 is used to input data and / or signals, and the output device 34 is used to output data and / or signals. The input device 33 and the output device 34 can be independent devices or an integrated device.
[0334] It can be understood that in the embodiment of the present application, the memory 32 can be used not only to store relevant instructions, but also to store relevant data. For example, the memory 32 can be used to store the first target embedding vector and target noise obtained through the input device 33, or the memory 32 can also be used to store the third target embedding vector obtained by processing by the processor 31, etc. The embodiment of the present application does not limit the specific data stored in the memory.
[0335] It is understandable that Figure 6Only a simplified design of an electronic device is shown. In actual applications, the electronic device may further include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of the present application are within the scope of protection of the present application.
[0336] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can 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.
[0337] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here. Those skilled in the art will also clearly understand that the descriptions of the various embodiments of this application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, reference can be made to the descriptions of other embodiments.
[0338] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0339] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0340] In addition, each functional unit in each embodiment of the present application 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.
[0341] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0342] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by a computer program instructing related hardware to perform the processes. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A recommendation method, characterized in that: The method comprises: Obtaining a first target embedding vector and target noise, where the first target embedding vector includes feature information of a material of interest to the target object; Noising the first target embedding vector based on the target noise to obtain a second target embedding vector; Noise reduction is performed on the second target embedding vector to obtain a third target embedding vector, where a similarity between the third target embedding vector and the first target embedding vector is greater than a first threshold.
2. The method according to claim 1, characterized in that The denoising the second target embedding vector to obtain a third target embedding vector includes: Get target object information of the target object; Noise reduction is performed on the second target embedding vector based on the target object information to obtain the third target embedding vector.
3. The method according to claim 2, characterized in that The denoising the second target embedding vector based on the target object information to obtain the third target embedding vector includes: Extracting feature information of the target object information to obtain a target object embedding vector; generating a target noise reduction condition according to the target object embedding vector, wherein the target noise reduction condition includes a similarity with the target object embedding vector being greater than a second threshold; Noise reduction is performed on the second target embedding vector to obtain the third target embedding vector that meets the target noise reduction condition, and the similarity between the third target embedding vector and the target object embedding vector is greater than the second threshold.
4. The method according to any one of claims 1 to 3, characterized in that The target noise obeys a continuous distribution.
5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Get at least one material to be recommended; Extracting feature information of the at least one material to be recommended to obtain at least one embedding vector to be recommended; Determine, from the at least one embedding vector to be recommended, an embedding vector having a similarity with the third target embedding vector greater than a third threshold, as a fourth target embedding vector; A material corresponding to the fourth target embedding vector is determined from the at least one material to be recommended, and a target material recommended to the target object is obtained.
6. A model training method, characterized in that: The method comprises: Obtaining a first embedding vector, a first noise, and a first model to be trained, where the first embedding vector includes feature information of a first material; Based on the first noise, using the first to-be-trained model to add noise to the first embedding vector to obtain a second embedding vector; Denoising the second embedding vector using the first to-be-trained model to obtain a third embedding vector; determining a target loss based on a first difference between the third embedding vector and the first embedding vector, wherein the target loss is positively correlated with the first difference; Based on the target loss, parameters in the first to-be-trained model are updated to obtain a first target model.
7. The method according to claim 6, characterized in that The first embedding vector includes feature information of a first material, where the first material is a material of interest to the training subject; The denoising the second embedding vector by using the first to-be-trained model to obtain a third embedding vector includes: Acquiring training object information of the training object; Based on the training object information, the second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector, where a similarity between the third embedding vector and the training object information is greater than a fifth threshold.
8. The method according to claim 7, characterized in that The step of denoising the second embedding vector using the first to-be-trained model based on the training object information to obtain the third embedding vector includes: Obtain the second model to be trained; Extracting feature information of the training object information using the second to-be-trained model to obtain a fifth embedding vector; generating a training denoising condition based on the fifth embedding vector, the training denoising condition including a similarity with the fifth embedding vector being greater than a fifth threshold; The second embedding vector is denoised using the first to-be-trained model to obtain the third embedding vector that satisfies the training denoising condition, and the similarity between the third embedding vector and the fifth embedding vector is greater than the fifth threshold.
9. The method according to claim 8, characterized in that The first material is a material that the training subject has interacted with, and the first material is a material whose similarity with the recommended material is greater than a sixth threshold among the materials that the training subject has interacted with. The recommended material is a material that the training subject is interested in, determined based on the materials that the training subject has interacted with, and the training subject has not interacted with the recommended material. Determining a target loss according to a first difference between the third embedding vector and the first embedding vector includes: Obtaining the recommended material; Extracting feature information of the recommended material using the second to-be-trained model to obtain a training recommendation vector; determining a first loss based on the first difference between the third embedding vector and the first embedding vector, wherein the first loss is positively correlated with the first difference; determining a second loss based on a second difference between the fifth embedding vector and the training recommendation vector, wherein the second loss is positively correlated with the second difference; determining the target loss according to the first loss and the second loss, wherein the target loss is positively correlated with the first loss and the target loss is positively correlated with the second loss; The method further comprises: The parameters of the second model to be trained are updated based on the target loss to obtain a second target model.
10. The method according to claim 9, characterized in that The determining the target loss according to the first loss and the second loss includes: determining a third loss based on a third difference between the third embedding vector and the training recommendation vector, wherein the third loss is positively correlated with the third difference; The target loss is determined according to the first loss, the second loss, and the third loss, and the target loss is positively correlated with the third loss.
11. A recommendation device, characterized in that: The recommended device includes: an acquisition unit, configured to acquire a first target embedding vector and target noise, wherein the first target embedding vector includes feature information of a material of interest to the target object; a noise adding unit, configured to add noise to the first target embedding vector based on the target noise to obtain a second target embedding vector; A denoising unit is configured to perform denoising on the second target embedding vector to obtain a third target embedding vector, where a similarity between the third target embedding vector and the first target embedding vector is greater than a first threshold.
12. A model training device, characterized in that: The model training device comprises: an acquisition unit, configured to acquire a first embedding vector, a first noise, and a first model to be trained, wherein the first embedding vector includes feature information of the first material; a noise adding unit, configured to add noise to the first embedding vector using the first to-be-trained model based on the first noise to obtain a second embedding vector; a denoising unit, configured to perform denoising on the second embedding vector using the first to-be-trained model to obtain a third embedding vector; a loss calculation unit, configured to determine a target loss based on a first difference between the third embedding vector and the first embedding vector, wherein the target loss is positively correlated with the first difference; An updating unit is used to update the parameters of the first to-be-trained model based on the target loss to obtain a first target model.
13. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 5, or executes the method according to any one of claims 6 to 10.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 10.
15. A computer program product, characterized in that The computer program product includes a computer program or instructions; when the computer program or instructions are run on a computer, the computer is caused to execute the method according to any one of claims 1 to 5, or execute the method according to any one of claims 6 to 10.