Article recommendation method and device, computer equipment and storage medium

By constructing a recommendation loss function based on Ruili divergence coefficient and learnable user personalized threshold parameters, the recommendation model is trained, and the problem of inaccurate item recommendation in the existing technology is solved, and a more efficient item recommendation effect is achieved.

CN119444350APending Publication Date: 2025-02-14HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411404341.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Existing item recommendation methods cannot accurately recommend items to users, resulting in poor model performance.

Method used

By obtaining the training data set, a recommendation loss function based on the preset Ruili divergence coefficient and learnable user personalized threshold parameters is constructed, and the recommended model is trained to obtain a fully trained recommendation model, and the target user's items are performed based on the model. recommend.

Benefits of technology

It improves the prediction performance of the recommendation model, can recommend items to users more accurately, and solves the problem of not being able to accurately recommend items to users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444350A_ABST
    Figure CN119444350A_ABST
Patent Text Reader

Abstract

The invention relates to an article recommendation method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a training data set which is document data or text data containing the interaction information between each sample user and each sample article; aiming at a pre-established recommendation model, constructing a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter; inputting the training data set into a recommendation model, and training the recommendation model based on a recommendation loss function to obtain a completely trained recommendation model; the output of the recommendation model is the predicted score of the document about the specific article or the predicted score of the text about the specific article; and inputting historical interaction data between the target user and the target article into the recommendation model to obtain predicted scores about the target article, and carrying out article recommendation based on the sorting of the predicted scores. Through the method and the device, the problem that the articles cannot be accurately recommended to the user is solved, and the articles can be accurately recommended to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an item recommendation method, device, computer equipment and storage medium. Background Art

[0002] Recommendation systems are used to predict content that users are interested in, such as products, friends, short videos, etc., and recommend content of interest to users. They are widely used in e-shopping websites, social media platforms, and video sharing websites.

[0003] In existing recommendation methods, loss functions such as pointwise loss are used to train recommendation models, and item recommendations are achieved through the trained models. However, the performance of the models trained in the above manner is poor and it is impossible to accurately recommend items to users.

[0004] There is currently no effective solution to the problem in related technologies that items cannot be accurately recommended to users. Summary of the invention

[0005] In this embodiment, a method, apparatus, computer device and storage medium for recommending an item are provided to solve the problem in the related art that items cannot be accurately recommended to users.

[0006] In a first aspect, an item recommendation method is provided in this embodiment, and the method includes:

[0007] Acquire a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0008] For the pre-established recommendation model, a recommendation loss function based on the preset Rayleigh divergence coefficient and learnable user-personalized threshold parameters is constructed;

[0009] Inputting the training data set into the recommendation model, training the recommendation model based on the recommendation loss function, and obtaining the fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data with respect to a specific item, or the predicted score of the text data with respect to a specific item;

[0010] The historical interaction data between the target user and each target item is input into the fully trained recommendation model to obtain the target user's predicted score for each target item, and items are recommended to the target user based on the ranking results of each predicted score.

[0011] In some embodiments, the method of constructing a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model includes:

[0012] Determine a set of positive sample items in the training data set that have an interactive relationship with the sample user, and a set of negative sample items that do not have an interactive relationship with the sample user;

[0013] The recommendation loss function is constructed based on the similarity between the sample user and the positive sample items in the positive sample item set, the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient, and the learnable user personalized threshold parameter.

[0014] In some embodiments, determining the similarity between the sample user and the sample item includes:

[0015] Performing mapping processing on the sample user based on a preset dimension to obtain a corresponding first embedding vector;

[0016] Performing mapping processing on the sample item based on the preset dimension to obtain a corresponding second embedding vector;

[0017] Determining the similarity between the first embedding vector and the second embedding vector.

[0018] In some embodiments, determining the learnable user-personalized threshold parameter includes:

[0019] Based on the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient and the preset first threshold parameter, the learnable user personalized threshold parameter is determined; wherein the first threshold parameter is a threshold that can be searched within the search range.

[0020] In some of the embodiments, during the training process of the recommendation model, the negative sample weight corresponding to the recommendation loss function is expressed as follows:

[0021]

