A method for training a target recommendation model, a recommendation method, an apparatus, and an electronic device

By obtaining the first positive and first negative samples of the user, calculating the similarity, and training the machine learning model based on the preset threshold and the loss function of multi-center sorting, the problem of ignoring the user's interest in the prior art is solved, and the accuracy of the recommended model is improved.

CN113901327BActive Publication Date: 2025-08-05BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111265649.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2025-08-05
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

Existing target recommendation model training techniques are often user-centered and ignore the objects that users are actually interested in, resulting in low recommendation accuracy.

Method used

By obtaining the first positive and first negative samples of the user, compute the similarity, and train the machine learning model based on the preset threshold and the loss function of multi-center sorting, the target recommended model is obtained.

Benefits of technology

Improve the accuracy of object recommendations, avoid ignoring objects that users are actually interested in, and improve the recommendation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901327B_ABST
    Figure CN113901327B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and storage medium for training a target recommendation model. The method includes: obtaining a first sample set, the first sample set including a plurality of users, a first positive sample and a first negative sample corresponding to each user among the plurality of users, inputting the first sample set into a neural network model to obtain a first similarity between the first positive sample and the first negative sample corresponding to each user, determining a preset loss function based on the first similarity and a preset threshold, the preset loss function including a first preset loss function sorted by user as the center, or a second preset loss function sorted by multiple centers, and training a preset machine learning model based on the preset loss function to obtain a target recommendation model. In this way, the target recommendation model obtained through the preset loss function sorted by user as the center or sorted by multiple centers can avoid the situation in the prior art of ignoring some objects that users are actually interested in, thereby improving the accuracy of object recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technologies, and in particular, to a method for training a target recommendation model, a recommendation method, an apparatus, and an electronic device. Background Art

[0002] With the development of random computer network technologies, the work of training target recommendation models has received increasing attention and has also been vigorously developed.

[0003] In related technologies, most of the existing target recommendation model training technologies only construct models centered around users, and on this basis, infer the objects that users are interested in. However, the results of this target recommendation model training are not satisfactory, and there is a situation where some objects that users are actually interested in are ignored. Furthermore, when recommending objects to users subsequently, the accuracy of the recommendation needs to be improved. Summary of the Invention

[0004] The present disclosure provides a method for training a target recommendation model, a recommendation method, an apparatus, and an electronic device. The technical solution of the present disclosure is as follows:

[0005] According to the first aspect of the embodiments of the present disclosure, a method for training a target recommendation model is provided, including:

[0006] Obtain a first sample set; the first sample set includes multiple users, and for each user in the multiple users, a first positive sample and a first negative sample; the first positive sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user satisfies a feedback condition; the first negative sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user does not satisfy the feedback condition, or the first negative sample represents a sample that was not recommended to the user during a historical period;

[0007] Input the first sample set into a neural network model to obtain a first similarity between the first positive sample and the first negative sample corresponding to each user;

[0008] Determine a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function sorted centered around users, or a second preset loss function sorted with multiple centers;

[0009] Train a preset machine learning model based on the preset loss function to obtain a target recommendation model.

[0010] In some possible embodiments, training a preset machine learning model based on the preset loss function to obtain a target recommendation model includes:

[0011] Calculate a second similarity between each user and the corresponding first negative sample;

[0012] Calculate the third similarity between each user and the corresponding first positive sample;

[0013] Determine the loss value corresponding to each user based on a preset loss function, the first similarity, the second similarity, and the third similarity;

[0014] Train a preset machine learning model based on the loss value corresponding to each user to obtain a target recommendation model.

[0015] In some possible embodiments,

[0016] The expression of the preset loss function is:

[0017]

[0018] where L′ is the loss value, x ui is the third similarity, x uj is the second similarity, x ij is the first similarity, γ is a preset threshold, λ is the weight of multi-center ranking, B includes users, positive samples and negative samples, where there is interaction information between users and positive samples, and there is no interaction information between users and negative samples.

[0019] In some possible embodiments, when the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity and a preset value, the expression of the preset loss function is:

[0020]

[0021] where L″ is the comprehensive loss value, and the comprehensive loss value represents the sum of the loss values corresponding to each threshold among the multiple thresholds when the preset threshold includes multiple thresholds; θ is the model parameter, and η is the weight of the L2 loss model.

[0022] In some possible embodiments, when the preset threshold is the second similarity, determining the preset loss function based on the first similarity and the preset threshold includes:

[0023] Determine the preset loss function based on the first similarity and the second similarity.

[0024] In some possible embodiments, determining the preset loss function based on the first similarity and the second similarity includes:

[0025] When the first similarity is greater than the second similarity, determine the second preset loss function of multi-center ranking.

[0026] In some possible embodiments, determining the preset loss function based on the first similarity and the second similarity includes:

[0027] When the first similarity is less than or equal to the second similarity, determine a first preset loss function sorted centered on the user.

[0028] In some possible embodiments, the method further includes:

[0029] Calculate a second similarity between each user and the corresponding first negative sample;

[0030] When setting the threshold to the second similarity, determining the preset loss function based on the first similarity and the preset threshold includes:

[0031] When the first similarity is greater than the second similarity, determine a third preset loss function sorted centered on the positive sample.

[0032] In some possible embodiments, obtaining the first sample set includes:

[0033] Determine multiple users;

[0034] Based on the interaction data of the users, determine the first positive sample corresponding to each user among the multiple users;

[0035] Determine the first negative sample corresponding to each user according to the random sampling rule;

[0036] Wherein, the first positive sample and the first negative sample are different samples.

[0037] In some possible embodiments, the feedback condition indicates that the user is satisfied with the samples recommended in the historical period.

[0038] According to the second aspect of the embodiments of the present disclosure, there is provided a recommendation method, including:

