Recommendation model training method, recommendation method and device, electronic device and medium
By acquiring and processing user rating data, generating scoring probability distribution data, and building and enhancing perturbation graphs, training neural network models is solved, and the problem of poor model prediction effect in existing recommendation methods is improved, and the accuracy of recommendation is improved.
Patent Information
- Application Number
- CN202210908823.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-07-29
AI Technical Summary
The neural network model of the existing recommended method has poor prediction effect when the types and number of training samples are limited, which affects the accuracy of recommendation.
By obtaining the target recommendation data and the original user data of the target user, filtering and processing the user score data, generating the scoring probability distribution data, building the initial perturbation graph and performing enhancement processing, and finally training the preset neural network model to obtain the recommended model.
It improves the prediction effect of the model, improves the accuracy of recommendations, and enables the neural network model to learn user ratings more evenly, reduces data bias, and improves data stability.
Smart Images

Figure CN115269779B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method for a recommendation model, a recommendation method and device, an electronic device, and a medium. Background Art
[0002] The neural network models that current recommendation methods rely on when making recommendations are limited by the types and quantities of training samples. Models trained based on limited labeled sample data often recommend objects based on the current popularity of the objects to be recommended. The model's prediction effect is poor, affecting the accuracy of the recommendation. Therefore, how to improve the model's prediction effect has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a training method for a recommendation model, a recommendation method and device, an electronic device and a medium, aiming to improve the prediction effect of the model and enhance the accuracy of recommendations.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a training method for a recommendation model, the method comprising:
[0005] Acquire target recommendation data and original user data of a target user, wherein the original user data includes basic user data and first user rating data;
[0006] Screening the first user rating data to obtain second user rating data corresponding to the target recommendation data;
[0007] Performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data;
[0008] Constructing an initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data;
[0009] Performing enhancement processing on the initial perturbation map according to the scoring probability distribution data to obtain a first perturbation map and a second perturbation map;
[0010] A preset neural network model is trained according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model.
[0011] In some embodiments, the step of performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data includes:
[0012] Calculate the mean of the second user rating data to obtain a rating mean;
[0013] Calculate the difference between the average score and the second user score data to obtain a target score;
[0014] The Gaussian distribution calculation is performed on the score mean and the target score by using a Gaussian distribution generation method and a preset normalization factor to obtain the score probability distribution data.
[0015] In some embodiments, the step of performing enhancement processing on the initial perturbation map according to the scoring probability distribution data to obtain the first perturbation map and the second perturbation map includes:
[0016] Performing strength calculation on the initial perturbation graph by using a preset function to obtain edge strength of the initial perturbation graph;
[0017] Performing data replacement on the edge strength using the score probability distribution data to obtain an edge probability value;
[0018] The initial perturbation graph is split according to the edge probability values to obtain the first perturbation graph and the second perturbation graph.
[0019] In some embodiments, the step of training a preset neural network model according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model includes:
[0020] Encoding the initial perturbation graph to obtain an initial graph representation vector, encoding the first perturbation graph to obtain a first graph representation vector, and encoding the second perturbation graph to obtain a second graph representation vector;
[0021] Performing loss calculation on the initial graph representation vector using a preset first loss function to obtain a recommended loss value;
[0022] Performing comparative learning on the first image representation vector and the second image representation vector by using a preset second loss function to obtain a comparative loss value;
[0023] Parameters of the neural network model are optimized according to the contrast loss value and the recommendation loss value to train the neural network model and obtain the recommendation model.
[0024] In some embodiments, the step of optimizing parameters of the neural network model according to the contrast loss value and the recommendation loss value to train the neural network model and obtain the recommendation model includes:
[0025] Performing weighted calculation on the comparison loss value and the recommended loss value according to a preset weight parameter to obtain a target loss value;
[0026] The loss function of the neural network model is parameter optimized by using the stochastic gradient descent method and the target loss value to train the neural network model and obtain the recommendation model.
[0027] To achieve the above object, a second aspect of the embodiments of the present application proposes a recommendation method, which includes:
[0028] Obtain target user data of target users;
[0029] Inputting the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained according to the training method described in the first aspect;
[0030] The recommendation list is pushed to the target user.
[0031] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a training device for a recommendation model, the training device comprising:
[0032] A first acquisition module, used to acquire target recommendation data and original user data of a target user, wherein the original user data includes basic user data and first user rating data;
[0033] A screening module, used for screening the first user rating data to obtain second user rating data corresponding to the target recommendation data;
[0034] A probability distribution generation module, used for performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data;
[0035] A graph construction module, used to construct an initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data;
[0036] An enhancement module, configured to enhance the initial perturbation map according to the scoring probability distribution data to obtain a first perturbation map and a second perturbation map;
[0037] A training module is used to train a preset neural network model according to the initial perturbation graph, the first perturbation graph and the second perturbation graph to obtain a recommended model.
[0038] To achieve the above-mentioned purpose, a fourth aspect of the embodiments of the present application proposes a recommendation device, the device comprising:
[0039] A second data acquisition module is used to acquire target user data of a target user;
[0040] a prediction module, used for inputting the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained according to the training device described in the third aspect;
[0041] The recommendation module is used to push the recommendation list to the target user.
[0042] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the method described in the first aspect or the method described in the second aspect is realized.
[0043] To achieve the above-mentioned purpose, the sixth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the first aspect or the method described in the second aspect above.
[0044] The training method, recommendation method and device, electronic device and medium of the recommendation model proposed in the present application obtain the target recommendation data and the original user data of the target user, wherein the original user data includes the basic user data and the first user rating data, thereby filtering and processing the first user rating data to obtain the second user rating data corresponding to the target recommendation data, so that the target user's rating of the target recommendation data can be determined more conveniently. Furthermore, the second user rating data is subjected to Gaussian distribution generation processing to obtain the rating probability distribution data, and in this way, the second user rating data can be effectively converted from a numerical form to a probability distribution form, reducing data deviation and improving data stability. Furthermore, an initial perturbation graph is constructed according to user basic data, target recommendation data, and second user rating data; and the initial perturbation graph is enhanced according to the rating probability distribution data to obtain a first perturbation graph and a second perturbation graph, so that a preset neural network model is trained according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model. This method can better integrate user ratings into model training, so that the neural network model can learn the graph node representation information of the initial perturbation graph, the first perturbation graph, and the second perturbation graph in a more balanced manner, thereby effectively improving the prediction effect of the model and improving the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of a training method for a recommendation model provided in an embodiment of the present application;
[0046] Figure 2 yes Figure 1 Flow chart of step S103 in FIG.
[0047] Figure 3 yes Figure 1 Flow chart of step S105 in FIG.
[0048] Figure 4 yes Figure 1 Flow chart of step S106 in FIG.
[0049] Figure 5 yes Figure 4 Flow chart of step S404 in FIG.
[0050] Figure 6 is a flowchart of a recommended method provided in an embodiment of the present application;
[0051] Figure 7 It is a structural schematic diagram of a training device for a recommendation model provided in an embodiment of the present application;
[0052] Figure 8 is a schematic diagram of the structure of a recommended device provided in an embodiment of the present application;
[0053] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] First, some nouns involved in this application are analyzed:
[0058] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0059] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0060] Information Extraction: A text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.
[0061] Normal distribution: Also known as "normal distribution", also known as Gaussian distribution. The normal curve is bell-shaped, low at both ends, high in the middle, and symmetrical on both sides. Because its curve is bell-shaped, people often call it a bell curve. If the random variable X obeys a normal distribution with a mathematical expectation of μ and a variance of σ2, it is recorded as N(μ, σ2). Its probability density function is the expected value μ of the normal distribution, which determines its position, and its standard deviation σ determines the amplitude of the distribution. When μ=0,σ=1, the normal distribution is the standard normal distribution.
[0062] Encoder: Converts the input sequence into a vector of fixed length.
[0063] Data enhancement: Data enhancement is mainly used to prevent overfitting and to optimize datasets when they are small. Through data enhancement, the amount of training data can be increased, the generalization ability of the model can be improved, and noise data can be added to improve the robustness of the model. Data enhancement can be divided into two categories, offline enhancement and online enhancement. Offline enhancement directly processes the dataset, and the number of data becomes the enhancement factor x the number of original datasets. Offline enhancement is often used when the dataset is very small. Online enhancement is mainly used to enhance the batch data after obtaining the batch data, such as rotation, translation, folding and other corresponding changes. Since some datasets cannot accept linear growth, online enhancement is often used for larger datasets. Many machine learning frameworks already support online enhancement methods and can use GPU to optimize calculations.
[0064] Contrastive Learning is a type of self-supervised learning that does not rely on manually annotated category label information, but directly uses the data itself as supervision information. Contrastive learning is a method for describing similar and different things for deep learning models. Using contrastive learning methods, machine learning models can be trained to distinguish similar and different images. Self-supervised learning in the image field is divided into two types: generative self-supervised learning and discriminative self-supervised learning. Contrastive learning uses typical discriminative self-supervised learning. The core point of contrastive learning is: by automatically constructing similar instances and dissimilar instances, that is, positive samples and negative samples, learning to compare positive samples and negative samples in the feature space, so that similar instances are closer in the feature space, while dissimilar instances are farther apart in the feature space, and the difference becomes larger. The model representation obtained through such a learning process can be used to perform downstream tasks and fine-tuned on a smaller labeled data set, thereby realizing an unsupervised model learning process. The guiding principle of contrastive learning is to automatically construct similar and dissimilar instances, obtain a learning model through learning, and use this model to make similar instances closer in the projection space, while dissimilar instances are farther away in the projection space.
[0065] Stochastic Gradient Descent (SGD): Stochastic gradient descent is to randomly extract a group from the samples, update it once according to the gradient after training, then extract another group and update it again. In the case of a large number of samples, it may not be necessary to train all the samples to obtain a model with a loss value within an acceptable range. Stochastic gradient descent is a simple but very effective method, which is mostly used for learning linear classifiers under loss functions such as support vector machines and logistic regression. And stochastic gradient descent has been successfully applied to large-scale and sparse machine learning problems often encountered in text classification and natural language processing. Stochastic gradient descent can be used for both classification calculations and regression calculations.
[0066] The neural network models that current recommendation methods rely on when making recommendations are limited by the types and number of training samples. Models trained based on limited labeled sample data often recommend objects based on the current popularity of the objects to be recommended, resulting in poor prediction results for the model and affecting the accuracy of the recommendations. Therefore, how to improve the prediction results of the model has become a technical problem that needs to be solved urgently.
[0067] Based on this, the embodiments of the present application provide a training method for a recommendation model, a recommendation method and device, an electronic device and a medium, aiming to improve the prediction effect of the model and enhance the accuracy of recommendations.
[0068] The training method of the recommendation model, the recommendation method and device, the electronic device and the medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the training method of the recommendation model in the embodiments of the present application is described.
[0069] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0070] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0071] The training method of the recommendation model provided in the embodiment of the present application relates to the field of artificial intelligence technology. The training method of the recommendation model provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the training method of the recommendation model, etc., but is not limited to the above forms.
[0072] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0073] Figure 1 is an optional flowchart of the training method of the recommendation model provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0074] Step S101, obtaining target recommendation data and original user data of a target user, where the original user data includes basic user data and first user rating data;
[0075] Step S102, screening the first user rating data to obtain second user rating data corresponding to the target recommendation data;
[0076] Step S103, performing Gaussian distribution generation processing on the second user's rating data to obtain rating probability distribution data;
[0077] Step S104, constructing an initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data;
[0078] Step S105, performing enhancement processing on the initial disturbance map according to the scoring probability distribution data to obtain a first disturbance map and a second disturbance map;
[0079] Step S106, training a preset neural network model according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommended model.
[0080] Steps S101 to S106 shown in the embodiment of the present application obtain the target recommendation data and the original user data of the target user, wherein the original user data includes the basic user data and the first user rating data, thereby filtering the first user rating data to obtain the second user rating data corresponding to the target recommendation data, so that the target user's rating of the target recommendation data can be determined more conveniently. Further, the second user rating data is subjected to Gaussian distribution generation processing to obtain the rating probability distribution data, which can effectively convert the second user rating data from a numerical form to a probability distribution form, reduce data deviation, and improve data stability. Furthermore, an initial perturbation graph is constructed according to user basic data, target recommendation data, and second user rating data; and the initial perturbation graph is enhanced according to the rating probability distribution data to obtain a first perturbation graph and a second perturbation graph, so that a preset neural network model is trained according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model. This method can better integrate user ratings into model training, so that the neural network model can learn the graph node representation information of the initial perturbation graph, the first perturbation graph, and the second perturbation graph in a more balanced manner, thereby effectively improving the prediction effect of the model and improving the accuracy of recommendations.
[0081] In step S101 of some embodiments, a web crawler can be written, and after the data source is set, the data source can be crawled in a targeted manner to obtain the target recommendation data and the original user data of the target user. The target recommendation data and the original user data can also be obtained by other means, not limited to this, wherein the data source can be a network platform, software program or database on a client such as a mobile phone, tablet or computer terminal, etc., and the target object can be a social group of various industries and age groups, etc., without limitation. The original user data includes the historical behavior data and basic user data of the target user. The historical behavior data includes the historical click-through rate, historical browsing time, and first user rating data of some recommended data of the target user. The basic user data includes the basic data such as the user's name, gender, age, and occupation. The target recommendation data includes the text content to be recommended, news information, notices, popular science knowledge, etc.
[0082] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0083] In step S102 of some embodiments, the recommended keywords of the target recommended data are first extracted by Jieba word segmenter or TF-IF algorithm to obtain the recommended keywords of each target recommended data, and then the first user rating data is traversed according to the recommended keywords, and the first user rating data is text matched with the recommended keywords, and the rating data containing the recommended keywords in the first user rating data is filtered to obtain the second user rating data.
[0084] Since current recommendation models are often trained directly using dataset labels, and the semantic representation information of dataset labels is often not applicable to different degrees of user preferences, this will lead to large deviations in the scoring of target recommendation data. In this regard, the embodiments of the present application introduce label distribution learning to enable the neural network model to learn the label distribution of each sample data. By converting deterministic scoring data into scoring probabilities in probability space, the annotation deviation of user ratings can be reduced to a greater extent.
[0085] See also Figure 2 In some embodiments, step S103 may include but is not limited to steps S201 to S203:
[0086] Step S201, calculating the mean of the second user's rating data to obtain a rating mean;
[0087] Step S202, performing a difference calculation on the score mean and the second user's score data to obtain a target score;
[0088] Step S203, performing Gaussian distribution calculation on the score mean and target score by using Gaussian distribution generation method and preset normalization factor to obtain score probability distribution data.
[0089] In step S201 of some embodiments, since different target users have different score segments and scoring habits when scoring target recommendation data, for example, some target users tend to give high scores to all target recommendation data, while some target users tend to give high scores to fewer target recommendation data, it is necessary to screen the second scoring data of the target recommendation data, that is, first sum up the second scoring data of all target users and then average them to obtain the average score. For example, if a target user scores target recommendation data A, B, and C as 4, 3, and 1 respectively, the average score is (4+3+1) / 3=3.
[0090] In step S202 of some embodiments, a difference calculation is performed between the average score and the second user score data, and the average score of each target user is subtracted from the second user data of the target user to obtain a target score, which is used as a score label.
[0091] In step S203 of some embodiments, by using the Gaussian distribution generation method, assuming that the rating of a target user to a target recommendation data (such as a certain item) obeys the Gaussian distribution, a Gaussian distribution centered on the real rating label can be constructed by applying prior knowledge, that is, the target user u and the target recommendation data i constitute a sample d u,i , where each sample includes a label containing a user id (user id) and a target recommended data id (item id). The Gaussian distribution generation method and the preset normalization factor are used to calculate the Gaussian distribution of the corresponding score mean and target score. The process can be expressed as shown in formula (1):
[0092]
[0093] Among them, k is the scoring label (i.e., the target score), t u,i is the real rating of the target user u for the target recommended data i (i.e., the second rating data), is the average score of target user u for all target recommendation data that have generated interactions, σ u t u,i The standard deviation of u,i In order to make The normalization constant of can be preset. Through the above method, the score label originally with a fixed value can be converted into a set of normalized probability distributions generated by Gaussian distribution, which is the score probability distribution data.
[0094] For example, through the above steps S201 to S203, the probability distribution of the rating label of a target user can be expressed as: the probability of the rating label being 0 is q0, the probability of the rating label being 1 is q1, the probability of the rating label being 2 is q2, the probability of the rating label being 3 is q3, and the probability of the rating label being 4 is q4.
[0095] It should be noted that the embodiment of the present application takes explicit feedback labels as an example, and the value range of each rating label label is an integer between 0 and x. That is, the rating value of each target recommendation data in the second rating data is an integer between 0 and x, and x can be an integer greater than zero, for example, x=4.
[0096] Through the above steps S201 to S203, the rating data affected by the differences in rating habits of different target users can be converted into label distribution data, thereby reducing the impact of the absoluteness of the rating on model training, making the rating of the target recommendation data more reasonable and improving data stability.
[0097] In step S104 of some embodiments, when constructing the initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data, if the value range of the second rating data is 0 to M, M is an integer greater than zero, and the average rating of a target user for the target recommendation data is A, then the sample data with a score above A-1 is considered to meet the requirements, and the user basic data (such as user id) and the target recommendation data (such as item id) of the target user are node-ized to generate user nodes and target recommendation data nodes, then the edges between the target recommendation data nodes that meet the requirements and the user nodes are established, thereby constructing the edge relationship between all target recommendation data nodes that meet the requirements and the user nodes, and obtaining the initial perturbation graph.
[0098] See also Figure 3 In some embodiments, step S105 may include but is not limited to steps S301 to S303:
[0099] Step S301, performing strength calculation on the initial disturbance graph by using a preset function to obtain the edge strength of the initial disturbance graph;
[0100] Step S302, performing data replacement on edge strength using scoring probability distribution data to obtain edge probability values;
[0101] Step S303: split the initial perturbation graph according to the edge probability values to obtain a first perturbation graph and a second perturbation graph.
[0102] In step S301 of some embodiments, the preset function may be a softmax function with temperature, and the strength of the initial perturbation graph is calculated by the softmax function and a preset calculation formula to obtain the reliability of each edge of the initial perturbation graph, that is, the edge strength, wherein the calculation formula may be expressed as follows:
[0103]
[0104] Among them, M is the maximum value that the second rating data can take, M is an integer greater than zero, A is the mean rating of the target user, is the probability value of the rating label being 0, j is the target recommendation data, and T is the preset temperature parameter.
[0105] In step S302 of some embodiments, by replacing the edge strength with the scoring probability distribution data, the value of the edge strength of each edge is replaced with the value of the scoring probability distribution data, and the strength of each edge of the initial perturbation graph is characterized by the edge probability value. For example, if the edge strength between node P and node Q in an initial perturbation graph is 1, and the scoring probability value of this edge is 0.76, then the edge probability value of the edge is 0.76, and the value "1" in the initial perturbation graph is replaced with "0.76".
[0106] In step S303 of some embodiments, the initial perturbation graph is split into pairs of perturbation graphs for comparative learning according to the edge probability value, and each pair of perturbation graphs includes a first perturbation graph and a second perturbation graph, wherein both the first perturbation graph and the second perturbation graph may have missing edges compared with the initial perturbation graph, and the missing edges may be determined according to the edge probability value and the size of a preset threshold or a preset selection adjustment without limitation. It should be noted that the edges missing in the first perturbation graph need to be retained in the second perturbation graph, and similarly, the edges missing in the second perturbation graph need to be retained in the first perturbation graph. In this way, semantic deviation caused by completely random edge perturbations can be prevented, thereby making the model training have better stability.
[0107] In the above steps S301 to S303, the edge strength is adjusted through the scoring probability distribution data, the idea of label distribution learning is introduced, and the reliability information of the target user's scoring of the target recommendation "Rooster" (i.e., the scoring probability distribution data) is incorporated into the data enhancement process. The differences between different edges are taken into account, which can effectively avoid the phenomenon of key node loss or semantic deviation in the perturbation graph generated according to a fixed probability or random walk in the traditional technology, and can better improve the stability and accuracy of the perturbation graph.
[0108] See also Figure 4 In some embodiments, step S106 may include but is not limited to steps S401 to S404:
[0109] Step S401, encoding the initial perturbation graph to obtain an initial graph representation vector, encoding the first perturbation graph to obtain a first graph representation vector, and encoding the second perturbation graph to obtain a second graph representation vector;
[0110] Step S402, performing loss calculation on the initial graph representation vector using a preset first loss function to obtain a recommended loss value;
[0111] Step S403, performing comparative learning on the first image representation vector and the second image representation vector using a preset second loss function to obtain a comparative loss value;
[0112] Step S404, optimizing the parameters of the neural network model according to the comparison loss value and the recommendation loss value to train the neural network model and obtain a recommendation model.
[0113] In step S401 of some embodiments, the initial perturbation graph is encoded by a preset graph encoder to capture graph representation information of the initial perturbation graph and obtain an initial graph representation vector. Similarly, the first perturbation graph is encoded by a graph encoder to capture graph representation information of the first perturbation graph and obtain a first graph representation vector, and the second perturbation graph is encoded by a graph encoder to capture graph representation information of the second perturbation graph and obtain a second graph representation vector, wherein the graph encoder may be a BERT encoder or the like without limitation.
[0114] In step S402 of some embodiments, the preset first loss function may be selected as a BER function, and the process of calculating the loss of the initial graph representation vector using the BER function may be expressed as shown in formula (2).
[0115]
[0116] In the above formula (2), e u 、e i 、e j It can represent a set of triplets on a certain graph node of the initial perturbation graph, namely, the initial graph representation vector of user name-target recommendation data a-target recommendation data b, (u, i, j), where the target recommendation data can be commodities, items, news information, etc.
[0117] In step S403 of some embodiments, the preset second loss function is an InfoNCE function. The process of performing comparative learning on the first image representation vector and the second image representation vector by using the InfoNCE function can be expressed as shown in formula (3).
[0118]
[0119] In the above formula (3), i and j are the target recommendation data corresponding to the first image representation vector z1 and the second image representation vector z2 from the same sampling batch B, respectively. is the transpose of the first graph representation vector z1, and τ is the temperature hyperparameter, which is a pre-set constant. Through the above process, the distance between the representations of different enhanced samples of the same node can be reduced, while the distance between the perturbation sample representations of different nodes can be increased, so that the node representation learned by the model is more unified, that is, the nodes that are not related are far away from each other in the high-dimensional space representation, thereby effectively avoiding the target recommendation data of the same type from being too concentrated in the high-dimensional representation space, which can better solve the problem of data imbalance and improve the training effect of the model.
[0120] In step S404 of some embodiments, the comparison loss value and the recommended loss value are weighted according to a preset weight parameter to obtain a target loss value, wherein the preset weight parameter can be set according to actual business needs. Further, the target loss value is fed back to the neural network model by stochastic gradient descent or back propagation, and the loss function of the neural network model is parameter optimized to train the neural network model and obtain a recommended model.
[0121] The above steps S401 to S404 can better integrate user ratings into model training, so that the neural network model can learn the graph node representation information of the initial perturbation graph, the first perturbation graph and the second perturbation graph in a more balanced manner, effectively avoiding the target recommendation data of the same type from being too concentrated in the high-dimensional representation space, and can better prevent popularity deviation. At the same time, the loss values of graph contrast learning and recommendation prediction are integrated during model training, which can effectively improve the prediction effect of the model and improve the accuracy of recommendations.
[0122] It should be explained that the popularity bias in the embodiment of the present application is a fairness issue for items, which is reflected in that unpopular items have fewer opportunities to be recommended (displayed). Accordingly, the recommendation system prefers to recommend popular items. Over time, popular items become more and more popular, while unpopular items become less and less popular. This is the Matthew effect in the recommendation system. If all items are divided into three groups: unpopular items (the bottom 80% in terms of interaction number), popular items (the top 5% in terms of interaction number), and ordinary items (the middle number of interactions), if there is an obvious clustering phenomenon in the representation space, the model parameters will be biased towards popular items in the future. If the representation vectors of the three items are distributed more evenly, the model will recommend more items that the target user is more interested in while recommending popular items.
[0123] See also Figure 5In some embodiments, step S404 may include but is not limited to steps S501 to S502:
[0124] Step S501, performing weighted calculation on the comparison loss value and the recommended loss value according to a preset weight parameter to obtain a target loss value;
[0125] Step S502, optimizing the parameters of the loss function of the neural network model by using the stochastic gradient descent method and the target loss value to train the neural network model and obtain a recommendation model.
[0126] In step S501 of some embodiments, the preset weight parameters can be set according to actual business needs. For example, the weight parameter of the comparative loss value is 0.4, and the weight parameter of the recommended loss value is 0.6. rec And the recommended loss value loss rec Perform weighted calculation to obtain the target loss value Loss. This process can be expressed as shown in formula (4):
[0127] Loss = α*loss rec +β*loss cl Formula (4)
[0128] Among them, α and β are weight parameters.
[0129] In step S502 of some embodiments, the model parameters are updated using the stochastic gradient descent method to minimize the target loss value, so that the comparison loss value and the recommendation loss value can be minimized at the same time, and the early stopping method is used to control the progress of model training. For example, when the verification error of the model continues to rise during more than k iterations, the model training is stopped to obtain a recommended model, where k is an integer greater than zero and can be set according to actual business needs without restriction.
[0130] The training method of the recommendation model of the embodiment of the present application obtains the target recommendation data and the original user data of the target user, wherein the original user data includes the user basic data and the first user rating data, thereby screening the first user rating data to obtain the second user rating data corresponding to the target recommendation data, so that the target user's rating of the target recommendation data can be determined more conveniently. Further, the second user rating data is subjected to Gaussian distribution generation processing to obtain the rating probability distribution data. In this way, the second user rating data can be effectively converted from a numerical form to a probability distribution form, thereby reducing the absoluteness of the rating, reducing data deviation, and improving data stability. Further, an initial perturbation graph is constructed based on the user basic data, the target recommendation data, and the second user rating data; and the initial perturbation graph is enhanced based on the rating probability distribution data to obtain the first perturbation graph and the second perturbation graph. The perturbation graph can be generated based on the data enhancement method of the edge perturbation, thereby improving the image quality of the generated perturbation graph. Finally, the preset neural network model is trained according to the initial perturbation graph, the first perturbation graph and the second perturbation graph to obtain the recommendation model. This method can better integrate the user rating situation into the model training, so that the neural network model can learn the graph node representation information of the initial perturbation graph, the first perturbation graph and the second perturbation graph more balanced. At the same time, the loss values of graph contrast learning and recommendation prediction are integrated during model training, which can effectively improve the prediction effect of the model and improve the accuracy of recommendation.
[0131] See also Figure 6 The present application also provides a recommendation method, which may include but is not limited to steps S601 to S603:
[0132] Step S601, obtaining target user data of a target user;
[0133] Step S602: input the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained according to the training method of the embodiment of the first aspect;
[0134] Step S603: Push the recommendation list to the target user.
[0135] In step S601 of some embodiments, a web crawler may be written, and after the data source is set, the data source may be crawled in a targeted manner to obtain the target user data of the target user. The target user data of the target user may also be obtained in other ways, not limited thereto, wherein the data source may be a network platform, software program or database on a client such as a mobile phone, tablet or computer terminal, etc. The target user data includes the current behavior data and basic user data of the target user, the current behavior data includes the click-through rate, browsing time and other data of the target user, and the basic user data includes the basic data such as the user's name, gender, age, occupation and the like.
[0136] In step S602 of some embodiments, the target user data is input into the recommendation model, and the target user data is encoded and processed by the recommendation model to obtain the current behavior characteristics; further, the current behavior characteristics are similarly calculated by the contrast learning mechanism of the recommendation model, so as to achieve the recommendation score of the current behavior characteristics, obtain the recommendation score corresponding to each preset target recommendation data, and arrange the target recommendation data in descending order according to the recommendation score to obtain a recommendation list. For example, when the current behavior characteristics are similarly calculated by the contrast learning mechanism of the recommendation model, the current behavior characteristics are mainly compared with the historical behavior characteristics of the target user, and the cosine similarity between the two is calculated. The cosine similarity is used as the basis for the recommendation score, and the cosine similarity is arranged in descending order to form a recommendation score sequence. Correspondingly, the target recommendation data corresponding to each historical behavior feature is also arranged in descending order according to the recommendation score sequence to obtain a recommendation list.
[0137] In step S603 of some embodiments, the recommendation list may be directly pushed to the target user, or the top contents in the recommendation list may be selected and pushed to the target user, thereby reducing communication costs while achieving personalized recommendations.
[0138] The recommendation method of the embodiment of the present application obtains the target user data of the target user, encodes the target user data through the recommendation model, obtains the current behavior characteristics, and can extract the more complex behavior data of the target user through deep learning, so as to integrate diverse heterogeneous data such as images, videos, audios and texts into the recommendation process. Furthermore, the current behavior characteristics are similarly calculated through the comparative learning mechanism of the recommendation model, so as to achieve the recommendation score of the current behavior characteristics and obtain the recommendation score corresponding to each preset target recommendation data. Finally, the preset target recommendation data is arranged in descending order according to the recommendation score to obtain a recommendation list, and the recommendation list is pushed to the target user. In the prediction process, a recommendation result that is more in line with the user's preferences can be obtained, which improves the recommendation accuracy and the recommendation performance of the recommendation system.
[0139] See also Figure 7 The present application also provides a training device for a recommendation model, which can implement the training method for the recommendation model. The device includes:
[0140] The first acquisition module 701 is used to acquire target recommendation data and original user data of a target user, where the original user data includes basic user data and first user rating data;
[0141] A screening module 702 is used to screen the first user rating data to obtain second user rating data corresponding to the target recommendation data;
[0142] The probability distribution generating module 703 is used to perform Gaussian distribution generating processing on the second user rating data to obtain rating probability distribution data;
[0143] A graph construction module 704, configured to construct an initial perturbation graph according to user basic data, target recommendation data, and second user rating data;
[0144] An enhancement module 705 is used to enhance the initial perturbation map according to the scoring probability distribution data to obtain a first perturbation map and a second perturbation map;
[0145] The training module 706 is used to train the preset neural network model according to the initial perturbation graph, the first perturbation graph and the second perturbation graph to obtain a recommended model.
[0146] In some embodiments, the probability distribution generation module 703 includes:
[0147] A mean value calculation unit, used to perform mean value calculation on the second user rating data to obtain a rating mean value;
[0148] A difference calculation unit, used to perform difference calculation on the score mean and the second user's score data to obtain a target score;
[0149] The Gaussian distribution calculation unit is used to perform Gaussian distribution calculation on the score mean and target score through the Gaussian distribution generation method and a preset normalization factor to obtain score probability distribution data.
[0150] In some embodiments, the enhancement module 705 includes:
[0151] A strength calculation unit, used to perform strength calculation on the initial perturbation graph by using a preset function to obtain the edge strength of the initial perturbation graph;
[0152] A data replacement unit, used to replace the edge strength data by scoring probability distribution data to obtain edge probability values;
[0153] The splitting unit is used to split the initial perturbation graph according to the edge probability value to obtain a first perturbation graph and a second perturbation graph.
[0154] In some embodiments, the training module 706 includes:
[0155] An encoding unit, configured to encode the initial perturbation graph to obtain an initial graph representation vector, encode the first perturbation graph to obtain a first graph representation vector, and encode the second perturbation graph to obtain a second graph representation vector;
[0156] A loss calculation unit, used to perform loss calculation on the initial graph representation vector using a preset first loss function to obtain a recommended loss value;
[0157] A contrastive learning unit, used for performing contrastive learning on the first image representation vector and the second image representation vector by using a preset second loss function to obtain a contrastive loss value;
[0158] The parameter optimization unit is used to optimize the parameters of the neural network model according to the comparison loss value and the recommendation loss value to train the neural network model and obtain the recommendation model.
[0159] In some embodiments, the parameter optimization unit includes:
[0160] A weighted calculation subunit, used to perform weighted calculation on the comparison loss value and the recommended loss value according to a preset weight parameter to obtain a target loss value;
[0161] The optimization subunit is used to optimize the parameters of the loss function of the neural network model through the stochastic gradient descent method and the target loss value to train the neural network model and obtain the recommendation model.
[0162] The specific implementation of the training device for the recommendation model is basically the same as the specific implementation of the training method for the recommendation model mentioned above, and will not be repeated here.
[0163] See also Figure 8 The present application also provides a recommendation device that can implement the above recommendation method. The device includes:
[0164] The second data acquisition module 801 is used to acquire target user data of a target user;
[0165] A prediction module 802 is used to input the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained according to the training device of the embodiment of the third aspect;
[0166] The recommendation module 803 is used to push the recommendation list to the target user.
[0167] The specific implementation of the recommendation device is substantially the same as the specific implementation of the above-mentioned recommendation method, and will not be described in detail herein.
[0168] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the program is executed by the processor, the training method or recommendation method of the recommendation model described above is realized. The electronic device may be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0169] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0170] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0171] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the training method or recommendation method of the recommendation model of the embodiment of the present application;
[0172] Input / output interface 903, used to implement information input and output;
[0173] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0174] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0175] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0176] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the training method or recommendation method of the above-mentioned recommendation model.
[0177] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0178] The training method, recommendation method and device, electronic device and medium of the recommendation model provided in the embodiment of the present application obtain the original user data of the target recommendation data and the target user, wherein the original user data includes the basic user data and the first user rating data, thereby screening the first user rating data to obtain the second user rating data corresponding to the target recommendation data, so that the target user's rating of the target recommendation data can be determined more conveniently. Further, the second user rating data is subjected to Gaussian distribution generation processing to obtain the rating probability distribution data. In this way, the second user rating data can be effectively converted from a numerical form to a probability distribution form, thereby reducing the absoluteness of the rating, reducing data deviation, and improving data stability. Further, an initial perturbation graph is constructed based on the basic user data, the target recommendation data, and the second user rating data; and the initial perturbation graph is enhanced based on the rating probability distribution data to obtain the first perturbation graph and the second perturbation graph, and the perturbation graph can be generated based on the data enhancement method of the edge perturbation, thereby improving the image quality of the generated perturbation graph. Finally, the preset neural network model is trained according to the initial perturbation graph, the first perturbation graph and the second perturbation graph to obtain the recommendation model. This method can better integrate the user rating situation into the model training, so that the neural network model can learn the graph node representation information of the initial perturbation graph, the first perturbation graph and the second perturbation graph more balanced. At the same time, the loss values of graph contrast learning and recommendation prediction are integrated during model training, which can effectively improve the prediction effect of the model and improve the accuracy of recommendation.
[0179] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0180] It can be understood by those skilled in the art that Figure 1-6 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0181] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0183] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0184] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0185] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0186] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0187] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0188] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0189] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A training method for a recommendation model, characterized in that: The training method comprises: Acquire target recommendation data and original user data of a target user, wherein the original user data includes basic user data and first user rating data; Performing screening processing on the first user rating data to obtain second user rating data corresponding to the target recommendation data; performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data; Constructing an initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data; performing enhancement processing on the initial perturbation graph according to the rating probability distribution data to obtain a first perturbation graph and a second perturbation graph; Training a preset neural network model according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommended model; The step of performing enhancement processing on the initial disturbance map according to the scoring probability distribution data to obtain a first disturbance map and a second disturbance map comprises: Performing strength calculation on the initial perturbation graph by using a preset function to obtain edge strength of the initial perturbation graph; performing data replacement on the edge strength by using the score probability distribution data to obtain edge probability values; performing splitting processing on the initial perturbation graph according to the edge probability values to obtain the first perturbation graph and the second perturbation graph; The step of training a preset neural network model according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model includes: The initial perturbation graph is encoded to obtain an initial graph representation vector, and the first perturbation graph is encoded to obtain a first graph representation vector, and the second perturbation graph is encoded to obtain a second graph representation vector; loss calculation is performed on the initial graph representation vector using a preset first loss function to obtain a recommended loss value; comparative learning is performed on the first graph representation vector and the second graph representation vector using a preset second loss function to obtain a comparative loss value; and parameter optimization is performed on the neural network model according to the comparative loss value and the recommended loss value to train the neural network model to obtain the recommended model.
2. The training method according to claim 1, characterized in that: The step of performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data includes: Calculate the mean of the second user rating data to obtain a rating mean; Calculate the difference between the average score and the second user score data to obtain a target score; The Gaussian distribution calculation is performed on the score mean and the target score by using a Gaussian distribution generation method and a preset normalization factor to obtain the score probability distribution data.
3. The training method according to claim 2, characterized in that: The step of optimizing the parameters of the neural network model according to the contrast loss value and the recommendation loss value to train the neural network model and obtain the recommendation model includes: Performing weighted calculation on the comparison loss value and the recommended loss value according to a preset weight parameter to obtain a target loss value; The loss function of the neural network model is parameter optimized by using the stochastic gradient descent method and the target loss value to train the neural network model and obtain the recommendation model.
4. A recommendation method, characterized in that: The recommended methods include: Obtain target user data of target users; Inputting the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained according to the training method for a recommendation model according to any one of claims 1 to 3; The recommendation list is pushed to the target user.
5. A training device for a recommendation model, characterized in that: The training device comprises: A first acquisition module, used to acquire target recommendation data and original user data of a target user, wherein the original user data includes basic user data and first user rating data; A screening module, used for screening the first user rating data to obtain second user rating data corresponding to the target recommendation data; A probability distribution generation module, used for performing Gaussian distribution generation processing on the second user rating data to obtain rating probability distribution data; A graph construction module, used to construct an initial perturbation graph according to the user basic data, the target recommendation data, and the second user rating data; An enhancement module, configured to enhance the initial perturbation map according to the scoring probability distribution data to obtain a first perturbation map and a second perturbation map; A training module, used for training a preset neural network model according to the initial perturbation graph, the first perturbation graph and the second perturbation graph to obtain a recommended model; The step of performing enhancement processing on the initial disturbance map according to the scoring probability distribution data to obtain a first disturbance map and a second disturbance map comprises: Performing strength calculation on the initial perturbation graph by using a preset function to obtain edge strength of the initial perturbation graph; performing data replacement on the edge strength by using the score probability distribution data to obtain edge probability values; performing splitting processing on the initial perturbation graph according to the edge probability values to obtain the first perturbation graph and the second perturbation graph; The step of training a preset neural network model according to the initial perturbation graph, the first perturbation graph, and the second perturbation graph to obtain a recommendation model includes: The initial perturbation graph is encoded to obtain an initial graph representation vector, and the first perturbation graph is encoded to obtain a first graph representation vector, and the second perturbation graph is encoded to obtain a second graph representation vector; loss calculation is performed on the initial graph representation vector using a preset first loss function to obtain a recommended loss value; comparative learning is performed on the first graph representation vector and the second graph representation vector using a preset second loss function to obtain a comparative loss value; and parameter optimization is performed on the neural network model according to the comparative loss value and the recommended loss value to train the neural network model to obtain the recommended model.
6. A recommendation device, characterized in that: The recommended devices include: A second data acquisition module is used to acquire target user data of a target user; a prediction module, used for inputting the target user data into a recommendation model for prediction processing to obtain a recommendation list, wherein the recommendation model is trained by the training device for the recommendation model according to claim 5; The recommendation module is used to push the recommendation list to the target user.
7. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the training method of the recommendation model as described in any one of claims 1 to 3 or the steps of the recommendation method as described in claim 4 is realized.
8. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the training method of the recommendation model as described in any one of claims 1 to 3, or the steps of the recommendation method as described in claim 4.
Citation Information
Patent Citations
Model training method and device, text classification method and device, equipment and medium
CN114637847A
Multi-directional scene text recognition method and system based on multi-element attention mechanism
US20220121871A1