[0022] Among them, w uj represents the negative sample weight; u represents the sample user; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined β u represents the learnable user personalized threshold parameter; The probability distribution of negative sample items that have no interaction relationship with the sample user; Indicates that j follows the probability distribution In the case of The mathematical expectation of+ represents max{0,·}.

[0023] In some embodiments, the training of the recommendation model based on the recommendation loss function includes:

[0024] Based on the recommendation loss function, the learnable user personalized threshold parameters and the model parameters of the recommendation model are alternately trained.

[0025] In some of the embodiments, during the training process of the recommendation model, a stochastic gradient descent optimizer is used to update the learnable user personalized threshold parameters, and an adaptive moment estimation optimizer is used to update the model parameters of the recommendation model.

[0026] In a second aspect, an item recommendation device is provided in this embodiment, the device comprising: an acquisition module, a construction module, a training module and a recommendation module;

[0027] The acquisition module is used to acquire a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0028] The construction module is used to construct a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model;

[0029] The training module is used to input the training data set into the recommendation model, train the recommendation model based on the recommendation loss function, and obtain the fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data with respect to the specific item, or the predicted score of the text data with respect to the specific item;

[0030] The recommendation module is used to input the historical interaction data between the target user and each target item into the fully trained recommendation model, obtain the target user's predicted score for each target item, and recommend items to the target user based on the ranking results of each predicted score.

[0031] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the item recommendation method described in the first aspect when executing the computer program.

[0032] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the item recommendation method described in the first aspect is implemented.

[0033] Compared with the related art, the item recommendation method, apparatus, computer device and storage medium provided in the present embodiment obtain a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item; for a pre-established recommendation model, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed; the training data set is input into the recommendation model, and the recommendation model is trained based on the recommendation loss function to obtain a fully trained recommendation model; wherein the output of the recommendation model is a predicted score of the document data about a specific item, or a predicted score of the text data about a specific item; further, the historical interaction data between the target user and each target item is input into the fully trained recommendation model to obtain the predicted score of the target user for each target item, and items are recommended to the target user based on the ranking results of each predicted score, thereby solving the problem of being unable to accurately recommend items to users and achieving accurate recommendation of items to users.

[0034] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0036] Figure 1 This is a hardware structure block diagram of a terminal device of an item recommendation method provided in an embodiment of the present application;

[0037] Figure 2 is a flow chart of an item recommendation method provided by an embodiment of the present application;

[0038] Figure 3 is a flow chart of a similarity calculation method provided by an embodiment of the present application;

[0039] Figure 4 is a flow chart of an item recommendation method provided by a preferred embodiment of the present application;

[0040] Figure 5 It is a structural block diagram of an item recommendation device provided in one embodiment of the present application.

[0041] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, acquisition module; 20, construction module; 30, training module; 40, recommendation module. DETAILED DESCRIPTION

[0042] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0043] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0044] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the item recommendation method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0045] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the item recommendation method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0046] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0047] In this embodiment, a method for recommending items is provided. Figure 2 is a flow chart of the item recommendation method of this embodiment. Figure 2 As shown, the process includes the following steps:

[0048] Step S210, obtaining a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0049] Step S220, constructing a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for the pre-established recommendation model;

[0050] Step S230, inputting the training data set into the recommendation model, training the recommendation model based on the recommendation loss function, and obtaining a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data with respect to the specific item, or the predicted score of the text data with respect to the specific item;

[0051] Step S240, input the historical interaction data between the target user and each target item into the fully trained recommendation model, obtain the target user's predicted score for each target item, and recommend items to the target user based on the ranking results of each predicted score.

[0052] In this embodiment, historical interaction data between different users and items is collected in advance from actual item recommendation scenarios. For example, on a shopping website, user behavior data such as clicks, browsing, collections, or purchase records for different items are collected; on a video website, if the items are videos of different categories, user viewing habits or interactive behaviors for videos of each category are collected.

[0053] The collected historical interaction data is sorted to obtain a training data set for collaborative filtering. The training data set can be document data or text data containing the interaction information between each sample user and each sample item. Specifically, the user set is set to The item collection is Then each sample user Each sample item Based on the collected historical interaction data, determine the set of items that have an interactive relationship with the sample user u is the set of positive sample items of sample user u, and the set of items that have no interactive relationship with sample user u is the set of negative sample items of sample user u. The interactive relationship between users and items is different in different recommendation scenarios. For example, on shopping websites, users click, browse, collect or purchase items, indicating that there is an interactive relationship between users and the items. On social media platforms, items are posts, pictures, etc. If users like, comment, share and follow items, it indicates that there is an interactive relationship between users and the items.