[0039] Obtain the identification information of the target user;

[0040] Input the identification information of the target user into the target recommendation model trained by the target recommendation model training method to obtain the identification information of the recommended object corresponding to the identification information of the target object.

[0041] According to the third aspect of the embodiments of the present disclosure, there is provided a target recommendation model training device, including:

[0042] A sample set acquisition module, configured to execute obtaining the first sample set; the first sample set includes multiple users, the first positive sample and the first negative sample corresponding to each user among the multiple users; the first positive sample represents the sample that was recommended to the user in the historical period and the feedback information corresponding to the user satisfies the feedback condition; the first negative sample represents the sample that was recommended to the user in the historical period and the feedback information corresponding to the user does not satisfy the feedback condition, or, the first negative sample represents the sample that was not recommended to the user in the historical period;

[0043] A similarity determination module, configured to execute inputting a first sample set into a neural network model to obtain a first similarity between a first positive sample and a first negative sample corresponding to each user;

[0044] A loss function determination module, configured to execute determining a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function sorted by user, or a second preset loss function sorted by multiple centers;

[0045] A model training module, configured to execute training a preset machine learning model based on the preset loss function to obtain a target recommendation model.

[0046] In some possible embodiments, the model training module is configured to execute:

[0047] Calculating a second similarity between each user and the corresponding first negative sample;

[0048] Calculating a third similarity between each user and the corresponding first positive sample;

[0049] Determining a loss value corresponding to each user based on the preset loss function, the first similarity, the second similarity, and the third similarity;

[0050] Training the preset machine learning model based on the loss value corresponding to each user to obtain a target recommendation model.

[0051] In some possible embodiments, the expression of the preset loss function is:

[0052]

[0053] where L′ is the loss value, x ui is the third similarity, x uj is the second similarity, x ij is the first similarity, γ is the preset threshold, λ is the weight for multi-center sorting, B includes users, positive samples, and negative samples, where there is interaction information between users and positive samples, and there is no interaction information between users and negative samples.

[0054] In some possible embodiments, when the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity, and a preset value, the expression of the preset loss function is:

[0055]

[0056] where L″ is the comprehensive loss value, the comprehensive loss value represents the sum of the loss values corresponding to each threshold among the multiple thresholds when the preset threshold includes multiple thresholds; θ is the model parameter, and η is the weight of the L2 loss model.

[0057] In some possible embodiments, when the preset threshold is the second similarity, the loss function determination module is configured to perform:

[0058] Determine a preset loss function based on the first similarity and the second similarity.

[0059] In some possible embodiments, the loss function determination module is configured to perform:

[0060] When the first similarity is greater than the second similarity, determine a second preset loss function for multi-center sorting.

[0061] In some possible embodiments, the base loss function determination module is configured to perform:

[0062] When the first similarity is less than or equal to the second similarity, determine a first preset loss function for user-centered sorting.

[0063] In some possible embodiments, the similarity determination module is configured to perform:

[0064] Calculate the second similarity between each user and the corresponding first negative sample;

[0065] When the set threshold is the second similarity, the loss function determination module is configured to perform:

[0066] When the first similarity is greater than the second similarity, determine a third preset loss function for positive sample-centered sorting.

[0067] In some possible embodiments, the sample set acquisition module is configured to perform:

[0068] Determine multiple users;

[0069] Based on the interaction data of the users, determine the first positive sample corresponding to each user among the multiple users;

[0070] Determine the first negative sample corresponding to each user according to the random sampling rule;

[0071] Wherein, the first positive sample and the first negative sample are different samples.

[0072] In some possible embodiments, the feedback condition indicates that the user is satisfied with the samples recommended during the historical period.

[0073] According to the fourth aspect of the embodiments of the present disclosure, a recommendation device is provided, including:

[0074] A target user acquisition module configured to perform acquiring identification information of a target user;

[0075] A recommended object determination module is configured to input the identification information of a target user into a target recommendation model trained by a target recommendation model training method to obtain the identification information of a recommended object corresponding to the identification information of the target object.

[0076] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the instructions to implement the above image recognition model training method or recommendation method.

[0077] According to a sixth aspect of the embodiments of the present disclosure, a storage medium is provided. When the instructions in the storage medium are executed by a processor of a server, the server can execute the above image recognition model training method or recommendation method.

[0078] According to a seventh aspect of the embodiments of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is stored in a readable storage medium. At least one processor of the computer device reads and executes the computer program, so that the device executes the above image recognition model training method or recommendation method.

[0079] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0080] Obtain a first sample set. The first sample set includes multiple users, a first positive sample and a first negative sample corresponding to each user among the multiple users. The first positive sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user meets the feedback condition. The first negative sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user does not meet the feedback condition, or the first negative sample represents a sample that was not recommended to the user during a historical period. Input the first sample set into a neural network model to obtain a first similarity between the first positive sample and the first negative sample corresponding to each user. Determine a preset loss function based on the first similarity and a preset threshold. The preset loss function includes a first preset loss function sorted by user-centered, or a second preset loss function sorted by multi-centered. Train a preset machine learning model based on the preset loss function to obtain a target recommendation model. In this way, the target recommendation model obtained through the preset loss function sorted by user-centered or multi-centered can avoid the situation in the prior art of ignoring some objects that the user is actually interested in, and thus improve the accuracy of object recommendation.

[0081] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments in line with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an undue limitation on the present disclosure.

[0083] Figure 1 is a schematic diagram of an application environment shown according to an exemplary embodiment;

[0084] Figure 2 is a flowchart of a method for training a target recommendation model shown according to an exemplary embodiment;

[0085] Figure 3 is a flowchart of a method for obtaining a first sample set shown according to an exemplary embodiment;

[0086] Figure 4 is a flowchart of a method for training a target recommendation model shown according to an exemplary embodiment;

