Recommendation method, equipment and medium
By combining interval network models and prediction network models with an attention mechanism, the problem of finding positive samples in unlabeled samples was solved, improving the accuracy of content recommendation and achieving more precise user recommendations.
Patent Information
- Application Number
- CN202511016245.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies struggle to effectively mine positive samples from unlabeled samples in content recommendation, resulting in low recommendation accuracy. In particular, traditional deep learning uses fixed numerical embedding methods that cannot accurately represent unknown latent features, leading to errors that affect recommendation performance.
Initial interval features are trained using an interval network model. Potential interval features of objects are determined by combining a prediction network model with an attention mechanism. Potential interval features are used to replace traditional numerical features. Feature accuracy is improved based on three feedback relationships (positive feedback, negative feedback, and no feedback). The object matching probability is calculated.
It improves the accuracy of content recommendation by enhancing the precision of the recommendation model through more comprehensive feature representation and matching probability calculation.
Smart Images

Figure CN120910352A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of deep learning, and in particular to a recommendation method, device and medium. BACKGROUND
[0002] In the application scenario of recommending content to a user, part of supervised learning involves three types of sample data: labeled positive samples, labeled negative samples, and a large number of unlabeled samples. This is because in the recommendation scenario, the characteristics of positive and negative samples make it more difficult to obtain positive and negative samples. For example, in the recommendation scenario, the content recommended to the user and clicked by the user is considered as a positive sample, and the content recommended to the user but not clicked is considered as a negative sample; and the content not recommended to the user is the content that the algorithm and the human believe that the user may not be interested in, but the user may still be interested in, which is an unlabeled sample.
[0003] When most of the content recommended to the user is not clicked by the user, it will cause the problem of user loss. The reason why the user does not click may be non-inherent interest or content similarity fatigue. Therefore, the problem of finding positive samples from unlabeled samples is faced, and the goal is to find as many positive samples as possible in the unlabeled samples.
[0004] In related technologies, the way of using numerical embedding coding to train in the model training of the recommendation model brute-force solves the potential features of all samples, but does not specifically mine the features of positive samples in the unlabeled samples. Traditional deep learning uses a fixed value to embed samples to represent unknown potential data features in the samples. However, it is difficult to accurately define unknown data with a fixed value, and the error of the fixed value may directly affect the downstream task in subsequent classification, and thus affect the recommendation effect of the recommendation model.
[0005] Therefore, how to mine positive samples in the unlabeled samples to improve the accuracy of recommending content to the user is a technical problem to be solved. SUMMARY
[0006] The present application provides a recommendation method, device, equipment and medium for improving the accuracy of content recommendation.
[0007] In a first aspect, the present application provides a recommendation method, which is suitable for recommending a second object to a first object, comprising:
[0008] determining, for at least one of the first object and the second object, a latent interval feature of the object by an interval network model; the interval network model is obtained by training an initial interval feature initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object;
[0009] determining, by a prediction network model, whether to recommend the second object to the first object based on the known feature of the first object, the known feature of the second object, and the latent interval feature of the object; the prediction network model is used to determine a recommendation relationship between the first object and the second object.
[0010] In a possible implementation, the determining, by the prediction network model, whether to recommend the second object to the first object based on the known feature of the first object, the known feature of the second object, and the latent interval feature of the object includes:
[0011] the latent interval feature of the object is the latent interval feature of the first object, and the latent feature of the first object is determined from the latent interval feature of the first object based on the known feature of the first object and the known feature of the second object by an attention mechanism in the prediction network model; and / or
[0012] the latent interval feature of the object is the latent interval feature of the second object, and the latent feature of the second object is determined from the latent interval feature of the second object based on the known feature of the second object and the known feature of the first object by an attention mechanism in the prediction network model;
[0013] determining whether to recommend the second object to the first object based on the known feature of the first object, the known feature of the second object, the latent feature of the first object, and / or the latent feature of the second object.
[0014] In a possible implementation, the determining, from the latent interval feature of the first object, the latent feature of the first object based on the known feature of the first object and the known feature of the second object includes:
[0015] converting the known feature of the first object into a known interval feature of the first object, and converting the known feature of the second object into a known interval feature of the second object;
[0016] According to the potential interval feature of the first object, the known interval feature of the first object, and the known interval feature of the second object, an attention weight is determined through full connection calculation;
[0017] According to the attention weight, a potential feature of the first object corresponding to the potential interval feature of the first object is determined.
[0018] In a possible implementation, the interval network model is obtained by training initial interval features initially set in the interval network model according to a recommendation relationship between the first object and any third object, and includes:
[0019] For any object, initial interval features of the object in multiple dimensions are set, and the initial interval features in the multiple dimensions are encoded and decoded to obtain intermediate interval features in the multiple dimensions.
[0020] For the first object and any third object, a predicted recommendation relationship between the first object and the third object is predicted based on the intermediate interval features of the first object in multiple dimensions and the intermediate interval features of the third object in multiple dimensions, and the interval network model is updated according to a real recommendation relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object.
[0021] In a possible implementation, the encoding and decoding of the initial interval features in the multiple dimensions to obtain the intermediate interval features in the multiple dimensions includes:
[0022] The intermediate features in the multiple dimensions are sampled from the initial interval features in the multiple dimensions through Beta distribution, and the intermediate interval features in the multiple dimensions are obtained by expanding the intermediate features in the multiple dimensions based on an activation function.
[0023] In a possible implementation, the setting of the initial interval features of the object in multiple dimensions includes:
[0024] An initial interval matrix of the object in multiple dimensions is set, and each element in the initial interval matrix is an initial interval feature of a corresponding dimension.
[0025] Before the encoding and decoding of the initial interval features in the multiple dimensions, the following further includes:
[0026] The initial interval features under each dimension in the initial interval matrix are weighted and averaged.
[0027] The initial interval features in the multiple dimensions after the weighting and averaging are subjected to model training to obtain updated initial interval features in the multiple dimensions.
[0028] In a possible implementation, the activation function is used to expand the intermediate features of the plurality of dimensions to obtain the intermediate interval features of the plurality of dimensions, including:
[0029] The activation function is used to expand the intermediate features of the plurality of dimensions to obtain the expanded interval features of the plurality of dimensions.
[0030] The expanded interval features of the plurality of dimensions are fully connected to obtain the intermediate interval features of the plurality of dimensions.
[0031] In a second aspect, the present application provides a recommendation device, which is suitable for recommending a second object to a first object, including:
[0032] An encoding module is configured to determine, for at least one of the first object and the second object, a latent interval feature of the object by an interval network model; the interval network model is obtained by training an initial interval feature initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object;
[0033] A prediction module is configured to determine, by a prediction network model, whether to recommend the second object to the first object based on a known feature of the first object, a known feature of the second object, and the latent interval feature of the object; the prediction network model is used to determine a recommendation relationship between the first object and the second object.
[0034] In a possible implementation, the prediction module is specifically configured to determine, based on the known feature of the first object, the known feature of the second object, a latent feature of the first object, and / or a latent feature of the second object, whether to recommend the second object to the first object; wherein the latent interval feature of the object is the latent interval feature of the first object, and the latent feature of the first object is determined from the latent interval feature of the first object based on the known feature of the first object and the known feature of the second object by an attention mechanism in the prediction network model; and / or the latent interval feature of the object is the latent interval feature of the second object, and the latent feature of the second object is determined from the latent interval feature of the second object based on the known feature of the second object and the known feature of the first object by the attention mechanism in the prediction network model.
[0035] In a possible implementation, the prediction module is specifically configured to: convert the known feature of the first object into a known interval feature of the first object; convert the known feature of the second object into a known interval feature of the second object; determine an attention weight through full connection calculation according to the latent interval feature of the first object, the known interval feature of the first object, and the known interval feature of the second object; and determine the latent feature of the first object corresponding to the latent interval feature of the first object according to the attention weight.
[0036] In a possible implementation, the apparatus further includes:
[0037] The training module is configured to: set initial interval features of an object in multiple dimensions for any object; perform encoding and decoding processing on the initial interval features in the multiple dimensions to obtain intermediate interval features in the multiple dimensions; predict a predicted recommendation relationship between the first object and any third object based on the intermediate interval features in the multiple dimensions of the first object and the intermediate interval features in the multiple dimensions of the third object; and update the interval network model according to a real recommendation relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object.
[0038] In a possible implementation, the training module is specifically configured to: sample the intermediate features in the multiple dimensions from the initial interval features in the multiple dimensions through Beta distribution; and expand the intermediate features in the multiple dimensions based on an activation function to obtain the intermediate interval features in the multiple dimensions.
[0039] In a possible implementation, the training module is specifically configured to: set an initial interval matrix of the object in the multiple dimensions; each element in the initial interval matrix is an initial interval feature in a corresponding dimension; and before performing encoding and decoding processing on the initial interval features in the multiple dimensions, the method further includes: performing weighted average on the initial interval features in each dimension in the initial interval matrix; and performing model training on the initial interval features in the multiple dimensions after the weighted average to obtain updated initial interval features in the multiple dimensions.
[0040] In a possible implementation, the training module is specifically configured to: expand the intermediate features in the multiple dimensions based on an activation function to obtain expanded interval features in the multiple dimensions; and perform full connection calculation on the expanded interval features in the multiple dimensions to obtain the intermediate interval features in the multiple dimensions.
[0041] In a third aspect, the present application provides an electronic device, comprising at least a processor and a memory, wherein the processor is configured to implement the steps of the method according to any one of the first aspect when executing a computer program stored in the memory.
[0042] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to implement the steps of the method according to any one of the first aspect when executed by a processor.
[0043] In a fifth aspect, the present application provides a computer program product, which comprises computer program code, wherein the computer program code is configured to make a computer execute the steps of the method according to any one of the first aspect when the computer program code is run on the computer.
[0044] In the embodiments of the present application, for at least one of the first object and the second object, the latent interval feature of the object is determined by the interval network model, and the latent interval feature is used to replace the traditional numerical feature, so as to more accurately represent the unknown latent feature of the object. The interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object. The recommendation relationship includes a positive feedback relationship, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object. The accuracy of determining the latent interval feature is further improved based on the three feedback relationships. The known feature of the first object, the known feature of the second object and the latent interval feature of the at least one object are determined by the prediction network model to determine whether to recommend the second object to the first object. The matching probability between the first object and the second object is more accurately calculated based on the more comprehensive features of the objects, so as to further improve the accuracy of recommending content to the user. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the implementation manners in the related art, the drawings needed to be used in the embodiments or related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0046] Figure 1 A recommendation process schematic diagram provided for some embodiments of the present application;
[0047] Figure 2 An architecture schematic diagram of an interval network model provided for some embodiments of the present application;
[0048] Figure 3 An architecture schematic diagram of a prediction network model provided for some embodiments of the present application;
[0049] Figure 4 A Beta distribution diagram provided for some embodiments of the present application;
[0050] Figure 5 A structure diagram of a recommendation device provided for some embodiments of the present application;
[0051] Figure 6 A structure diagram of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0052] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will further describe the present application with reference to the accompanying drawings. Obviously, the embodiments described in the present application are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0053] It should be noted that the brief description of the terms in the present application is only for the convenience of understanding the following described embodiments, and is not intended to limit the embodiments of the present application. Unless otherwise specified, these terms should be understood according to their ordinary and general meanings.
[0054] The terms "first", "second", "third", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit the specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchanged under appropriate circumstances.
[0055] The terms "include" and "have" and any variations thereof are intended to cover but not exclusive inclusion, for example, a product or device including a series of components does not have to be limited to all components clearly listed, but can include other components not clearly listed or inherent to these products or devices.
[0056] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or a combination of hardware or / and software code capable of performing functions associated with the element.
[0057] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
[0058] Before introducing the content recommendation method provided by the embodiments of the present application, first, the technical background of the embodiments of the present application is introduced to facilitate understanding.
[0059] In the application scenario of recommending content to users, part of the supervised learning involves three types of sample data: labeled positive samples, labeled negative samples, and a large number of unlabeled samples. This is because in the recommendation scenario, the characteristics of positive and negative samples make it more difficult to obtain positive and negative samples. For example, in the recommendation scenario, the content recommended to the user and clicked by the user is considered as a positive sample, and the content recommended to the user but not clicked is considered as a negative sample; and the content not recommended to the user is the content that the algorithm and manual believe that the user may not be interested in, but the user may still be interested in, which is an unlabeled sample.
[0060] When most of the content recommended to the user is not clicked by the user, it will cause the problem of user loss. The reason why the user does not click may be non-inherent interest or content similarity fatigue. Therefore, the problem of finding positive samples from unlabeled samples is faced, and the goal is to find as many positive samples as possible in the unlabeled samples.
[0061] In the related art, the numerical embedding coding training method is used in the model training of the recommendation model to brute-force solve the potential features of all samples, but the features of the positive samples in the unlabeled samples are not targetedly mined. The traditional deep learning uses a fixed value to embed the sample to represent the unknown potential data features in the sample. However, it is difficult to accurately define the unknown data with a fixed value, and the error of the fixed value may directly affect the downstream task in the subsequent classification, and thus affect the recommendation effect of the recommendation model.
[0062] Therefore, how to mine the positive samples in the unlabeled samples to improve the accuracy of content recommendation is a technical problem to be solved.
[0063] Based on this, the application provides a recommendation method, device, equipment and medium, which are used for mining positive samples in unlabeled samples, thereby improving the accuracy of recommending content to users. The method is suitable for recommending a second object to a first object, comprising: determining potential interval features of at least one of the first object and the second object through an interval network model; the interval network model is obtained by training initial interval features initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object; determining whether to recommend the second object to the first object through a prediction network model based on known features of the first object, known features of the second object and the potential interval features of the object; the prediction network model is used to determine the recommendation relationship between the first object and the second object.
[0064] Embodiment 1
[0065] Figure 1 A recommendation process diagram is provided for some embodiments of the application, as shown in Figure 1 The process is suitable for recommending a second object to a first object, comprising:
[0066] S101: determining potential interval features of at least one of the first object and the second object through an interval network model; the interval network model is obtained by training initial interval features initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object.
[0067] The method in the embodiments of the application is applied to an electronic device, which can be a server, a PC, a smart phone, etc.
[0068] The method in the embodiments of the application is suitable for recommending a second object to a first object, wherein the first object can be a user, and the second object can be a document, a video, audio, etc. Each object corresponds to an identification information, which is information for uniquely identifying the object. For example, the first object is a user, and the identification information of the user can be the user's ID number, mobile phone number, etc. For another example, the second object is a document, and the identification information of the document can be the URL of the document, etc.
[0069] For at least one of the first and second objects, based on the object's identification information, a potential interval feature of the object is determined using an interval network model. This potential interval feature can be represented by an interval vector. Specifically, the potential interval feature can be the potential interval feature of the first object, such as a user, or the potential interval feature of the second object, such as a document. For example, the potential interval feature of a user might be the user's geographical location, height range, weight range, etc. Similarly, the potential interval feature of a document might be the geographical range or category range it covers.
[0070] Figure 2 This is a schematic diagram of the architecture of an interval network model provided for some embodiments of this application. For example... Figure 2 As shown, this model uses two networks (left and right in the diagram) to mine latent interval features for the first and second objects, respectively. For example, the left network mines interval features for the first object, and the right network mines interval features for the second object. The embedding and calculation processes for the first and second objects are identical for both networks. By inputting the identification information of at least one of the first and second objects into the interval network model, the latent interval features of the object corresponding to that identification information can be obtained.
[0071] In this application embodiment, the uncertainty of positive sample features in unlabeled samples can be represented by latent interval features. For example, for any first object such as a user, when there is no user geographical location information and the user is in Beijing, the conventional network model uses specific numerical values to represent the user's latent features, which may result in the user's location being learned inaccurately, such as Tianjin, Inner Mongolia, or Liaoning, which are around Beijing. This may lead to recommendations of other cities that are not of interest to the user. However, this application uses a trained interval network model to determine the latent interval features of the object, allowing the interval network model to learn the user's geographical range, such as the North China Plain, and further infer the user's specific city in subsequent processes.
[0072] The interval network model in this embodiment is obtained by training the initial interval features set in the interval network model based on the recommendation relationship between the first object and any third object. The recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no-feedback relationship corresponding to not recommending any third object to the first object.
[0073] For example, the first object is a user, and the third object is a document, wherein the first object and the third object can constitute a positive sample pair, a negative sample pair, and an unlabeled sample pair. The interval network model is trained and updated based on a preset number of three kinds of sample pairs, and the latent interval feature of the object can be obtained after the initial interval feature initially set in the interval network model is trained and updated.
[0074] S102: Determine whether to recommend the second object to the first object by the prediction network model based on the known feature of the first object, the known feature of the second object, and the latent interval feature of the object; the prediction network model is used to determine the recommendation relationship between the first object and the second object.
[0075] The known feature of the first object, the known feature of the second object, and the latent interval feature of at least one object are spliced and input into the prediction network model which has been pre-trained. The matching probability of the first object and the second object output by the prediction network model is used to determine whether to recommend the second object to the first object. For example, when the matching probability exceeds a preset value, it is determined to recommend the second object to the first object. The prediction network model is used to determine the recommendation relationship between the first object and the second object.
[0076] Figure 3 An architecture schematic diagram of a prediction network model is provided for some embodiments of the present application. As shown in Figure 3 For at least one of the first object and the second object, the latent interval feature of the object is spliced with the known feature of the first object and the known feature of the second object as a new feature and input into the prediction network module. The specific latent feature is obtained by feature reconstruction of the latent interval feature through the attention mechanism. The matching probability of the first object and the second object is calculated based on the latent feature, so as to determine the recommendation relationship between the first object and the second object.
[0077] It should be noted that if the known feature is a specific feature value, the known feature can be converted into an interval feature, for example, the known feature 0.3 is intervalized as [0.3, 0.3]. For example, for continuous numerical features with significant long-tail distribution characteristics (theoretical value has no upper limit), such as click volume, like volume, collection volume, and other statistical features, direct application or conventional standardization processing may reduce the sensitivity of the prediction network model to feature distribution. Therefore, the features in the same bin interval share a unified coding index after binning. This method can effectively compress the coding space dimension and improve the operation efficiency of the model. For example, the number of user registration days is obtained by automatic 5-binning as (0, 30], (30, 180], (180, 760], (760, 1580], (1580, +∞].
[0078] In the embodiment of the present application, the known features are intervalized and the potential interval features obtained in S101 are spliced to obtain complete interval features. Since the network prediction model cannot learn the knowledge of the potential interval features by directly taking the interval of the potential interval features as a variable or calculating the interval average value of the potential interval, in this step, the network prediction model uses an attention mechanism to infer the specific value of the potential interval features by calculating the spliced complete interval features of the object, and participates in the model training of the network prediction model. The final classification model, i.e., the network prediction model, is trained. Because the features of the object have relevance, if the height of a user is high, the weight of the user is also likely to be high.
[0079] In the embodiment of the present application, for at least one of the first object and the second object, the potential interval feature of the object is determined by the interval network model, and the potential interval feature is used to replace the traditional numerical feature, so as to more accurately represent the unknown potential feature of the object. The interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object. The recommendation relationship includes a positive feedback relationship, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object. Based on the three feedback relationships, the accuracy of determining the potential interval feature is further improved. The known features of the first object, the known features of the second object, and the potential interval features of the at least one object are determined by the prediction network model to determine whether to recommend the second object to the first object. Based on the more comprehensive features of the objects, the matching probability between the first object and the second object is more accurately calculated, so as to further improve the accuracy of recommending content to the user.
[0080] Embodiment 2:
[0081] In order to further improve the accuracy of recommending content to the user, on the basis of the above-mentioned embodiments, in the embodiment of the present application, the known features of the first object, the known features of the second object, and the potential interval features of the object are determined by the prediction network model to determine whether to recommend the second object to the first object, including:
[0082] The potential interval feature of the object is the potential interval feature of the first object, and the potential feature of the first object is determined from the potential interval feature of the first object based on the known features of the first object and the known features of the second object by the attention mechanism in the prediction network model; and / or
[0083] The potential interval feature of the object is the potential interval feature of the second object, and the potential feature of the second object is determined from the potential interval feature of the second object based on the known features of the second object and the known features of the first object by the attention mechanism in the prediction network model.
[0084] determining whether to recommend the second object to the first object according to the known features of the first object, the known features of the second object, the potential features of the first object, and / or the potential features of the second object.
[0085] If the potential interval feature of the object is the potential interval feature of the first object, the feature attention weight calculation is performed through the attention mechanism in the prediction network model, that is, the weight value corresponding to the potential feature of the first object in the potential interval feature of the first object is calculated based on the known features of the second object, the known features of the first object and the potential interval feature, and the potential feature of the first object is determined from the potential interval feature of the first object based on the weight value. And / or, the potential interval feature of the object is the potential interval feature of the second object, the feature attention weight calculation is performed through the attention mechanism in the prediction network model, that is, the weight value corresponding to the potential feature of the second object in the potential interval feature of the second object is calculated based on the known features of the first object, the known features of the second object and the potential interval feature, and the potential feature of the second object is determined from the potential interval feature of the second object based on the weight value.
[0086] In a possible implementation, the potential interval feature of the object includes the potential interval feature of the first object and the potential interval feature of the second object, and the first weight value corresponding to the potential feature of the first object in the potential interval feature of the first object and the second weight value corresponding to the potential feature of the second object in the potential interval feature of the second object are calculated based on the known features of the first object and the known features of the second object, and the potential interval feature of the first object and the potential interval feature of the second object, the potential feature of the first object is determined from the potential interval feature of the first object based on the first weight value, and the potential feature of the second object is determined from the potential interval feature of the second object based on the second weight value.
[0087] It needs to be noted that if the potential interval feature of the first object or the second object does not exist, a default value can be used for filling, for example, a very small number such as 0.00001 is filled by default. When the known features of the first object and the second object do not exist, a preset value can also be used for filling, for example, -1 is filled. For the first object and the second object, the more comprehensive the existing features are, the more accurate the prediction result is. Generally, the known features of the first object and the second object both exist.
[0088] According to the known features of the first object, the known features of the second object, the potential features of the first object and / or the potential features of the second object, the known features and the potential features are spliced to obtain a more complete feature vector, the matching probability between the first object and the second object is calculated based on the complete feature vector, and whether the second object is recommended to the first object is determined according to whether the matching probability exceeds a threshold value.
[0089] In a possible implementation, the potential features of the first object, the potential features of the second object, the known features of the first object and the known features of the second object are spliced to obtain a more complete feature vector, and full connection layer calculation is performed on the complete feature vector.
[0090] y j = ReLU(W ji y i + b i )
[0091] wherein y j represents an output value of j-layer neuron, i.e., full connection layer calculation, y i represents the complete feature vector after splicing, W ji represents a weight coefficient matrix between i-layer and j-layer, b i is a bias vector, and ReLU is an activation function: max(x, 0), which is used to relieve the gradient vanishing problem, i.e., the gradient is too small when training the deep network of the prediction network model, so that the parameters cannot be updated. The derivative of ReLU is 1 when the input is greater than 0, which avoids the gradient attenuation layer by layer and relieves the problem. At this time, for example, y i is the complete feature vector [0.502949, 0.151261, 0.3].
[0092] y j Two probability values of whether the second object is recommended to the first object are calculated through a probability distribution (softmax) function:
[0093]
[0094] y represents the output of the last full connection layer of the yth sample, and c represents the number of categories, c = 2 in the embodiment of the application. The two categories of the output are the probability of recommending the second object to the first object and the probability of not recommending the second object to the first object, and the sum of the probabilities of the two categories is 1.
[0095] In the embodiments of the present application, the attention mechanism in the prediction network model can be used to determine the potential feature of the first object from the potential interval feature of the first object based on the known feature of the first object and the known feature of the second object, and / or determine the potential feature of the second object from the potential interval feature of the second object based on the known feature of the first object and the known feature of the second object. The more complete feature vector is spliced from the known feature of the first object, the known feature of the second object, the potential feature of the first object and / or the potential feature of the second object, so as to more accurately determine whether to recommend the second object to the first object.
[0096] In a possible implementation, in order to further improve the recommendation accuracy, the training process of the prediction network model is as follows:
[0097] The construction of the training sample set includes: positive samples, i.e. known positive samples, i.e. known users and their clicked recommended contents; negative samples, i.e. known negative samples, i.e. known users and their non-clicked recommended contents, and unlabeled sample random sampling data, i.e. contents not recommended to the user.
[0098] Preferably, the ratio of known positive, known negative, and unlabeled sample random sampling data is 2:5:1, and there are 5W samples in total. The output of the prediction network model is:
[0099]
[0100] y represents the output of the last full connection of the yth sample, k represents the kth output node corresponding to the correct category, c represents the number of categories, and in the embodiments of the present application, c=2. The two categories of the output are the probability of recommending the second object to the first object and the probability of not recommending the second object to the first object, and the sum of the probabilities of the two categories is 1. For example, a certain positive sample is predicted as a positive sample, and the negative sample result is 0.9 and 0.2. The prediction result of the prediction network model output is 0.668187772 and 0.331812228 respectively.
[0101] In a possible implementation, according to the output value and the correct value of the prediction network model, the following cross-entropy loss function is used to calculate the loss value:
[0102]
[0103] L=-1*log(0.668187772)-0*log(0.331812228)=0.1751
[0104] The parameters of the prediction network model are adjusted and optimized according to the loss value.
[0105] Embodiment 3:
[0106] To further improve the accuracy of determining the potential features, on the basis of the above embodiments, in the embodiments of the present application, the determination of the potential features of the first object from the potential interval features of the first object based on the known features of the first object and the known features of the second object comprises:
[0107] Converting the known features of the first object into known interval features of the first object, and converting the known features of the second object into known interval features of the second object;
[0108] According to the potential interval features of the first object, the known interval features of the first object, and the known interval features of the second object, the attention weight is determined by full connection calculation;
[0109] According to the attention weight, the potential features of the first object corresponding to the potential interval features of the first object are determined.
[0110] In a possible implementation, according to the known interval features of the first object, the potential interval features of the first object, the potential interval features of the second object, and the known interval features of the second object, the attention weight is determined by full connection calculation; and according to the attention weight, the potential features of the first object corresponding to the potential interval features of the first object and the potential features of the second object corresponding to the potential interval features of the second object are determined.
[0111] Since the known features of the object can be specific feature values, in order to facilitate calculation and improve the accuracy of calculation, the known features of the first object are converted into known feature interval of the first object, and the known features of the second object are converted into known feature interval of the second object.
[0112] Specifically, the known feature processing includes but is not limited to the following:
[0113] Continuous data binning: for continuous numerical values with significant long-tail distribution characteristics, i.e., known features with no upper limit of theoretical value, such as click volume, like volume, collection volume, and other statistical features, direct application or conventional standardization processing may lead to reduced sensitivity of interval network model to feature distribution. Therefore, binning is performed first, and feature values within the same binning interval share a unified coding index. This method can effectively compress the coding space dimension and improve the operation efficiency of the interval network model. For example, the number of user registration days is automatically divided into 5 bins, i.e., (0, 30], (30, 180], (180, 760], (760, 1580], and (1580, +∞]. Each bin can correspond to a code. Subsequently, the coding interval can be converted, such as converting the known feature 0.3 into [0.3, 0.3].
[0114] Data standardization processing: for the known characteristics of continuous data with relatively concentrated value range and small numerical difference, such as age, different dimensions of recommended content score and the like, the standardization method can be used for processing. The method transforms the data into a standard normal distribution with a mean of 0 and a standard deviation of 1 through centering (subtracting the mean) and scaling (dividing by the standard deviation). For example, the original ages of 5 users are [21, 32, 36, 38, 50]. The calculation is as follows:
[0115]
[0116] The calculation is as follows: [-1.536, -0.363, 0.064, 0.277, 1.557].
[0117] Category variable encoding: for category characteristics such as gender, interest, mobile phone operating system and the like known characteristics, since the deep learning model cannot directly process discrete variables, it is processed by encoding into 0 and 1 form. For example, for gender feature processing: [0, 1] represents male, [1, 0] represents female, and [0, 0] represents unknown.
[0118] After the known characteristics are processed in the above manner, the existing numerical characteristics or corresponding codes are intervalized, such as the first object is a user and the second object is a content to be recommended, wherein the known characteristics of the user 0.3 are intervalized into the known interval characteristics [0.3, 0.3], and the known characteristics of the content 0.6 are intervalized into the known interval characteristics [0.6, 0.6].
[0119] In one possible implementation, the potential interval characteristics of the user and the potential interval characteristics of the content are [0.32, 0.873] and [0.03, 0.931], and are spliced according to the preset order [known interval characteristics of the first object, potential interval characteristics of the first object, potential interval characteristics of the second object, known interval characteristics of the second object] as follows: m = [[0.3, 0.3], [0.32, 0.873], [0.03, 0.931], [0.6, 0.6]], and the attention weight is determined by full connection calculation. It should be noted that the preset order is not fixed and can be freely set according to requirements, and preferably, the known interval characteristics and the potential interval characteristics of the first object are adjacent, and the known interval characteristics and the potential interval characteristics of the second object are adjacent, so that the interval network model can better learn the feature information of the first object and the second object respectively.
[0120] In one possible implementation, if the potential interval characteristics of the first object or the second object do not exist, a default value can be used instead. In order to avoid the influence of the default value on other characteristic values, the default value is a very small number such as 0.00001.
[0121] The process of calculating attention weight can be completed by interval self-attention mechanism calculation. Including: the above-mentioned example of intervaling the existing numerical feature of the first object, such as intervaling the known feature 0.3 into the known interval feature [0.3, 0.3], and splicing the latent interval feature [0.32, 0.873] of the first object, the latent interval feature [0.03, 0.931] of the second object, and then intervaling the known feature 0.6 of the second object into the known interval feature [0.6, 0.6], to obtain the complete interval feature, such as: y m = [[0.3, 0.3], [0.32, 0.873], [0.03, 0.931], [0.6, 0.6]].
[0122] The global mean (Squeeze) calculation is performed on the complete interval feature, that is, the average value of the two elements of each interval feature is calculated:
[0123] z1 = (0.3 + 0.3) / 2 = 0.3
[0124] z2 = (0.32 + 0.8732) / 2 = 0.5965
[0125] z3 = (0.03 + 0.9312) / 2 = 0.4805
[0126] z4 = (0.6 + 0.6) / 2 = 0.6
[0127] Thus, the compressed feature vector z = [0.3, 0.5965, 0.4805, 0.6] is obtained.
[0128] Then, the feature attention weight calculation (Excitation) is performed on the compressed feature vector, that is, the feature vector z is calculated through two fully connected layers to calculate the attention weight size, and the formula is as follows:
[0129] First layer: u = ReLU (w1·z + b1)
[0130] Second layer: v = w2⊙u + b2
[0131] The fully connected layer parameters are randomly initialized, and the following is a calculation example: let
[0132] w1 = [0.2, -0.5, 0.8, 0.3], b1 = 0.1
[0133] w2 = [0.6, -0.3, 0.4, 0.1], b1 = 0.2
[0134] Then:
[0135] u = ReLU (w1·z + b1)
[0136] = ReLU(0.2*0.3 + (-0.5)*0.5965 + 0.8*0.4805 + 0.3*0.6
[0137] + 0.1) = ReLU(0.42615) = 0.42615
[0138] v = w2 * u + b2
[0139] = [0.6*0.42615, -0.3*0.42615, 0.4*0.42615, 0.1*0.42615]
[0140] + 0.2 = [0.45569, 0.072155, 0.37046, 0.242615
[0141] Finally, the latent features are reconstructed from the latent interval features. According to the first item of the attention weight v, the latent feature of the first object corresponding to the latent interval feature of the first object is determined, and according to the second item of the attention weight v, the latent feature of the second object corresponding to the latent interval feature of the second object can be determined.
[0142] In a possible implementation, the following formula can be used to determine the latent feature based on the attention weight:
[0143] y n = y m:,1 + (y m:,2 - y m:,1 ) * v
[0144] y m = [[0.3, 0.3], [0.32, 0.873], [0.03, 0.931], [0.6, 0.6]] is the initial latent interval feature of the first object, the latent interval feature of the second object, and the known interval feature of the first object, y n is the reconstructed latent feature of the first object, the latent feature of the second object, and the known interval feature of the first object. v represents the attention weight, y m:,1 represents the first column of the latent interval feature, y m:,2 represents the second column of the latent interval feature.
[0145] The reconstruction process is as follows:
[0146] 0.3 + (0.3 - 0.3) * 0.45569 = 0.3
[0147] 0.32 + (0.873 - 0.32) * 0.072155 = 0.359902
[0148] 0.03 + (0.931 - 0.03) * 0.37046 = 0.363784
[0149] 0.6 + (0.6 - 0.6) * 0.242615 = 0.6
[0150] The latent feature of the first object, the latent feature of the second object, and the known feature of the first object obtained after reconstruction are y n = [0.3, 0.359902, 0.363784, 0.6].
[0151] In the embodiments of the present application, the role of the full connection layer is equivalent to "integrating all clues to make a decision". For example, for an animal, the shape of the ear, the length of the tail, the sound, and other characteristics need to be analyzed at the same time. The full connection layer will connect all the known features and latent features (such as ears and hair) found in the front of the neural network, consider all the information, and finally judge the result. It is equivalent to "piecing together scattered clues to form a complete answer".
[0152] Similarly, the latent feature determination process of the second object is the same as that of the first object. If the latent interval feature of the first object and the latent interval feature of the second object exist, the latent interval feature of the first object and the latent interval feature of the second object, and the known feature of at least one object can be spliced according to the above example, and then the attention weight is calculated through full connection, and finally the latent feature of the first object and the latent feature of the second object are determined according to the attention weight.
[0153] The way of directly numerically encoding the user or the content in the related art to determine the latent feature of the user and the content has low accuracy, and in the embodiments of the present application, the known feature of the object is converted into the known interval feature of the object, the attention weight is determined according to the latent interval feature of the object and the known interval feature of the object through full connection calculation, and the latent feature of the object corresponding to the latent interval feature of the object is determined according to the attention weight. Thus, the latent feature of the user and the content to be recommended can be more accurately determined, and the accuracy of recommending content to the user is further improved.
[0154] Embodiment 4:
[0155] In order to further improve the accuracy of determining the latent interval feature, on the basis of the above embodiments, in the embodiments of the present application, the interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object, and includes:
[0156] For any object, set the initial interval characteristics of the object in multiple dimensions; encode and decode the initial interval characteristics in multiple dimensions to obtain intermediate interval characteristics in multiple dimensions;
[0157] For the first object and any third object, based on the intermediate interval characteristics of the first object in multiple dimensions and the intermediate interval characteristics of the third object in multiple dimensions, predict the predicted recommendation relationship between the first object and the third object; update the interval network model according to the real recommendation relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object.
[0158] In order to better train the interval network model, for any object, set the initial interval characteristics of the object in multiple dimensions, for example, the initial interval characteristics of the object in 5 dimensions can be set, for example, a 4*5 random initial interval characteristic matrix.
[0159] Encode and decode the initial interval characteristics in multiple dimensions, that is, encode and decode the initial interval characteristics in multiple dimensions. Among them, encoding (Encode) refers to converting the initial interval characteristics into numerical intermediate characteristics, and decoding (Decode) refers to converting the numerical intermediate characteristics into intermediate interval characteristics. It is equivalent to processing complex tasks in steps, and the initial interval characteristics are converted into numerical intermediate characteristics, which can extract key feature information and avoid too much feature interference. Then generate the result according to the target, that is, convert the numerical intermediate characteristics into interval type intermediate interval characteristics, which can enable the interval network model to better learn the potential interval characteristics of the object.
[0160] In a possible implementation, the encoding process can use sampling training, that is, sampling the initial interval network characteristics in multiple dimensions to obtain numerical intermediate characteristics in multiple dimensions; wherein the sampling method can refer to the existing sampling technology, and the present application does not limit it. Based on the activation function, the intermediate characteristics in multiple dimensions are expanded to obtain the intermediate interval characteristics in multiple dimensions.
[0161] For a sample pair composed of a first object and any third object, based on the intermediate interval characteristics of the first object in multiple dimensions and the intermediate interval characteristics of the third object in multiple dimensions, predict the predicted recommendation relationship between the first object and the third object. Update the parameters in the interval network model according to the real relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object, so as to obtain the trained interval network model.
[0162] In a possible implementation, the first object is a user, and the third object is a document. The positive sample represents a document recommended to the user and clicked by the user, the negative sample represents a document recommended to the user but not clicked by the user, and the unlabeled sample represents a document not recommended to the user. The first object and any third object can constitute a positive sample pair, a negative sample pair, and an unlabeled sample pair.
[0163] In a possible implementation, the intermediate interval features of the first object and the third object are both 5-dimensional interval vectors, and the intermediate interval features of the first object and the second object are spliced into a 10-dimensional interval vector y5 and brought into the following formula for calculation:
[0164]
[0165] wherein The calculation logic is as follows:
[0166]
[0167] wherein y is a 3-dimensional data, and sequentially corresponds to the probability of the positive sample category, the negative sample category, and the unlabeled sample category, W 65 is a 3x10 weight coefficient matrix, is a 1x2 column of random numbers, b6 is a 3-dimensional bias vector, and the first 4-dimensional data of y5 is [0.13, 0.24], [0.38, 0.93], [0.03, 0.05], and [0.32, 0.57], is [0.35, 0.56], The first 4-dimensional calculation is as follows:
[0168] First dimension:
[0169]
[0170] Second dimension
[0171]
[0172] Third dimension
[0173]
[0174] Fourth dimension
[0175]
[0176]
[0177] The 10-dimensional data is sequentially calculated to obtain [0.1508, 0.1378, 0.3625, 0.001,…].
[0178] Preferably, in order to facilitate subsequent calculation of probability, the norm calculation is used first, the norm calculation is a quantitative method for measuring the "size" of vector, matrix or function in mathematics, which effectively reduces the model complexity by constraining the parameters, and is easy for model training.
[0179] y is calculated by a probability distribution (softmax) function to obtain the probability value of the third object being different categories, i.e. positive samples, negative samples and unlabeled samples:
[0180]
[0181] y represents the yth sample, k represents the kth output node corresponding to the correct category node, c represents the category number, and this item C=3. For example, a certain third object is a positive sample, i.e. the true recommendation relationship between the first object and the third object is recommendation, but the predicted recommendation relationship between the first object and the third object, i.e. the result of predicting the third object as a positive sample, a negative sample and an unlabeled sample, is 0.9, 0.2 and 0.5, respectively. After being brought into the above formula for calculation, the final results are 0.461488, 0.229168 and 0.309344, respectively.
[0182] Based on the intermediate interval features of the first object and the third object in multiple dimensions, the predicted recommendation relationship and the true recommendation relationship between the first object and the third object, a loss function is calculated. In one possible implementation, a G interval penalty term is added to the cross-entropy loss function, and G is the mean of the square of the interval interval of the intermediate interval feature, because of the uncertainty of the interval potential feature of the intermediate interval feature, in order to more accurately estimate the interval range, i.e. the value of the right interval minus the left interval cannot be too large, therefore, the interval size penalty term is added for model training. The loss (LOSS) function is:
[0183]
[0184] In the embodiments of the present application, y c is the true label of the user. L is the calculated Loss value, for example, the first object is a user, and the intermediate interval feature is
[0185] user vector = [[0.185, 0.715], [0.445, 0.6325], [0.4125, 0.7925], [0.295, 0.57], [0.37, 0.57]]
[0186] L = -1*log(0.461488)-0*log(0.229168)-0*log(0.309344) + ((0.715-0.185) 2 + (0.6325-0.445) 2 + (0.7925-0.4125)2 + (0.57 - 0.295) 2 + (0.57 - 0.37) 2 ) / 5 = 0.451056
[0187] Updating the parameters in the interval network model according to the loss value.
[0188] Preferably, the ratio of positive samples and negative samples and unlabeled samples is 1:1, wherein the ratio of positive samples and negative samples is 1:2.5, and there are 4W samples in total. In order to enable the interval network model to learn more knowledge of the unlabeled samples, 8 times of training are performed in the training process using different unlabeled samples and the same positive and negative samples, and the Adam optimizer is selected as the optimizer in the model training.
[0189] In the embodiments of the present application, for any object, initial interval features of the object in multiple dimensions are set; the initial interval features in multiple dimensions are encoded and decoded to obtain more accurate intermediate interval features in multiple dimensions; for a first object and any third object, a predicted recommendation relationship between the first object and the third object is predicted based on the intermediate interval features of the first object in multiple dimensions and the intermediate interval features of the third object in multiple dimensions; and the interval network model is updated according to the real recommendation relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object, so that the potential interval features of the object can be more accurately determined, and the accuracy of recommending a second object to the first object is further improved.
[0190] Embodiment 5:
[0191] In order to further improve the accuracy of recommending content to a user, on the basis of the above embodiments, in the embodiments of the present application, the encoding and decoding processing of the initial interval features in multiple dimensions to obtain the intermediate interval features in multiple dimensions comprises:
[0192] The intermediate features in multiple dimensions are sampled from the initial interval features in multiple dimensions by Beta distribution; and the intermediate interval features in multiple dimensions are obtained by expanding the intermediate features in multiple dimensions based on an activation function.
[0193] In order to obtain more accurate intermediate interval features in multiple dimensions, the intermediate features in multiple dimensions are sampled from the initial interval features in multiple dimensions by Beta distribution, and the intermediate interval features in multiple dimensions are obtained by expanding the intermediate features in multiple dimensions based on an activation function. This is equivalent to processing a complex task in steps, and the initial interval features are converted into numerical intermediate features, which can extract key feature information and avoid too many feature interferences. Then, the numerical intermediate features are expanded into interval-type intermediate interval features according to the target generated results, which can enable the interval network model to better learn the potential interval features of the object.
[0194] Figure 4 A Beta distribution diagram is provided for some embodiments of the present application. As shown in the figure, the Beta distribution parameters (hyperparameters) take values of a = 0.5 and β = 0.5, and the specific distribution is as shown in the figure. Figure 4
[0195] In a possible implementation, the third layer of the interval network model in the above interval network model can be subjected to sampling training. To optimize the initial interval feature, the third layer samples and trains the interval data of the initial interval feature, and the formula is as follows: Figure 2
[0196] y3 = y 2:,1 + (y 2:,2 -y 2:,1 ) ⊙ w
[0197] w = [λ1, λ2, λ3, λ4, λ5]
[0198] y3 represents the output of the third layer of the interval network model, y 2:,2 represents the second column of the output of the second layer of the interval network model, y 2:,1 represents the first column of the output of the second layer of the interval network model, and ⊙ represents the Hadamard product of the output of the third layer of the interval network model. λ ∈ [0, 1] is a probability value, that is, λ is subject to a Beta distribution with parameter a, wherein the Beta distribution parameters (hyperparameters) take values of a = 0.5 and β = 0.5, and the specific distribution is as shown in the curve. Figure 4
[0199] Let y2 = [[0.135, 0.215], [0.441, 0.925], [0.015, 0.925], [0.359, 0.572], [0.173, 0.757]], and randomly initialize the vector w = [0.3, 0.1, 0.7, 0.6, 0.3] T .
[0200]
[0201] The model automatically optimizes the parameters w and y2 through the loss function in gradient backpropagation, and then optimizes the initial interval feature of the object to obtain the latent interval feature.
[0202] In a possible implementation, the fourth layer of the interval network model shown in the above Figure 2 is an expansion layer, which can use the following activation function to expand the intermediate features of multiple dimensions to obtain intermediate interval features of multiple dimensions.
[0203]
[0204] is a vector of 1 row and 2 columns, and the initial value is a random number, which is automatically optimized in the model training of the interval network model. Let the weight coefficient matrix be:
[0205]
[0206] b1=[0.2,0.22,0.51,0.32,0.81] T
[0207]
[0208] The expanded multiple-dimension intermediate interval features can be obtained according to the formula of the following activation function:
[0209] In the embodiment of the present application, the multiple-dimension intermediate features are obtained by sampling the initial interval features in multiple dimensions through Beta distribution, so that more key feature information can be extracted and unimportant feature influence can be discarded; the multiple-dimension intermediate interval features of more comprehensive focused key feature information are obtained by expanding the multiple-dimension intermediate features based on the activation function, so as to further improve the accuracy of determining the potential interval features of the user.
[0210] Embodiment 6:
[0211] In order to further improve the accuracy of recommending content to the user, on the basis of the above embodiments, in the embodiment of the present application, the setting of the initial interval features of the object in multiple dimensions comprises:
[0212] setting an initial interval matrix of the object in multiple dimensions; each element in the initial interval matrix is an initial interval feature of the corresponding dimension;
[0213] Before the encoding and decoding processing of the initial interval features in multiple dimensions, further comprising:
[0214] performing weighted average on the initial interval features under each dimension in the initial interval matrix;
[0215] performing model training on the initial interval features in multiple dimensions after the weighted average to obtain updated initial interval features in multiple dimensions.
[0216] In order to more accurately obtain the potential interval features of the object, the initial interval matrix of the object in multiple dimensions can be set in advance, and each element in the initial interval matrix is an initial interval feature of the corresponding dimension. In a possible implementation manner, the initial interval matrix can be set as a 10-dimensional matrix, representing the potential initial interval features of the object in 10 dimensions.
[0217] Before the initial interval characteristics in multiple dimensions are coded, i.e., encoded and / or decoded, the initial interval characteristics in each dimension in the initial interval matrix can also be weighted and averaged for ease of calculation.
[0218] Specifically, in a possible implementation, initializing the user interval vector includes: initializing the identification information embedding of each object to obtain a random initial interval matrix, and obtaining the initial interval characteristics of the fixed dimension through polling. For example, the identification information of the first object, i.e., a certain user, is embedded to obtain a 4*5 random initial interval matrix.
[0219]
[0220] For each column, the weighted average is calculated to obtain the interval user vector. For example, the left interval value of the first column data is (0.03+0.13+0.38+0.20) / 4=0.185, and the right interval value is (0.73+0.72+0.91+0.50) / 4=0.715. Therefore, [0.185, 0.715] is the first feature interval of the user, and the second, third, fourth, and fifth column data are sequentially calculated to obtain y0=[[0.185, 0.715], [0.445, 0.6325], [0.4125, 0.7925], [0.295, 0.57], [0.37, 0.57]], which is the interval user vector.
[0221] In a possible implementation, the network first layer and the network second layer of the interval network model shown in the above formula (1) perform interval full connection layer calculation. The first layer and the second layer in the model have the same calculation logic formula, and the full connection calculation formula is as follows: Figure 2
[0222] y j = ReLU(W ji y i +b i )
[0223] where y j represents the j-th layer neuron, W ji represents the weight coefficient matrix between the i-th layer and the j-th layer, b i is a bias vector, W ji and b i are random numbers, which are automatically optimized in model training. ReLU is an activation function: max(x, 0), which is used to alleviate the gradient vanishing problem. Gradient vanishing refers to the fact that the gradient is too small during deep network training, which prevents the parameters from being updated. ReLU has a derivative of 1 when the input is greater than 0, which avoids gradient attenuation layer by layer and alleviates the problem. For example, the calculation process is as follows: let
[0224]
[0225] b1 = [0.3, 0.42, 0.52, 0.23, 0.78] T
[0226] The calculation process is as follows:
[0227]
[0228] The second layer y2 of the interval network model calculates in the same way. Thus, the updated initial interval features of multiple dimensions are obtained.
[0229] In the embodiments of the present application, an initial interval matrix of the object in multiple dimensions is set; each element in the initial interval matrix is an initial interval feature of the corresponding dimension; before the initial interval features of multiple dimensions are processed by encoding and decoding, the initial interval features of each dimension in the initial interval matrix are weighted and averaged; the initial interval features of multiple dimensions after the weighted average are trained to obtain updated initial interval features of multiple dimensions, so that the interval network model can be better trained, the problem of gradient disappearance can be alleviated, and the accuracy of determining the potential interval features of the object can be further improved.
[0230] Embodiment 7:
[0231] In order to further improve the accuracy of recommending content to the user, on the basis of the above embodiments, in the embodiments of the present application, the intermediate features of multiple dimensions are expanded based on the activation function to obtain the intermediate interval features of multiple dimensions, which includes:
[0232] The intermediate features of multiple dimensions are expanded based on the activation function to obtain the expanded interval features of multiple dimensions.
[0233] The expanded interval features of multiple dimensions are fully connected to obtain the intermediate interval features of multiple dimensions.
[0234] In a possible implementation, as shown in the above Figure 2 The fourth layer of the interval network model is an expansion layer, which can use an activation function to expand the intermediate features of multiple dimensions to obtain the expanded interval features of multiple dimensions.
[0235] In a possible implementation, the fifth layer of the interval network model is a fully connected layer, which fully connects the expanded interval features of multiple dimensions output by the fourth layer. In a possible implementation, the calculation logic and formula of the fifth layer of the interval network model are the same as those of the first and second layers of the network, which can be referred to the above description, and the repeated parts will not be described here.
[0236] In the embodiments of the present application, the intermediate features of multiple dimensions are expanded based on the activation to obtain expanded interval features of multiple dimensions; full connection calculation is performed on the expanded interval features of multiple dimensions to obtain intermediate interval features of multiple dimensions, so that the intermediate interval features of the object can be more accurately represented, and the accuracy of recommending the second object to the first object is further improved.
[0237] Embodiment 8:
[0238] Based on the same technical concept, on the basis of the above-mentioned embodiments, in the embodiments of the present application, a recommendation device is also provided, which is suitable for recommending a second object to a first object, Figure 5 A structural schematic diagram of a recommendation device provided for some embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the device includes: Figure 5
[0239] The encoding module 501 is configured to determine the latent interval feature of at least one of the first object and the second object by an interval network model; the interval network model is obtained by training an initial interval feature initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object.
[0240] The prediction module 502 is configured to determine whether to recommend the second object to the first object by a prediction network model based on the known feature of the first object, the known feature of the second object, and the latent interval feature of the object; the prediction network model is used to determine the recommendation relationship between the first object and the second object.
[0241] In a possible implementation, the prediction module 502 is specifically configured to determine whether to recommend the second object to the first object according to the known feature of the first object, the known feature of the second object, the latent feature of the first object, and / or the latent feature of the second object; wherein the latent interval feature of the object is the latent interval feature of the first object, the latent feature of the first object is determined from the latent interval feature of the first object based on the known feature of the first object and the known feature of the second object by an attention mechanism in the prediction network model; and / or the latent interval feature of the object is the latent interval feature of the second object, the latent feature of the second object is determined from the latent interval feature of the second object based on the known feature of the second object and the known feature of the first object by the attention mechanism in the prediction network model.
[0242] In a possible implementation, the prediction module 502 is specifically configured to: convert the known feature of the first object into a known interval feature of the first object; convert the known feature of the second object into a known interval feature of the second object; determine an attention weight through full connection calculation according to the latent interval feature of the first object, the known interval feature of the first object, and the known interval feature of the second object; and determine the latent feature of the first object corresponding to the latent interval feature of the first object according to the attention weight.
[0243] In a possible implementation, the apparatus further includes:
[0244] The training module is configured to: set initial interval features of an object in multiple dimensions for any object; perform encoding and decoding processing on the initial interval features in the multiple dimensions to obtain intermediate interval features in the multiple dimensions; predict a predicted recommendation relationship between the first object and any third object based on the intermediate interval features of the first object in the multiple dimensions and the intermediate interval features of the third object in the multiple dimensions; and update the interval network model according to a real recommendation relationship between the first object and the third object and the predicted recommendation relationship between the first object and the third object.
[0245] In a possible implementation, the training module is specifically configured to: sample the intermediate features in the multiple dimensions from the initial interval features in the multiple dimensions through Beta distribution; and expand the intermediate features in the multiple dimensions based on an activation function to obtain the intermediate interval features in the multiple dimensions.
[0246] In a possible implementation, the training module is specifically configured to: set an initial interval matrix of the object in the multiple dimensions; each element in the initial interval matrix is an initial interval feature in a corresponding dimension; and before the encoding and decoding processing is performed on the initial interval features in the multiple dimensions, the method further includes: performing weighted average on the initial interval features in each dimension in the initial interval matrix; and performing model training on the initial interval features in the multiple dimensions after the weighted average to obtain updated initial interval features in the multiple dimensions.
[0247] In a possible implementation, the training module is specifically configured to: expand the intermediate features in the multiple dimensions based on an activation function to obtain expanded interval features in the multiple dimensions; and perform full connection calculation on the expanded interval features in the multiple dimensions to obtain the intermediate interval features in the multiple dimensions.
[0248] In the embodiments of the present application, for at least one of the first object and the second object, the latent interval feature of the object is determined through the interval network model, and the latent interval feature is used to replace the traditional numerical feature, so as to more accurately represent the unknown latent feature of the object. The interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object. The recommendation relationship includes a positive feedback relationship, a negative feedback relationship obtained after any third object is recommended to the first object, or a no feedback relationship corresponding to that any third object is not recommended to the first object. Based on the three feedback relationships, the accuracy of determining the latent interval feature is further improved. The known feature of the first object, the known feature of the second object and the latent interval feature of the at least one object are determined through the prediction network model to determine whether the second object is recommended to the first object. Based on the more comprehensive features of the objects, the matching probability between the first object and the second object is more accurately calculated, so as to further improve the accuracy of recommending content to the user.
[0249] Embodiment 9
[0250] Based on the same inventive concept, on the basis of the above-mentioned embodiments, in the embodiments of the present application, an electronic device is provided, which can realize the functions of the recommendation device described above. Figure 6 A structural schematic diagram of an electronic device provided for some embodiments of the present application is shown in FIG. 6. As shown in the figure, the electronic device includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 complete mutual communication through the communication bus 604. Figure 6
[0251] The memory 603 stores a computer program, and when the program is executed by the processor 601, the processor 601 executes the steps included in the recommendation method of any one of the above-mentioned embodiments.
[0252] The communication bus mentioned above can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0253] The communication interface 602 is used for communication between the above-mentioned electronic device and other devices.
[0254] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.
[0255] The aforementioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc., and can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0256] In the embodiments of the present application, for at least one of the first object and the second object, the latent interval feature of the object is determined through the interval network model, and the latent interval feature is used to replace the traditional numerical feature, so as to more accurately represent the unknown latent feature of the object. The interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object. The recommendation relationship includes a positive feedback relationship, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object. Based on the three feedback relationships, the accuracy of determining the latent interval feature is further improved. The known features of the first object, the known features of the second object and the latent interval features of the at least one object are determined through the prediction network model to determine whether to recommend the second object to the first object. Based on the more comprehensive features of the objects, the matching probability between the first object and the second object is more accurately calculated, so as to further improve the accuracy of recommending content to the user.
[0257] Embodiment 10:
[0258] Based on the same inventive concept, on the basis of the above-mentioned embodiments, in the embodiments of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program executable by a processor. When the program runs on the processor, the processor executes the steps included in the recommendation method according to any one of the above-mentioned embodiments.
[0259] The above-mentioned computer readable storage medium can be any available medium or data storage device accessible by the processor in the electronic device, including but not limited to a magnetic memory such as a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc., an optical memory such as a CD, a DVD, a BD, a HVD, etc., and a semiconductor memory such as a ROM, an EPROM, an EEPROM, a non-volatile memory (NAND FLASH), a solid state disk (SSD), etc.
[0260] Based on the same inventive concept, the embodiments of the present application further provide a computer program product, which comprises computer program codes, when the computer program codes run on a computer, make the computer execute the steps of any of the recommendation methods discussed above. Since the principle of the above computer program product to solve the problem is similar to the process of the above recommendation method, the implementation of the above computer program product can be referred to the implementation of the method, and the repeated parts will not be described here.
[0261] In the embodiments of the present application, for at least one of the first object and the second object, the latent interval feature of the object is determined through the interval network model, and the latent interval feature is used to replace the traditional numerical feature, so as to more accurately represent the unknown latent feature of the object. The interval network model is obtained by training the initial interval feature initially set in the interval network model according to the recommendation relationship between the first object and any third object. The recommendation relationship includes positive feedback relationship, negative feedback relationship obtained after recommending any third object to the first object, or no feedback relationship corresponding to not recommending any third object to the first object. The accuracy of determining the latent interval feature is further improved based on the three feedback relationships. The known features of the first object, the known features of the second object and the latent interval features of the at least one object are determined through the prediction network model to determine whether to recommend the second object to the first object. The matching probability between the first object and the second object is more accurately calculated based on the more comprehensive features of the objects, so as to further improve the accuracy of recommending content to the user.
[0262] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0263] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions described in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1means for performing the function specified by the block or blocks.
[0264] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or means for performing the function specified by the block or blocks.
[0265] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or steps for performing the function specified by the block or blocks.
[0266] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A recommendation method characterized by comprising: The method is suitable for recommending a second object to a first object, comprising: determining latent interval features of at least one of the first object and the second object by an interval network model; the interval network model is obtained by training initial interval features initially set in the interval network model according to a recommendation relationship between the first object and any third object; the recommendation relationship includes a positive feedback relationship obtained after recommending any third object to the first object, a negative feedback relationship obtained after recommending any third object to the first object, or a no feedback relationship corresponding to not recommending any third object to the first object; determining whether to recommend the second object to the first object by a prediction network model based on known features of the first object, known features of the second object and the latent interval features of the objects; the prediction network model is used to determine a recommendation relationship between the first object and the second object.
2. The method of claim 1, wherein, The method for determining whether to recommend the second object to the first object by the prediction network model based on the known features of the first object, the known features of the second object and the latent interval features of the objects comprises: the latent interval features of the objects are the latent interval features of the first object, and the latent features of the first object are determined from the latent interval features of the first object based on the known features of the first object and the known features of the second object by an attention mechanism in the prediction network model; and / or the latent interval features of the objects are the latent interval features of the second object, and the latent features of the second object are determined from the latent interval features of the second object based on the known features of the second object and the known features of the first object by an attention mechanism in the prediction network model; determining whether to recommend the second object to the first object based on the known features of the first object, the known features of the second object, the latent features of the first object and / or the latent features of the second object.
3. The method of claim 2, wherein, The method for determining the latent features of the first object from the latent interval features of the first object based on the known features of the first object and the known features of the second object comprises: converting the known features of the first object into known interval features of the first object, and converting the known features of the second object into known interval features of the second object; determining attention weights by full connection calculation based on the latent interval features of the first object and the known interval features of the first object and the known interval features of the second object; determining the latent features of the first object corresponding to the latent interval features of the first object based on the attention weights.
4. The method according to any one of claims 1 to 3, characterized in that, The interval network model is obtained by training initial interval features initially set in the interval network model according to a recommendation relationship between the first object and any third object, comprising: setting initial interval features of the object in multiple dimensions for any object; and obtaining intermediate interval features of the multiple dimensions by encoding and decoding the initial interval features of the multiple dimensions. For the first object and any third object, based on the intermediate interval features of the first object in multiple dimensions and the intermediate interval features of the third object in multiple dimensions, a predicted recommended relationship between the first object and the third object is predicted; and according to the real recommended relationship between the first object and the third object and the predicted recommended relationship between the first object and the third object, the interval network model is updated.
5. The method of claim 4, wherein, The encoding and decoding processing of the initial interval features of the multiple dimensions to obtain the intermediate interval features of the multiple dimensions comprises: The intermediate features of the multiple dimensions are sampled from the initial interval features of the multiple dimensions through Beta distribution; and the intermediate interval features of the multiple dimensions are obtained by expanding the intermediate features of the multiple dimensions based on an activation function.
6. The method of claim 5, wherein, The setting of the initial interval features of the object in multiple dimensions comprises: An initial interval matrix of the object in multiple dimensions is set; each element in the initial interval matrix is an initial interval feature of a corresponding dimension; Before the encoding and decoding processing of the initial interval features of the multiple dimensions, the method further comprises: The initial interval features of each dimension in the initial interval matrix are weighted and averaged; The initial interval features of the multiple dimensions after the weighted averaging are subjected to model training to obtain updated initial interval features of the multiple dimensions.
7. The method of claim 5, wherein, The expanding of the intermediate features of the multiple dimensions based on the activation function to obtain the intermediate interval features of the multiple dimensions comprises: The intermediate features of the multiple dimensions are expanded based on the activation function to obtain expanded interval features of the multiple dimensions; The expanded interval features of the multiple dimensions are subjected to full connection calculation to obtain the intermediate interval features of the multiple dimensions.
8. An electronic device, comprising: It comprises: a memory for storing program instructions; a processor for calling the program instructions stored in the memory and executing the steps included in the method according to the obtained program instructions.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program comprises program instructions, which, when executed by a computer, cause the computer to execute the method as claimed in any one of claims 1-7.
10. A computer program product, characterised in that, The computer program product comprises computer program code, which, when executed on a computer, causes the computer to execute the method as claimed in any one of claims 1-7. The computer program product comprises computer program code, which, when executed on a computer, causes the computer to execute the method as claimed in any one of claims 1-7.