[0054] Furthermore, a recommendation model is pre-established, including but not limited to a matrix factorization (MF) recommendation model and a graph-based recommendation model, which can be selected according to the actual scenario. For the pre-established recommendation model, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed. Among them, the Rayleigh divergence is a divergence measure based on the Rayleigh space, which is used to measure the difference between two probability distributions. When constructing the loss function, a reasonable Rayleigh divergence coefficient is set according to different recommendation scenarios, and a learnable user personalized threshold parameter is introduced to adapt to different user preferences and better reflect the user's personalized needs and behaviors.

[0055] Afterwards, the training data set is input into the recommendation model, and the recommendation model is trained based on the constructed recommendation loss function to obtain a fully trained recommendation model. It should be noted that the output of the recommendation model is the predicted score of the document data about a specific item, or the predicted score of the text data about a specific item.

[0056] In the actual recommendation scenario, the historical interaction data between the target user and each target item is input into the well-trained recommendation model to obtain the target user's predicted score for each target item. The predicted score is used to predict the user's interest in different items and to sort the predicted scores. Based on the sorting results of each predicted score, several items with the highest ranking are selected to recommend to the target user. For example, based on the sorting results of each predicted score, the top 20 items in the predicted score ranking are selected as the final recommended items.

[0057] In existing recommendation methods, loss functions such as pointwise loss are used to train recommendation models, and item recommendations are achieved through the trained models. However, the performance of the models trained in the above manner is poor and it is impossible to accurately recommend items to users.

[0058] Compared with the prior art, the present application obtains a training data set, which is document data or text data containing the interaction information between each sample user and each sample item; for the pre-established recommendation model, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed; the training data set is input into the recommendation model, and the recommendation model is trained based on the recommendation loss function to obtain a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data on a specific item, or the predicted score of the text data on a specific item; the historical interaction data between the target user and each target item is input into the fully trained recommendation model to obtain the predicted score of the target user for each target item, and items are recommended to the target user based on the ranking results of each predicted score. Based on this, by constructing a recommendation loss function based on the Rayleigh divergence coefficient and a learnable user personalized threshold parameter, and using the recommendation loss function for model training, the prediction performance of the recommendation model is improved, so that the trained model can be used to accurately obtain the predicted score of the user for the item, solving the problem of being unable to accurately recommend items to users, and achieving accurate recommendation of items to users.

[0059] In some embodiments, step S220 constructs a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model, including the following steps:

[0060] Step S221, determining a set of positive sample items in the training data set that have an interactive relationship with the sample user, and a set of negative sample items that do not have an interactive relationship with the sample user;

[0061] Step S222, constructing a recommendation loss function based on the similarity between the sample user and the positive sample item in the positive sample item set, the similarity between the sample user and the negative sample item in the negative sample item set, the preset Rayleigh divergence coefficient, and the learnable user personalized threshold parameter.

[0062] Specifically, the historical interaction data between users and items is obtained from the training data set, and each sample user u∈user set Each sample item i∈item set Determine the set of items that have an interactive relationship with the sample user u is the set of positive sample items of sample user u, and the set of items that have no interactive relationship with sample user u is the set of negative sample items of sample user u.

[0063] Furthermore, combining the similarity between the sample user and the positive sample item in the positive sample item set, and the similarity between the sample user and the negative sample item in the negative sample item set, a recommendation loss function based on the preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed. The expression of the recommendation loss function is as follows:

[0064]

[0065] In formula (1), represents the recommendation loss function; Represents a set of positive sample items that have an interactive relationship with the sample user; represents the set of negative sample items that have no interaction relationship with the sample user; f(u,i) represents the similarity between the sample user and the positive sample item; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined β u represents a learnable user-personalized threshold parameter; (·) + represents max{0,·}.