[0087] Figure 5 is a flowchart of a method for tuning parameters of a target recommendation model shown according to an exemplary embodiment;

[0088] Figure 6 is a flowchart of a method for obtaining a second sample set shown according to an exemplary embodiment;

[0089] Figure 7 is a flowchart of a recommendation method shown according to an exemplary embodiment;

[0090] Figure 8 is a block diagram of a device for training a target recommendation model shown according to an exemplary embodiment;

[0091] Figure 9 is a block diagram of a recommendation device shown according to an exemplary embodiment;

[0092] Figure 10 is a block diagram of an electronic device for training a target recommendation model or for recommendation shown according to an exemplary embodiment. Detailed implementation manners

[0093] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0094] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present disclosure are used to distinguish similar first objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0095] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an application environment shown according to an exemplary embodiment. As Figure 1 shown, the application environment may include a server 01 and a terminal 02.

[0096] In an optional embodiment, the server 01 can be used to train a target recommendation model that can perform object recommendation. It includes: obtaining a first sample set, the first sample set including multiple users, the first positive sample and the first negative sample corresponding to each user among the multiple users, the first positive sample representing a sample that was recommended to the user during the historical period and the feedback information corresponding to the user meets the feedback condition, the first negative sample representing a sample that was recommended to the user during the historical period and the feedback information corresponding to the user does not meet the feedback condition, or the first negative sample representing a sample that was not recommended to the user during the historical period. Inputting the first sample set into a neural network model to obtain the first similarity between the first positive sample and the first negative sample corresponding to each user, determining a preset loss function based on the first similarity and a preset threshold, the preset loss function including a first preset loss function sorted by user as the center, or a second preset loss function sorted by multiple centers, and training a preset machine learning model based on the preset loss function to obtain the target recommendation model.

[0097] Specifically, the server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0098] In an optional embodiment, the terminal 02 can perform object recommendation processing in combination with the target recommendation model trained by the server 01. Specifically, the terminal 02 can include, but is not limited to, electronic devices such as smartphones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. Optionally, the operating systems running on the electronic devices can include, but are not limited to, Android, IOS, Linux, Windows, Unix, etc.

[0099] In the embodiments of this specification, the above-mentioned server 01 and terminal 02 can be directly or indirectly connected through wired or wireless communication methods, and the present disclosure does not limit this.

[0100] In addition, it should be noted that Figure 1 The shown is only an application environment of the target recommendation model training method provided by the present disclosure. In actual applications, there can also be other application environments. For example, in actual applications, there can only be a server carrying the target recommendation model training system, because this embodiment can be implemented by an application program on the server.

[0101] Figure 2 is a flowchart of a target recommendation model training method shown according to an exemplary embodiment. As Figure 2 shown, the target recommendation model training method can be applied to a server or a client, and includes the following steps:

[0102] In step S201, obtain a first sample set; the first sample set includes multiple users, and for each user in the multiple users, there is a corresponding first positive sample and first negative sample; the first positive sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user meets the feedback condition; the first negative sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user does not meet the feedback condition, or the first negative sample represents a sample that was not recommended to the user during a historical period.

[0103] In the embodiments of this application, there can be multiple first positive samples corresponding to each user, and there can also be multiple first negative samples corresponding to each user. Here, the model training will be described by taking one first positive sample and one first negative sample corresponding to each user as an example. The training of the model with other first positive samples and first negative samples will not be elaborated.

[0104] In the embodiments of the present application, the feedback condition may indicate that the user is satisfied with the samples recommended in the historical period. Therefore, the first positive sample may be a sample that has been recommended to the user in the historical period and the user is satisfied with the samples recommended in the historical period. The first negative sample may indicate a sample that has been recommended to the user in the historical period and the user is not satisfied with the samples recommended in the historical period, or the first negative sample indicates a sample that has not been recommended to the user in the historical period.

[0105] Figure 3 is a flowchart of a method for obtaining a first sample set shown according to an exemplary embodiment, as Figure 3 shown, and includes the following steps:

[0106] In step S2011, multiple users are determined.

[0107] Optionally, the server may obtain multiple users from any recommendation system, and the users may be represented by user accounts, user mobile phone numbers, and user email addresses.

[0108] In step S2013, a first positive sample corresponding to each user among the multiple users is determined based on the interaction data of the users.

[0109] Optionally, when the recommendation system is a recommendation system that provides recommendations for a music application on a terminal device, the object may be any one song in the recommendation system. Among them, the first positive sample may be a positive sample determined based on the user interaction data of the user. The positive sample can be understood as: a sample that has been recommended to the user and is determined to be of interest to the user. When the recommendation system is a music recommendation system, the positive sample can be understood as: a music that has been recommended to the user and is determined to be of interest to the user (played by the user on the terminal).

[0110] The server may determine one first positive sample or multiple first positive samples from the positive samples corresponding to the users.

[0111] In step S2015, a first negative sample corresponding to each user is determined according to the random sampling rule; wherein, the first positive sample and the first negative sample are different samples.

[0112] Optionally, the server may determine a first negative sample corresponding to each user according to the random sampling rule.