[0066] Among them, the Rayleigh divergence is a divergence measure based on the Rayleigh space, which is used to measure the difference between two probability distributions. When constructing the loss function, the Rayleigh divergence coefficient is set according to different recommendation scenarios. By selecting a reasonable Rayleigh divergence coefficient, a better recommendation loss function can be obtained. When the Rayleigh divergence coefficient γ = 1, the recommended loss function is the Softmax loss function (SL). When the Rayleigh divergence coefficient γ = 1, the recommended loss function is the Softmax loss function (SL). * =1(γ→∞), the recommended loss function is the cosine contrastive learning (CCL) loss function. At the same time, a learnable user personalized threshold parameter is introduced to adapt to different user preferences and better reflect the user's personalized needs and behaviors.

[0067] It should be further explained that the recommendation loss function constructed in this embodiment has a higher data utilization rate in the model training process compared with the existing loss function, such as the CCL loss function, and as the Rayleigh divergence coefficient changes from large to small, the data utilization rate shows an upward trend, which helps to improve the training efficiency and model robustness of the model, thereby improving the overall performance of the model. In addition, the recommendation loss function constructed in this embodiment can be understood as an extension of the distributed robust optimization (Distributionally Robust Optimization, DRO) based on Bayesian personalized ranking (Bayesian Personalized Ranking, BPR). The recommendation loss function optimizes the worst loss under all distributions in the uncertainty set constrained by the Rayleigh divergence. The model trained based on the recommendation loss function has strong robustness.

[0068] Through this embodiment, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed. The model trained based on the recommendation loss function has high prediction accuracy and good robustness, which significantly improves the model performance and helps to achieve accurate recommendations in actual recommendation scenarios.

[0069] In some of the embodiments, Figure 3 As shown, determining the similarity between a sample user and a sample item includes the following steps:

[0070] Step S310, mapping the sample user based on a preset dimension to obtain a corresponding first embedding vector;

[0071] Step S320, mapping the sample item based on the preset dimension to obtain a corresponding second embedding vector;

[0072] Step S330: Determine the similarity between the first embedding vector and the second embedding vector.

[0073] Specifically, the recommendation model is used as the backbone network. The sample users are mapped through the backbone network to obtain the first embedding vector of the preset dimension. At the same time, for any sample item The sample items are mapped through the backbone network to obtain a second embedding vector of a preset dimension.

[0074] Further, the similarity between the first embedding vector and the second embedding vector is calculated. In this embodiment, the similarity of the embedding vector includes but is not limited to cosine similarity and Manhattan distance. It should be noted that the preset dimensions corresponding to the first embedding vector and the second embedding vector are the same, that is, the first embedding vector and the second embedding vector are embedding vectors of the same dimension, for example, both are 64-dimensional embedding vectors, to ensure the consistency of the similarity calculation.

[0075] Through this embodiment, the sample users are mapped based on the preset dimension to obtain the corresponding first embedding vector, and the sample items are mapped based on the preset dimension to obtain the corresponding second embedding vector, and the similarity between the first embedding vector and the second embedding vector is determined, so as to obtain accurate similarity information, which is helpful for the training of the recommendation model.

[0076] In some embodiments, determining a learnable user-personalized threshold parameter comprises the following steps:

[0077] Based on the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient and the preset first threshold parameter, a learnable user personalized threshold parameter is determined; wherein the first threshold parameter is a threshold that can be searched within the search range.

[0078] In this embodiment, taking into account the differences in preferences of different users, learnable user personalized threshold parameters are introduced. During the recommendation model training process, the user personalized threshold parameters are trained synchronously, so that the personalized threshold parameters can be dynamically adjusted according to user behavior data to adapt to different user preferences and better reflect the user's personalized needs and behaviors.

[0079] Specifically, based on the similarity between the sample user and the negative sample item in the negative sample item set, the preset Rayleigh divergence coefficient, and the preset first threshold parameter, the expression for determining the learnable user personalized threshold parameter is as follows:

[0080]

[0081] In formula (2), β u represents a learnable user personalized threshold parameter; represents the set of negative sample items that have no interactive relationship with the sample user; β represents the threshold that can be searched within the search range, that is, the first threshold parameter; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined

[0082] Through this embodiment, a learnable user personalized threshold parameter is introduced into the recommendation loss function to adapt to different user preferences, so that the trained recommendation model can better reflect the user's personalized needs and behaviors, and improve the personalized recommendation performance and flexibility of the model.

[0083] In some of the embodiments, during the training process of the recommendation model, the negative sample weight corresponding to the recommendation loss function is expressed as follows:

[0084]

[0085] Among them, w uj represents the negative sample weight; u represents the sample user; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined β u represents a learnable user personalized threshold parameter; The probability distribution of negative sample items that have no interaction relationship with the sample user; Indicates that j follows the probability distribution In the case of The mathematical expectation of + represents max{0,·}.

[0086] In this embodiment, the recommendation loss function is constructed based on the preset Rayleigh divergence coefficient and the learnable user personalized threshold parameter. The preset Rayleigh divergence coefficient is used to provide a flexible polynomial to weight the negative samples, thereby providing a more gentle negative sample weighting mechanism. Compared with existing loss functions such as the Softmax loss function, it can effectively prevent the occurrence of an explosion of the negative sample weight exponent.

[0087] Specifically, the expression of the negative sample weight corresponding to the recommendation loss function is as follows:

[0088]

[0089] In formula (3), w uj represents the negative sample weight; β u represents a learnable user personalized threshold parameter; Represents a set of negative sample items that have no interaction relationship with the sample user; The probability distribution of negative sample items that have no interaction relationship with the sample user; Indicates that j follows the probability distribution In the case of The mathematical expectation value of ; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined (·) + represents max{0,·}.

[0090] Through this embodiment, a flexible polynomial is provided to weight negative samples by using the preset Rayleigh divergence coefficient, thereby effectively preventing the negative sample weight exponential explosion during the model training process, and improving the model's robustness to noise, especially for the false negative noise that is widely present in recommendation scenarios, that is, it has good noise resistance.

[0091] In some embodiments, the step S230 of training the recommendation model based on the recommendation loss function includes the following steps:

[0092] Based on the recommendation loss function, the learnable user personalization threshold parameters and the model parameters of the recommendation model are alternately trained.

[0093] Specifically, during the training process of the recommendation model, the recommendation loss function and the training data set are used to alternately update the learnable user personalized threshold parameters and the model parameters of the recommendation model to obtain optimized user personalized threshold parameters and model parameters.

[0094] It should be noted that the above-mentioned alternating update method enables each set of parameters to be optimized for the current model state each time it is updated. At the same time, alternating updates can reduce interference between different parameters, which helps to improve the convergence speed and performance of the model. In addition, in addition to the above-mentioned alternating update method, parameter update methods such as synchronous update and incremental update can also be selected according to the actual training environment. This embodiment does not limit the specific parameter update method.

[0095] Through this embodiment, based on the recommendation loss function, learnable user personalized threshold parameters and model parameters of the recommendation model are alternately trained, and a fine-grained personalized threshold learning strategy is provided to effectively improve the training and reasoning efficiency of the model.

[0096] In some of the embodiments, during the training process of the recommendation model, a stochastic gradient descent optimizer is used to update the learnable user personalized threshold parameters, and an adaptive moment estimation optimizer is used to update the model parameters of the recommendation model.

[0097] Specifically, the recommendation loss function and the training data set are used to train the recommendation model. During the training process, the Stochastic Gradient Descent (SDG) optimizer is used to update the learnable user personalized threshold parameters, and the Adaptive Moment Estimation (Adam) optimizer is used to update the model parameters of the recommendation model.

[0098] It should be noted that in addition to using the above-mentioned optimizer, when updating the learnable user personalized threshold parameters or the model parameters of the recommendation model, an adaptive learning rate optimization algorithm such as Root Mean Square Propagation and an adaptive gradient algorithm such as Adaptive Gradient Algorithm may also be used. This embodiment does not specifically limit the optimizer used to update the parameters.

[0099] Through this embodiment, during the training process of the recommendation model, a stochastic gradient descent optimizer is used to update the learnable user personalized threshold parameters, and an adaptive moment estimation optimizer is used to update the model parameters of the recommendation model, wherein the stochastic gradient descent optimizer has good convergence when optimizing on large-scale data, while the adaptive moment estimation optimizer helps to improve the training efficiency of the model and enhance the robustness of the model.