[0113] Optionally, the negative samples include the following two situations: First, a sample that has been recommended to the user and is determined not to be of interest to the user. When the recommendation system is a music recommendation system, the first situation can be understood as: a music that has been recommended to the user and is determined not to be of interest to the user (appearing on the user's terminal interface but not played by the user). Second, a sample that has not been recommended to the user, and in this case, it may include samples that the user is not interested in, or it may also include samples that the user is interested in.

[0114] The server can determine one or more first negative samples from the negative samples corresponding to the user.

[0115] In step S203, the first sample set is input into the neural network model to obtain the first similarity between the first positive sample and the first negative sample corresponding to each user.

[0116] In the embodiments of the present application, one first positive sample and one first negative sample corresponding to one user are taken as an example for illustration. In an optional embodiment, when the server inputs the first sample set into the neural network model, it can obtain the first vector space representation data (user ID embedding) of the user, the second vector space representation data (positive item embedding) of the first positive sample, and the third vector space representation data (negative item embedding) of the first negative sample. Subsequently, based on the second vector space representation data and the third vector space representation data, the first similarity between the first positive sample and the first negative sample is determined. Based on the first vector space representation data and the second vector space representation data, the third similarity between the user and the first positive sample is determined. Based on the first vector space representation data and the third vector space representation data, the second similarity between the user and the first negative sample is determined.

[0117] In an optional embodiment, the similarity can be calculated based on the Euclidean distance formula. Specifically, the server can determine the third similarity according to the first vector space representation data and the second vector space representation data based on the Euclidean distance formula, determine the second similarity according to the first vector space representation data and the third vector space representation data, and determine the first similarity according to the second vector space representation data and the third vector space representation data.

[0118] In another optional embodiment, when calculating the similarity using the above Euclidean distance formula, there are limitations. To overcome the limitations brought by the Euclidean distance formula, the server can determine the third similarity according to the first vector space representation data and the second vector space representation data based on the inner product formula, determine the second similarity according to the first vector space representation data and the third vector space representation data, and determine the first similarity according to the second vector space representation data and the third vector space representation data.

[0119] In the embodiments of the present disclosure, the aforementioned neural network model may be constructed based on machine learning or deep learning. Machine learning and deep learning generally include technologies such as artificial neural networks, transfer learning, and inductive learning. Machine learning may include supervised machine learning, unsupervised machine learning, and semi-supervised machine learning. The aforementioned preset machine learning model may include, but is not limited to, machine learning models such as convolutional neural networks, residual neural networks, recurrent neural networks, recursive neural networks, and graph convolutional neural networks.

[0120] This is because real life actually contains many irregular data structures, typically topological ones, such as social networks, chemical molecular structures, and knowledge graphs. Even language is internally a complex tree structure, also a topological structure. When recommending objects, we focus on only a few key points of the object, which form a graph structure. Graph structures are generally very irregular and can be considered infinite-dimensional data, so they lack translation invariance. The surrounding structure of each node may be unique, making traditional convolutional neural networks ineffective for this type of data. However, graph convolutional neural networks (GCNNs) have ingeniously designed a method for extracting features from object data. These features can be used for node classification, item classification, link prediction, and even object embedding, making them widely applicable and suitable.

[0121] In embodiments of the present application, a server can construct a graph convolutional neural network and determine its learning rate, optimizer type, and number of layers. The learning rate, as mentioned above, is an important hyperparameter in supervised learning and deep learning. It determines whether and when the objective function converges to a local minimum. An appropriate learning rate enables the objective function to converge to the local minimum within an appropriate timeframe. If the learning rate is set too low, convergence will be very slow. If the learning rate is set too high, the gradient may oscillate around the minimum or even fail to converge. With a fixed learning rate, upon reaching convergence, the gradient will fluctuate within a larger region around the optimal value. However, decreasing the learning rate with increasing iterations will cause the gradient to fluctuate within a smaller region around the optimal value upon convergence. Therefore, selecting an appropriate learning rate is crucial for model training. In embodiments of the present disclosure, the learning rate of a graph convolutional neural network can be a fixed value or a value that varies with increasing iterations. Optionally, the learning rate can be a fixed value of 0.001, which can be an experimental value.

[0122] The optimizer in the above text is used to update and calculate the network parameters that affect model training and model output, making them approach or reach the optimal value, so as to minimize (or maximize) the loss function. The type of optimizer can be the Radam optimizer, the adam optimizer, or other suitable optimizers.

[0123] In step S205, a preset loss function is determined based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function sorted by user-centered, or a second preset loss function sorted by multi-centered.

[0124] As described above, the first negative sample includes the following two cases: First, a sample that has been recommended to the user and is determined not to be of interest to the user. Second, a sample that has not been recommended to the user, and in this case, it may include samples that the user is not interested in, or it may also include samples that the user is interested in.

[0125] Especially in the second case, the following situation may exist: The first negative sample that has not been recommended to the user is actually an object of interest to the user, and the similarity between the first negative sample and the first positive sample (the first similarity determined based on the second vector space representation data and the third vector space representation data) is even greater than the similarity between the user and the first positive sample (the third similarity determined based on the first vector space representation data and the second vector space representation data). In this case, if the first negative sample is still regarded as a truly user-uninterested sample, there will inevitably be a recommendation error, reducing the performance of the model. Based on this, the preset loss function can include the multi-centered sorting idea, and the multi-centered includes sorting centered on the user and sorting centered on the positive sample.

[0126] The multi-centered sorting idea will be described in detail below. For three parameters centered on the user (user u, first positive sample i, first negative sample j), this application hopes that the similarity between the user and the first positive sample (the third similarity x ui ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ). In this way, the expected expression (1) centered on the user can be obtained:

[0127] x ut >x uj

[0128] …… Expression (1)

[0129] For three parameters centered on the positive sample (first positive sample i, user u, first negative sample j), this application hopes that the similarity between the first positive sample and the user (the fourth similarity x iu ) is greater than the similarity between the first positive sample and the first negative sample (the first similarity xij ) Thus, the expected expression (2) centered on the positive sample can be obtained:

[0130] x iu > x ij

[0131] …… Expression (2)

[0132] Since the third similarity, the second similarity, the first similarity, and the fourth similarity are all calculated based on the inner product formula, and the inner product formula satisfies the commutative principle, therefore, the third similarity x ui is equal to the fourth similarity x iu .

[0133] Based on the above two expressions, this application hopes that the similarity between the user and the first positive sample (the third similarity x ui ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ), and at the same time, the similarity between the user and the first positive sample (the third similarity x ui ) is greater than the similarity between the first positive sample and the first negative sample (the first similarity x ij ). Thus, the expression (3) can be obtained:

[0134] x ui > max(x uj , x ij )

[0135] …… Expression (3)

[0136] By transforming the expression (3), the embodiment of this application can obtain the expression (4):

[0137] x ut - x uf > max(0, x tf - x uf )

[0138] …… Expression (4)

[0139] Thus, this application can obtain the comprehensive metric under multiple centers centered on the user and the positive sample, such as the expression (5):

[0140] x = x ui - x uj - max(0, x ij - x uj )

[0141] …… Expression (5)

[0142] Based on expression (5), if the similarity between the first positive sample and the first negative sample (the first similarity x ij ) and the similarity between the user and the first negative sample (the second similarity x uj ) are compared, the above comprehensive similarity can be changed to obtain expression (6):

[0143]

[0144] Among them, the first sub-expression of expression (6) indicates that when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ), the comprehensive measure is the difference between the similarity between the user and the first positive sample (the third similarity x uj ) and the similarity between the first positive sample and the first negative sample (the first similarity x ij ). The second sub-expression of expression (6) indicates that when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is less than or equal to the similarity between the user and the first negative sample (the second similarity x uj ), the comprehensive measure is the difference between the similarity between the user and the first positive sample (the third similarity x ui ) and the similarity between the user and the first negative sample (the second similarity x uj ).