[0100] The present embodiment is described and illustrated below through preferred embodiments.

[0101] Figure 4 is a flow chart of the item recommendation method of this preferred embodiment. Figure 4 As shown, the item recommendation method includes the following steps:

[0102] Step S410, obtaining a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0103] Step S420, constructing a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for the pre-established recommendation model;

[0104] Step S430, inputting the training data set into the recommendation model, and alternately training the learnable user personalized threshold parameters and the model parameters of the recommendation model based on the recommendation loss function to obtain a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data on the specific item, or the predicted score of the text data on the specific item;

[0105] Step S440, inputting the historical interaction data between the target user and each target item into the fully trained recommendation model, obtaining the target user's predicted score for each target item, and recommending items to the target user based on the ranking results of each predicted score.

[0106] Through this embodiment, a training data set is obtained, and the training data set is document data or text data containing the interaction information between each sample user and each sample item. For a pre-established recommendation model, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed. The training data set is input into the recommendation model, and based on the recommendation loss function, the learnable user personalized threshold parameter and the model parameters of the recommendation model are alternately trained to obtain a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data on a specific item, or the predicted score of the text data on a specific item.

[0107] Furthermore, the historical interaction data between the target user and each target item is input into a fully trained recommendation model to obtain the target user's predicted score for each target item, and items are recommended to the target user based on the ranking results of each predicted score, which solves the problem of being unable to accurately recommend items to users and achieves accurate recommendation of items to users.

[0108] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0109] In this embodiment, an item recommendation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.

[0110] Figure 5 is a structural block diagram of the item recommendation device of this embodiment. Figure 5 As shown, the device comprises:

[0111] In a second aspect, an item recommendation device is provided in this embodiment, the device comprising: an acquisition module 10, a construction module 20, a training module 30 and a recommendation module 40;

[0112] The acquisition module 10 is used to acquire a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0113] A construction module 20 is used to construct a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model;

[0114] The training module 30 is used to input the training data set into the recommendation model, train the recommendation model based on the recommendation loss function, and obtain a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data about the specific item, or the predicted score of the text data about the specific item;

[0115] The recommendation module 40 is used to input the historical interaction data between the target user and each target item into a well-trained recommendation model, obtain the target user's predicted score for each target item, and recommend items to the target user based on the ranking results of each predicted score.

[0116] Through the device provided in this embodiment, a training data set is obtained, and the training data set is document data or text data containing interaction information between each sample user and each sample item; for a pre-established recommendation model, a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter is constructed; the training data set is input into the recommendation model, and the recommendation model is trained based on the recommendation loss function to obtain a fully trained recommendation model; wherein the output of the recommendation model is a predicted score of the document data regarding a specific item, or a predicted score of the text data regarding a specific item; further, the historical interaction data between the target user and each target item is input into the fully trained recommendation model to obtain the predicted score of the target user for each target item, and items are recommended to the target user based on the ranking results of each predicted score, thereby solving the problem of being unable to accurately recommend items to users and achieving accurate recommendations of items to users.

[0117] In some of the embodiments, the construction module 20 is also used to determine a set of positive sample items that have an interactive relationship with the sample user, and a set of negative sample items that do not have an interactive relationship with the sample user in the training data set; based on the similarity between the sample user and the positive sample items in the positive sample item set, the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient, and the learnable user personalized threshold parameter, a recommendation loss function is constructed.

[0118] In some of the embodiments, the training module 30 is further used to map the sample users based on a preset dimension to obtain a corresponding first embedding vector; map the sample items based on a preset dimension to obtain a corresponding second embedding vector; and determine the similarity between the first embedding vector and the second embedding vector.

[0119] In some of the embodiments, the construction module 20 is also used to determine a learnable user personalized threshold parameter based on the similarity between the sample user and the negative sample item in the negative sample item set, a preset Rayleigh divergence coefficient, and a preset first threshold parameter; wherein the first threshold parameter is a threshold that can be searched within the search range.

[0120] In some of the embodiments, the training module 30 is further used to alternately train learnable user personalized threshold parameters and model parameters of the recommendation model based on the recommendation loss function.

[0121] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0122] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0123] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0124] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0125] S1, obtaining a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item;