[0145] In the embodiments of this application, if the second similarity x uj is used as a preset threshold, when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ), as shown in expression (6), the target recommendation model will be centered on the positive sample. However, sorting centered on the user is a very important part. At the same time, when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ), it cannot be guaranteed that the first negative sample is really a sample that has been recommended and determined not to be of interest to the user, or a sample that has not been recommended. Therefore, this application can add a proportional value, or the weight λ∈[0, 1] of multi-center sorting to determine the proportion of user-centered and positive-sample-centered, so as to obtain expression (7):

[0146] x = x ui - x uj - λ max(0, xij -x uj )

[0147] ……Expression (7)

[0148] Based on Expression (7), if the similarity between the first positive sample and the first negative sample (the first similarity x ij ) and the similarity between the user and the first negative sample (the second similarity x uj ) are compared, the above comprehensive metric can be varied to obtain Expression (8):

[0149]

[0150] It can be obtained from the above Expression (8) that when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than the similarity between the user and the first negative sample (the second similarity x uj ), multi-center sorting (user-centered and positive-sample-centered) needs to be considered. When the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is less than or equal to the similarity between the user and the first negative sample (the second similarity x uj ), user-centered sorting can be considered for model construction.

[0151] In the embodiments of the present application, the above second similarity x uj is an optional preset threshold. Optionally, different preset thresholds can also be set. Thus, the above Expression (7) can be replaced with Expression (9):

[0152] x = x ui -x uj -λmax(0, x ij -γ)

[0153] ……Expression (9)

[0154] Among them, the above γ is a preset threshold. In the embodiments of the present application, there can be many choices for the preset threshold. The following introduces two preset thresholds other than the second similarity x uj .

[0155] In an optional embodiment, when r = x ui , Expression (10) can be obtained:

[0156] x = x ut -x uf -λmax(0, x if -x ui )

[0157] ……Expression (10)

[0158] In this embodiment, when the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than the similarity between the user and the first positive sample (the third similarity x ui ), multi-center construction of the model can be considered.

[0159] In another alternative embodiment, when γ = 0, the expression (11) can be obtained:

[0160] x = x ui - x uj - λmax(0, x ij )

[0161] ……Expression (11)

[0162] In this embodiment, as long as the similarity between the first positive sample and the first negative sample (the first similarity x ij ) is greater than 0, multi-center construction of the model can be considered.

[0163] Thus, the present application can construct an expression of the preset loss function for multi-center pairwise ranking, such as expression (12):

[0164]

[0165] where L′ is the loss value, x ui is the third similarity, x uj is the second similarity, x ij is the first similarity, γ is the preset threshold, λ is the weight of multi-center ranking, B includes the user, positive samples and negative samples, where there is interaction information between the user and positive samples, and there is no interaction information between the user and negative samples.

[0166] In step S207, the preset machine learning model is trained based on the preset loss function to obtain the target recommendation model.

[0167] It can be seen from expression (12) that when the preset threshold is the second similarity x uj , the server can determine the preset loss function based on the first similarity and the second similarity.

[0168] Optionally, on the premise that the preset threshold is the second similarity x uj , that is, substituting the second similarity x uj into the preset threshold, when the first similarity is greater than the second similarity, the second preset loss function for multi-center ranking is determined as:

[0169]

[0170] Optionally, when the preset threshold is the second similarity x uj that is, substituting the second similarity x uj into the preset threshold, when the first similarity is less than or equal to the second similarity, determine the first preset loss function sorted by the user as:

[0171]

[0172] Optionally, if it is not necessary to consider sorting by the user, when the preset threshold is the second similarity x uj that is, substituting the second similarity x uj into the preset threshold, when the first similarity is greater than the second similarity, determine the third preset loss function sorted by the positive sample as:

[0173]

[0174] Figure 4 is a flowchart of a method for training a target recommendation model shown according to an exemplary embodiment. As Figure 4 shown, it includes the following steps:

[0175] In step S2071, determine the loss value corresponding to each user based on the preset loss function, the first similarity, the second similarity, and the third similarity.

[0176] Since the server has determined the first preset loss function sorted by the user, or the second preset loss function sorted by multiple centers, or the third preset loss function sorted by the positive sample according to the first similarity and the second similarity. Then, the server can determine the loss value according to the first preset loss function sorted by the user, or the second preset loss function sorted by multiple centers, or the third preset loss function sorted by the positive sample and the required first similarity, second similarity, and third similarity.

[0177] In step S2073, train the preset machine learning model based on the loss value corresponding to each user to obtain the target recommendation model.

[0178] In the embodiment of the present application, when the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity, and the preset value, the expression of the preset loss function is:

[0179]

[0180] Among them, L″ is the comprehensive loss value, which represents the sum of the loss values corresponding to each threshold among multiple thresholds when the preset threshold includes multiple thresholds; θ is the model parameter, and η is the weight of the L2 loss model, which is used to control the regularization weight of the L2 loss function to prevent overfitting.

[0181] The above first sample set can be used to train the target recommendation model. However, during the training process, if the first sample set is always used, the model may over-learn. Therefore, in order to prevent model generalization, a second sample set can be obtained, and the second sample set can be used to adjust the parameters of the model to obtain an updated target recommendation model. Among them, the users in the first sample set can be the first users.

[0182] Figure 5 It is a flowchart of a method for adjusting parameters of a target recommendation model shown according to an exemplary embodiment. As Figure 5 shown, it includes the following steps:

[0183] In step S501, obtain a second sample set; the second sample set includes multiple second users, and for each second user among the multiple second users, the sum of the second positive samples and the second negative samples, where the second positive sample represents a sample that was recommended to the second user during the historical period and the feedback information corresponding to the second user meets the feedback condition; the second negative sample represents a sample that was recommended to the second user during the historical period and the feedback information corresponding to the second user does not meet the feedback condition, or the second negative sample represents a sample that was not recommended to the second user during the historical period.

[0184] Figure 6 It is a flowchart of a method for obtaining a second sample set shown according to an exemplary embodiment. As Figure 6 shown, it includes the following steps:

[0185] In step S5011, determine multiple second users.

[0186] In step S5013, based on the interaction data of the second users, determine the second positive samples corresponding to each second user among the multiple second users.

[0187] In step S5015, determine the second negative samples corresponding to each second user according to the random sampling rule; among them, the second positive samples and the second negative samples are different samples.

[0188] For the specific embodiments of obtaining the second sample set in this application, reference can be made to the specific embodiments of obtaining the first sample set in this application, which will not be elaborated here.

[0189] In the embodiments of this application, there can be multiple second positive samples corresponding to each second user, and there can also be multiple second negative samples corresponding to each second user.

[0190] In step S503, input the second sample set into the target recommendation model to obtain the first similarity between the second positive samples and the second negative samples corresponding to each second user.

[0191] In step S505, determine a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function sorted by user-centered ranking or a second preset loss function sorted by multi-centered ranking.

[0192] In step S507, train the target recommendation model based on the preset loss function to obtain an updated target recommendation model.

[0193] In the embodiments of this application, determining the updated target recommendation model according to the second sample set can refer to determining the target recommendation model according to the first sample set, which will not be elaborated here.

[0194] After obtaining the updated target recommendation model, a third sample set can also be obtained. Among them, the third sample set can include multiple third users, and for each third user in the multiple third users, the corresponding third positive samples and third negative samples. Or, the third sample set can include multiple third users, and for each third user in the multiple third users, the corresponding third positive samples.

[0195] Subsequently, input the multiple third users into the updated target recommendation model to obtain the recommended objects, and compare the recommended objects with the third positive samples to test the recommendation accuracy of the updated target recommendation model.

[0196] In this way, the embodiments of the application are based on constructing a multi-centered loss function, and through the training of the first sample set, the parameter tuning of the second sample set, and the testing of the third sample set, a target recommendation model with relatively high recommendation accuracy can be finally determined.

[0197] Based on the embodiments of the above target recommendation model training method, the following introduces an embodiment of a recommendation method in the present disclosure. Figure 7 It is a flowchart of a recommendation method shown according to an exemplary embodiment. Referring to Figure 7 , this method can be applied to electronic devices such as servers, terminals, edge computing nodes, etc., and includes the following steps.

[0198] In step S701, obtain the identification information of the target user;

[0199] In step S703, input the identification information of the target user into the target recommendation model trained by the target recommendation model training method to obtain the identification information of the recommended object corresponding to the identification information of the target object.

[0200] Figure 8It is a block diagram of a target recommendation model training device shown according to an exemplary embodiment. Referring to Figure 8 the device includes a sample set acquisition module 801, a similarity determination module 802, a loss function determination module 803, and a model training module 804.

[0201] The sample set acquisition module 801 is configured to acquire a first sample set; the first sample set includes multiple users, and for each user in the multiple users, there is a corresponding first positive sample and first negative sample; the first positive sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user meets the feedback condition; the first negative sample represents a sample that was recommended to the user during a historical period and the feedback information corresponding to the user does not meet the feedback condition, or the first negative sample represents a sample that was not recommended to the user during a historical period;

[0202] The similarity determination module 802 is configured to input the first sample set into a neural network model to obtain a first similarity between the first positive sample and the first negative sample corresponding to each user;

[0203] The loss function determination module 803 is configured to determine a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function sorted by user-centered, or a second preset loss function sorted by multi-center;

[0204] The model training module 804 is configured to train a preset machine learning model based on the preset loss function to obtain a target recommendation model.

[0205] In some possible embodiments, the model training module is configured to perform:

[0206] Calculate a second similarity between each user and the corresponding first negative sample;

[0207] Calculate a third similarity between each user and the corresponding first positive sample;

[0208] Determine a loss value corresponding to each user based on the preset loss function, the first similarity, the second similarity, and the third similarity;

[0209] Train a preset machine learning model based on the loss value corresponding to each user to obtain a target recommendation model.

[0210] In some possible embodiments, the expression of the preset loss function is:

[0211]

[0212] where L′ is the loss value, x ui is the third similarity, x uj is the second similarity, xij is the first similarity, γ is a preset threshold, λ is the weight of multi-center sorting, and B includes users, positive samples and negative samples. Among them, there is interaction information between users and positive samples, and there is no interaction information between users and negative samples.

[0213] In some possible embodiments, when the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity and a preset value, the expression of the preset loss function is:

[0214]

[0215] where L″ is the comprehensive loss value, and the comprehensive loss value represents the sum of the loss values corresponding to each threshold among the multiple thresholds when the preset threshold includes multiple thresholds; θ is the model parameter, and η is the weight of the L2 loss model.

[0216] In some possible embodiments, when the preset threshold is the second similarity, the loss function determination module is configured to execute:

[0217] Determine the preset loss function based on the first similarity and the second similarity.

[0218] In some possible embodiments, the loss function determination module is configured to execute:

[0219] When the first similarity is greater than the second similarity, determine the second preset loss function for multi-center sorting.

[0220] In some possible embodiments, the base loss function determination module is configured to execute:

[0221] When the first similarity is less than or equal to the second similarity, determine the first preset loss function for user-centered sorting.

[0222] In some possible embodiments, the similarity determination module is configured to execute:

[0223] Calculate the second similarity between each user and the corresponding first negative sample;

[0224] When the set threshold is the second similarity, the loss function determination module is configured to execute:

[0225] When the first similarity is greater than the second similarity, determine the third preset loss function for positive-sample-centered sorting.

[0226] In some possible embodiments, the sample set acquisition module is configured to execute:

[0227] Determine multiple users;

[0228] Determine a first positive sample corresponding to each user among multiple users based on the interaction data of the users;

[0229] Determine a first negative sample corresponding to each user according to the random sampling rule;

[0230] Wherein, the first positive sample and the first negative sample are different samples.

[0231] In some possible embodiments, the feedback condition characterizes that the user is satisfied with the samples recommended in the historical period.

[0232] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0233] Figure 9 is a block diagram of a recommendation device shown according to an exemplary embodiment. Refer to Figure 9 , the device includes a target user acquisition module 901 and a recommended object recommendation module 902, wherein,

[0234] The target user acquisition module 901 is configured to execute acquiring the identification information of the target user;

[0235] The recommended object determination module 902 is configured to execute inputting the identification information of the target user into the target recommendation model obtained by training with the target recommendation model training method to obtain the identification information of the recommended object corresponding to the identification information of the target object.

[0236] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0237] Figure 10 is a block diagram of an electronic device 1000 for target recommendation model training or for recommendation shown according to an exemplary embodiment. The electronic device may be a server or a terminal device, and its internal structure diagram may be as Figure 10 shown. The electronic device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a target recommendation model training method or a recommendation method.

[0238] Those skilled in the art can understand,Figure 10 The structure shown is only a block diagram of some structures related to the present disclosure, and does not constitute a limitation on the electronic device to which the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0239] In an exemplary embodiment, an electronic device is further provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the target recommendation model training method or the recommendation method in the embodiments of the present disclosure.

[0240] In an exemplary embodiment, a computer-readable storage medium is further provided. When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device can execute the target recommendation model training method or the recommendation method in the embodiments of the present disclosure.

[0241] In an exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program. The computer program is stored in a readable storage medium. At least one processor of the computer device reads and executes the computer program, so that the computer device executes the target recommendation model training method or the recommendation method in the embodiments of the present disclosure.

[0242] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database or other medium used in the embodiments provided in the present application may include non-volatile and / or volatile memories. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0243] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0244] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A training method for a target recommendation model, characterized in that: include: Obtaining a first sample set; The first sample set includes a plurality of users, and a first positive sample and a first negative sample corresponding to each of the plurality of users; The first positive sample represents a sample that was recommended to the user in a historical period and whose corresponding feedback information of the user meets the feedback condition; The first negative sample represents a sample that was recommended to the user in the historical period and whose corresponding feedback information from the user does not meet the feedback condition, or the first negative sample represents a sample that was not recommended to the user in the historical period; Inputting the first sample set into a neural network model to obtain a first similarity between a first positive sample and a first negative sample corresponding to each user; Determine a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function for user-centric sorting, or a second preset loss function for multi-centric sorting; Training a preset machine learning model based on the preset loss function to obtain a target recommendation model; The training of the preset machine learning model based on the preset loss function to obtain the target recommendation model includes: Calculating a second similarity between each user and the corresponding first negative sample; Calculating a third similarity between each user and the corresponding first positive sample; Determining a loss value corresponding to each user based on the preset loss function, the first similarity, the second similarity, and the third similarity; The preset machine learning model is trained based on the loss value corresponding to each user to obtain the target recommendation model.

2. The method for training a target recommendation model according to claim 1, wherein: The expression of the preset loss function is: Among them, L′ is the loss value, x ui is the third similarity, x uj is the second similarity, x ij is the first similarity, γ is the preset threshold, λ is the weight of multi-center sorting, B includes users, positive samples and negative samples, wherein there is interactive information between the user and the positive sample, and there is no interactive information between the user and the negative sample.

3. The training method of the target recommendation model according to claim 2, characterized in that: When the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity, and a preset value, the expression of the preset loss function is: Wherein, L″ is a comprehensive loss value, which represents the sum of the loss values corresponding to each threshold value in the multiple threshold values when the preset threshold value includes multiple threshold values; θ is a model parameter, and η is the weight of the L2 loss model.

4. The method for training a target recommendation model according to claim 2, wherein: When the preset threshold is the second similarity, determining the preset loss function based on the first similarity and the preset threshold includes: The preset loss function is determined based on the first similarity and the second similarity.