[0126] S2, for the pre-established recommendation model, construct a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter;

[0127] S3, inputting the training data set into the recommendation model, training the recommendation model based on the recommendation loss function, and obtaining a fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data about the specific item, or the predicted score of the text data about the specific item;

[0128] S4, inputting the historical interaction data between the target user and each target item into the fully trained recommendation model, obtaining the target user's predicted score for each target item, and recommending items to the target user based on the ranking results of each predicted score.

[0129] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0130] In addition, in combination with the item recommendation method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any item recommendation method in the above embodiments is implemented.

[0131] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0132] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0133] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0134] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. An item recommendation method, characterized in that: The method comprises: Acquire a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item; For the pre-established recommendation model, a recommendation loss function based on the preset Rayleigh divergence coefficient and learnable user-personalized threshold parameters is constructed; Inputting the training data set into the recommendation model, training the recommendation model based on the recommendation loss function, and obtaining the fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data with respect to a specific item, or the predicted score of the text data with respect to a specific item; The historical interaction data between the target user and each target item is input into the fully trained recommendation model to obtain the target user's predicted score for each target item, and items are recommended to the target user based on the ranking results of each predicted score.

2. The item recommendation method according to claim 1, characterized in that: The method of constructing a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model includes: Determine a set of positive sample items in the training data set that have an interactive relationship with the sample user, and a set of negative sample items that do not have an interactive relationship with the sample user; The recommendation loss function is constructed based on the similarity between the sample user and the positive sample items in the positive sample item set, the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient, and the learnable user personalized threshold parameter.

3. The item recommendation method according to claim 2, characterized in that: Determining the similarity between the sample user and the sample item includes: Performing mapping processing on the sample user based on a preset dimension to obtain a corresponding first embedding vector; Performing mapping processing on the sample item based on the preset dimension to obtain a corresponding second embedding vector; Determining the similarity between the first embedding vector and the second embedding vector.

4. The item recommendation method according to claim 2, characterized in that: Determining the learnable user personalized threshold parameter includes: Based on the similarity between the sample user and the negative sample items in the negative sample item set, the preset Rayleigh divergence coefficient and the preset first threshold parameter, the learnable user personalized threshold parameter is determined; wherein the first threshold parameter is a threshold that can be searched within the search range.

5. The item recommendation method according to claim 2, characterized in that: During the training process of the recommendation model, the expression of the negative sample weight corresponding to the recommendation loss function is as follows: Among them, w uj represents the negative sample weight; u represents the sample user; f(u,j) represents the similarity between the sample user and the negative sample item; γ represents the preset Rayleigh divergence coefficient, which is predefined β u represents the learnable user personalized threshold parameter; The probability distribution of negative sample items that have no interaction relationship with the sample user; Indicates that j follows the probability distribution In the case of The mathematical expectation of + represents max{0,·}.

6. The item recommendation method according to claim 1, characterized in that: The training of the recommendation model based on the recommendation loss function includes: Based on the recommendation loss function, the learnable user personalized threshold parameters and the model parameters of the recommendation model are alternately trained.

7. The item recommendation method according to claim 1, characterized in that: During the training process of the recommendation model, a stochastic gradient descent optimizer is used to update the learnable user personalized threshold parameters, and an adaptive moment estimation optimizer is used to update the model parameters of the recommendation model.

8. An item recommendation device, characterized in that: The device comprises: an acquisition module, a construction module, a training module and a recommendation module; The acquisition module is used to acquire a training data set; the training data set is document data or text data containing interaction information between each sample user and each sample item; The construction module is used to construct a recommendation loss function based on a preset Rayleigh divergence coefficient and a learnable user personalized threshold parameter for a pre-established recommendation model; The training module is used to input the training data set into the recommendation model, train the recommendation model based on the recommendation loss function, and obtain the fully trained recommendation model; wherein the output of the recommendation model is the predicted score of the document data with respect to the specific item, or the predicted score of the text data with respect to the specific item; The recommendation module is used to input the historical interaction data between the target user and each target item into the fully trained recommendation model, obtain the target user's predicted score for each target item, and recommend items to the target user based on the ranking results of each predicted score.

9. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the item recommendation method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the item recommendation method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Recommendation method, device and equipment

    CN121233855A