5. The method for training a target recommendation model according to claim 4, wherein: The determining the preset loss function based on the first similarity and the second similarity includes: When the first similarity is greater than the second similarity, the second preset loss function for multi-center sorting is determined.

6. The method for training a target recommendation model according to claim 4, wherein: The determining the preset loss function based on the first similarity and the second similarity includes: When the first similarity is less than or equal to the second similarity, the first preset loss function for user-centric sorting is determined.

7. The method for training a target recommendation model according to claim 1, wherein: The method further comprises: Calculating a second similarity between each user and the corresponding first negative sample; When the threshold is set to the second similarity, determining the preset loss function based on the first similarity and the preset threshold includes: When the first similarity is greater than the second similarity, the third preset loss function sorted with the positive samples as the center is determined.

8. The method for training a target recommendation model according to claim 1, wherein: The obtaining of the first sample set includes: determining the plurality of users; Determine a first positive sample corresponding to each user of the plurality of users based on the interaction data of the users; Determine a first negative sample corresponding to each user according to a random sampling rule; The first positive sample and the first negative sample are different samples.

9. The method for training a target recommendation model according to claim 1, wherein: The feedback condition indicates that the user is satisfied with the samples recommended in the historical period.

10. A recommendation method, characterized in that: include: Obtain identification information of the target user; The identification information of the target user is input into a target recommendation model trained according to any target recommendation model training method according to claims 1 to 9 to obtain identification information of a recommended object corresponding to the identification information of the target user.

11. A target recommendation model training device, characterized in that: include: A sample set acquisition module is configured to acquire a first sample set; The first sample set includes a plurality of users, and a first positive sample and a first negative sample corresponding to each of the plurality of users; The first positive sample represents a sample that was recommended to the user in a historical period and whose corresponding feedback information of the user meets the feedback condition; The first negative sample represents a sample that was recommended to the user in the historical period and whose corresponding feedback information from the user does not meet the feedback condition, or the first negative sample represents a sample that was not recommended to the user in the historical period; a similarity determination module configured to input the first sample set into a neural network model to obtain a first similarity between a first positive sample and a first negative sample corresponding to each user; A loss function determination module is configured to determine a preset loss function based on the first similarity and a preset threshold; the preset loss function includes a first preset loss function for user-centric sorting, or a second preset loss function for multi-centric sorting; A model training module is configured to train a preset machine learning model based on the preset loss function to obtain a target recommendation model; The training of the preset machine learning model based on the preset loss function to obtain the target recommendation model includes: calculating the second similarity between each user and the corresponding first negative sample; calculating the third similarity between each user and the corresponding first positive sample; determining the loss value corresponding to each user based on the preset loss function, the first similarity, the second similarity and the third similarity; training the preset machine learning model based on the loss value corresponding to each user to obtain the target recommendation model.

12. The training device for the target recommendation model according to claim 11, characterized in that: The expression of the preset loss function is: Among them, L′ is the loss value, x ui is the third similarity, x uj is the second similarity, x ij is the first similarity, γ is the preset threshold, λ is the weight of multi-center sorting, B includes users, positive samples and negative samples, wherein there is interactive information between the user and the positive sample, and there is no interactive information between the user and the negative sample.

13. The training device for the target recommendation model according to claim 12, characterized in that: When the preset threshold includes multiple thresholds, and the multiple thresholds include the second similarity, the third similarity, and a preset value, the expression of the preset loss function is: Wherein, L″ is a comprehensive loss value, which represents the sum of the loss values corresponding to each threshold value in the multiple threshold values when the preset threshold value includes multiple threshold values; θ is a model parameter, and η is the weight of the L2 loss model.

14. The training device for the target recommendation model according to claim 12, characterized in that: When the preset threshold is the second similarity, the loss function determination module is configured to execute: The preset loss function is determined based on the first similarity and the second similarity.

15. The training device for the target recommendation model according to claim 14, characterized in that: The loss function determination module is configured to execute: When the first similarity is greater than the second similarity, the second preset loss function for multi-center sorting is determined.

16. The training device for the target recommendation model according to claim 14, characterized in that: The loss function determination module is configured to execute: When the first similarity is less than or equal to the second similarity, the first preset loss function for user-centric sorting is determined.

17. The training device for the target recommendation model according to claim 11, characterized in that: The similarity determination module is configured to execute: Calculating a second similarity between each user and the corresponding first negative sample; When the threshold is set to the second similarity, the loss function determination module is configured to execute: When the first similarity is greater than the second similarity, the third preset loss function sorted with the positive samples as the center is determined.

18. The target recommendation model training device according to claim 11, characterized in that: The sample set acquisition module is configured to execute: determining the plurality of users; Determine a first positive sample corresponding to each user of the plurality of users based on the interaction data of the users; Determine a first negative sample corresponding to each user according to a random sampling rule; The first positive sample and the first negative sample are different samples.

19. The target recommendation model training device according to claim 11, characterized in that: The feedback condition indicates that the user is satisfied with the samples recommended in the historical period.

20. A recommendation device, characterized in that: include: A target user acquisition module is configured to acquire identification information of a target user; The recommended object determination module is configured to input the identification information of the target user into the target recommendation model trained according to any target recommendation model training method according to claims 1 to 9, and obtain the identification information of the recommended object corresponding to the identification information of the target user.

21. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the target recommendation model training method according to any one of claims 1 to 9, or to implement the recommendation method according to claim 10.

22. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the target recommendation model training method as described in any one of claims 1 to 9, or execute the recommendation method as described in claim 10.

23. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the computer device executes the target recommendation model training method as described in any one of claims 1 to 9, or executes the recommendation method as described in claim 10.

Citation Information

Patent Citations

  • Model training method and device

    CN111680631A

  • Recommendation model training method and device

    CN111950593A