Recommendation model training method and device, electronic equipment and storage medium
By obtaining and processing the user's historical behavior data and preset user characteristics, using graph convolutional neural network to generate convolutional user characteristics, and training the recommendation model, the problem of low accuracy in evaluating the quality of responses is solved, and a more comprehensive and accurate user feature evaluation and recommendation effect is achieved.
Patent Information
- Application Number
- CN202411739001.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-15
AI Technical Summary
Existing recommendation models have low accuracy when evaluating the quality of responses, making it difficult to fully reflect users' interest preferences, professionalism and interactive behavior.
By obtaining multiple sets of training data, including the user's historical behavior data and preset user characteristics, the user's fused user characteristics, professional level values and interactive behavior dynamic diagrams are determined. These features are processed using graph convolutional neural networks, convolutional user features are generated, and inputted into the initial recommendation model for training until the training stop condition is met.
It improves the comprehensiveness and accuracy of the quality evaluation of reply, and can more accurately reflect users' interests and preferences and professional level, thereby improving the accuracy of recommendations.
Smart Images

Figure CN119830002A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet technology, and in particular, relates to a training method, device, electronic device and storage medium for a recommendation model. Background Art
[0002] Online Q&A communities provide users with a convenient communication platform where users can ask questions and other users can provide answers and solutions. This Q&A model promotes the sharing and dissemination of knowledge and provides a way for users to obtain the information they need.
[0003] The current recommendation model mainly relies on simple indicators such as the number of likes and shares to judge the quality of answers, but these indicators can only reflect part of the information and it is difficult to fully evaluate the true value of the answer. As the scale of community users continues to expand, each question often receives a large number of answers with varying quality.
[0004] Therefore, the current recommendation model has the problem of low recommendation accuracy. Summary of the invention
[0005] The embodiments of the present application provide a training method, device, electronic device and storage medium for a recommendation model, which can solve the problem of low recommendation accuracy of current recommendation models.
[0006] In a first aspect, an embodiment of the present application provides a method for training a recommendation model, the method comprising:
[0007] Acquire multiple sets of training data, each set of training data includes: historical behavior data of a first user and preset user features, the preset user features are user features of a second user, and the historical behavior data of the first user includes positive feedback behavior data of the second user;
[0008] Determine, based on the historical behavior data, the integrated user characteristics, the professional level value, and the interactive behavior dynamic graph of the first user;
[0009] Based on the interactive behavior dynamic graph, the fused user features are processed through the graph convolutional neural network to obtain the convolution user features;
[0010] Input the convolutional user features into the initial recommendation model and output the predicted user features;
[0011] The initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, thereby obtaining a trained target recommendation model.
[0012] In a second aspect, an embodiment of the present application provides a training device for a recommendation model, and the training device for a recommendation model includes:
[0013] An acquisition module, used to acquire multiple sets of training data, each set of training data includes: historical behavior data of a first user and preset user features, the preset user features are user features of a second user, and the historical behavior data of the first user includes positive feedback behavior data for the second user;
[0014] A determination module, used to determine the integrated user characteristics, professional level value and interactive behavior dynamic graph of the first user based on the historical behavior data;
[0015] A processing module is used to process the fused user features through a graph convolutional neural network based on the interactive behavior dynamic graph to obtain convolution user features;
[0016] An input module, used to input the convolutional user features into the initial recommendation model and output the predicted user features;
[0017] The training module is used to train the initial recommendation model according to the predicted user characteristics, the preset user characteristics and the professional level value until the initial recommendation model meets the training stop condition to obtain the trained target recommendation model.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method in the first aspect or any possible implementation of the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0020] In the embodiment of the present application, by obtaining multiple groups of training data, each group of training data includes: historical behavior data and preset user features of the first user, the preset user features are the user features of the second user, and the historical behavior data of the first user includes positive feedback behavior data of the second user; according to the historical behavior data, the fused user features, professional level value and interactive behavior dynamic graph of the first user are determined; it can more comprehensively reflect the user's interest preferences, professional level and interactive behavior, thereby improving the comprehensiveness of the response quality evaluation. Based on the interactive behavior dynamic graph, the fused user features are processed by the graph convolutional neural network to obtain the convolution user features; the graph convolutional neural network can capture the complex relationship between the user and the reply, improve the accuracy of feature extraction, and thus improve the accuracy of the reply quality evaluation. The convolution user features are input into the initial recommendation model, and the predicted user features are output; the initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, and the trained target recommendation model is obtained. As a result, the trained target recommendation model can recommend information of users who match the personal characteristics and professional level of the first user according to the personalized needs of the first user, thereby improving the accuracy of the recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 is a flow chart of a training method for a recommendation model provided in an embodiment of the present application;
[0023] Figure 2 It is a flow chart of constructing an interactive behavior dynamic graph provided by an embodiment of the present application;
[0024] Figure 3 is a flow chart of a training method for a recommendation model provided in an embodiment of the present application;
[0025] Figure 4 It is a structural schematic diagram of a training device for a recommendation model provided in an embodiment of the present application;
[0026] Figure 5 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0029] Figure 1 It is a flowchart of a training method for a recommendation model provided in an embodiment of the present application.
[0030] like Figure 1 As shown, the training method of the recommendation model may include steps 110 to 150, and the method is applied to the training device of the recommendation model, which is specifically as follows:
[0031] Step 110, obtaining multiple sets of training data, each set of training data includes: historical behavior data of the first user and preset user features, the preset user features are user features of the second user, and the historical behavior data of the first user includes positive feedback behavior data on the user behavior data of the second user;
[0032] Historical behavior data: refers to the data records generated by users' various operations on the platform, such as browsing, liking, commenting, and collecting.
[0033] User characteristics: data that describes user attributes, such as age, gender, interests, hobbies, occupation, etc.
[0034] Positive feedback behavior data: refers to data that shows users’ approval and approval of certain content or behaviors, such as likes, favorites, and shares.
[0035] Specifically, each user's historical behavior data can be obtained from the database, including the user's time of joining the forum, the posts in which the user participated in the discussion, the posting time, the reply time, etc. The time when the user first joined the forum is recorded as the user's joining time. The post ID, post title, posting time, reply time, etc. of the post in which the user participated in the discussion are recorded. By counting the user's historical behavior information, the user's activity and participation can be understood, providing a data basis for calculating the user's professional level value.
[0036] By collecting users' historical behavior data and user characteristics, a training data set is constructed to provide a data basis for subsequent model training.
[0037] Step 120, determining the integrated user characteristics, professional level value and interactive behavior dynamic graph of the first user based on the historical behavior data;
[0038] Fusion user features: Feature representation obtained by fusing the user's historical behavior data and user features.
[0039] Expertise value: A numerical value that measures a user's level of expertise in a particular field or topic.
[0040] Interaction behavior dynamic graph: a graph structure data, where nodes represent users or content, and edges represent the interaction between users and content, such as browsing, liking, etc.
[0041] Specifically, the professionalism value can be calculated by the user's time in joining the forum and the number of posts in which he / she participates in the discussion. For example, the professionalism value can be defined as:
[0042] Professionalism value = = α × joining time + β × number of participating posts;
[0043] Among them, α and β are weight coefficients, which can be adjusted according to actual conditions.
[0044] According to the defined professional value calculation formula, the professional value of each user is calculated. By calculating the user's professional value, the user's activity and contribution in the forum can be quantified, providing a basis for subsequent user interaction behavior analysis.
[0045] After counting the historical behavior information of users and calculating the professional level of users, an interactive behavior dynamic graph can be constructed to describe the interactive behaviors between users. The interactive behavior dynamic graph can reflect the changes in the interactive relationship between users over time.
[0046] Interaction behavior dynamic graph, including nodes and edges:
[0047] Each user is a node, and the node attributes include the user's ID, joining time, professionalism, etc. The interaction between users is an edge, and the edge attributes include interaction time, interaction type, and interaction intensity. Interaction type, such as posting, replying, and liking; interaction intensity, such as the number of replies and the number of likes.
[0048] The user's historical behavior data is sliced by time, and each time slice corresponds to a time window. In each time slice, a graph structure is constructed based on the interaction behavior between users. Each time slice corresponds to a graph, and the nodes and edges in the graph are generated based on the user interaction behavior in the time slice. By constructing a dynamic graph, it is possible to intuitively reflect the changes in the interaction relationship between users over time, providing data support for analyzing and predicting user behavior.
[0049] By analyzing historical behavior data, the user's integrated user characteristics and professional level values are extracted, and a dynamic graph of the interactive behavior between users and content is constructed.
[0050] Step 130, based on the interactive behavior dynamic graph, the fused user features are processed by a graph convolutional neural network to obtain convolutional user features;
[0051] Graph Convolutional Network (GCN): A deep learning model for processing graph-structured data that can capture complex relationships between nodes. GCN can capture complex relationships between nodes in graph-structured data, such as social networks, knowledge graphs, molecular structures, etc.
[0052] Convolutional user features: feature representation obtained by processing and fusing user features through a graph convolutional neural network.
[0053] Graph convolutional neural networks are used to capture the complex relationship between users and content, and further feature extraction and representation learning are performed on the fused user features.
[0054] Specifically, we analyze the properties of the nodes in the interactive behavior dynamic graph, such as the user's joining time, professionalism, etc., to understand the user's activity and contribution. We analyze the changes in the nodes in the interactive behavior dynamic graph to analyze the changes in the nodes in different time slices, such as the joining of new users and the exit of old users.
[0055] Analyze the attributes of the edges of the interactive behavior dynamic graph, such as interaction time, interaction type, interaction intensity, etc., to understand the interactive relationship between users. Analyze the changes of edges in different time slices, such as the generation of new interactions and the disappearance of old interactions.
[0056] It is also possible to analyze the evolution of multiple graph structures included in the interactive behavior dynamic graph in different time slices, such as the formation, splitting, and merging of communities. It is also possible to analyze the characteristics of the graph, such as the degree distribution of nodes, clustering coefficient, average path length, etc., to understand the overall structure and characteristics of the graph.
[0057] Through the analysis of dynamic graphs, we can gain in-depth understanding of the interactive behaviors and relationship changes between users, and provide decision-making support for optimizing forum functions and improving user activity.
[0058] By counting the historical behavior information of users and calculating the professional level of users, we can quantify the activity and contribution of users in the forum. By constructing interactive behavior dynamic graphs to depict the interactive behaviors between users, we can intuitively reflect the changes in the interactive relationships between users over time. These analysis results can provide data support and decision-making basis for optimizing forum functions and improving user activity.
[0059] GCN performs convolution operations on the graph structure through the graph convolution layer, aggregates the information of neighbor nodes, and updates the node pair fusion user features. In each time slice, GCN aggregates the interaction information between users through the graph convolution layer and updates the user's features. By stacking multiple layers of graph convolution layers, GCN can gradually aggregate the information of neighbor nodes at a longer distance and update the user's feature vector.
[0060] Use the nodes and edges in the dynamic graph as training data to train the GCN model. Define a suitable loss function, such as the cross entropy loss function, to optimize the parameters of the GCN model. The parameters of the GCN model can be optimized through the back propagation algorithm so that the model can accurately aggregate and update the user's feature vector.
[0061] By processing the dynamic interaction graph through GCN, we can aggregate the interaction information between users, update the user's feature vector, and better characterize the user's interaction characteristics.
[0062] By combining the user's long-term historical behavior and short-term historical behavior, the user's convolutional user features can be reconstructed to fully reflect the user's personal characteristics. Through the graph convolutional neural network (GCN) based on the interactive behavior dynamic graph, the interaction information between users can be aggregated, the user's feature vector can be updated, and the user's interactive characteristics can be better characterized. These analysis results can provide data support and decision-making basis for optimizing forum functions and improving user activity.
[0063] Step 140, input the convolution user features into the initial recommendation model, and output the predicted user features;
[0064] Initial recommendation model: A recommendation model that has not yet been trained, usually a neural network model.
[0065] Predicted user features: The user features predicted by the initial recommendation model based on the convolutional user features.
[0066] The convolution user features processed by the graph convolutional neural network are input into the initial recommendation model to predict user features.
[0067] Step 150 , training the initial recommendation model according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, thereby obtaining a trained target recommendation model.
[0068] Training stop condition: The preset stop condition during model training, such as reaching a certain number of training rounds, loss function convergence, etc.
[0069] Target recommendation model: the final recommendation model obtained after training.
[0070] The predicted user features, preset user features and professional level values are used as training labels to train the initial recommendation model, and the model parameters are optimized through continuous iteration to finally obtain the trained target recommendation model.
[0071] By acquiring multiple sets of training data, each set of training data includes: the historical behavior data of the first user and preset user features, the preset user features are the user features of the second user, and the historical behavior data of the first user includes the positive feedback behavior data of the second user; a high-quality training data set is constructed to provide a data basis for subsequent model training. The user's fused user features, professional level values, and interactive behavior dynamic graphs are extracted to provide input for subsequent feature learning and model training. The graph convolutional neural network is used to capture the complex relationship between users and content, and more representative convolutional user features are extracted. The user features are predicted through the initial recommendation model to provide prediction results for subsequent model training. By continuously iteratively optimizing the model parameters, a trained target recommendation model is finally obtained, which can more accurately predict user features and improve the performance of the recommendation model.
[0072] In the embodiment of the present application, by obtaining multiple groups of training data, each group of training data includes: historical behavior data and preset user features of the first user, the preset user features are the user features of the second user, and the historical behavior data of the first user includes positive feedback behavior data of the second user; according to the historical behavior data, the fused user features, professional level value and interactive behavior dynamic graph of the first user are determined; it can more comprehensively reflect the user's interest preferences, professional level and interactive behavior, thereby improving the comprehensiveness of the response quality evaluation. Based on the interactive behavior dynamic graph, the fused user features are processed by the graph convolutional neural network to obtain the convolution user features; the graph convolutional neural network can capture the complex relationship between the user and the reply, improve the accuracy of feature extraction, and thus improve the accuracy of the reply quality evaluation. The convolution user features are input into the initial recommendation model, and the predicted user features are output; the initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, and the trained target recommendation model is obtained. As a result, the trained target recommendation model can recommend information of users who match the personal characteristics and professional level of the first user according to the personalized needs of the first user, thereby improving the accuracy of the recommendation.
[0073] In a possible embodiment, step 120 includes:
[0074] Step 210, extracting the fused user features of the first user from the historical behavior data of the first user;
[0075] Step 220, calculating the professional level value of the first user based on the historical behavior data of the first user;
[0076] Step 230, obtaining user interaction behavior data from multiple groups of historical behavior data of the first user;
[0077] Step 240: construct an interactive behavior dynamic graph based on the user interactive behavior data.
[0078] Involving step 210:
[0079] The fused user features are the feature representations obtained by fusing the user's historical behavior data and user features.
[0080] Through feature engineering methods, such as feature crossover, feature combination, and feature dimensionality reduction, the user's historical behavior data and user features can be fused to obtain more representative fused user features.
[0081] By extracting more representative fusion user features, it can better reflect the user's interest preferences and behavior patterns, and provide more effective input for subsequent feature learning and model training.
[0082] Involving step 220:
[0083] Expertise is a numerical measure of a user's level of expertise in a particular field or topic.
[0084] By analyzing the user's historical behavior data in a specific field or topic, such as browsing, liking, commenting, and collecting, we can calculate indicators such as the user's activity, participation, and contribution in that field or topic, and combine other information, such as the user's occupation, educational background, etc., to comprehensively evaluate the user's professional level.
[0085] By calculating the user's professional level value, it can better reflect the user's professional knowledge level in different fields or topics, and provide a more accurate reference for subsequent personalized recommendations.
[0086] Involving step 230:
[0087] User interaction behavior data refers to various interactive behaviors between users and platform content, such as browsing, liking, commenting, and collecting.
[0088] By analyzing the user's historical behavior data, the interaction behavior data between the user and different contents can be extracted. By obtaining the interaction behavior data between the user and the content, the interaction relationship between the user and the content can be constructed, providing a data basis for the subsequent construction of the interaction behavior dynamic graph.
[0089] Involving step 240:
[0090] The interactive behavior dynamic graph is a kind of graph structure data, where nodes represent users or content, and edges represent the interactive behaviors between users and content. The interactive behavior dynamic graph can be constructed by taking users and content as nodes and the interactive behaviors between users and content as edges.
[0091] By constructing a dynamic graph of interactive behavior, the interactive relationship between users and content can be intuitively represented, providing a data basis for subsequent feature learning and model training using graph convolutional neural networks.
[0092] In this way, the fused user features and professional level value of the first user can be extracted and a dynamic graph of interactive behavior can be constructed, providing more effective input for subsequent feature learning and model training, thereby improving the performance of the recommendation system.
[0093] In a possible embodiment, step 210 may specifically include the following steps:
[0094] Acquire historical behavior data of a first time period and historical behavior data of a second time period from the historical behavior data of the first user, wherein the duration of the first time period is greater than the duration of the second time period, and the start time of the first time period is earlier than the start time of the second time period;
[0095] Determining static characteristics of the first user based on the historical behavior data of the first time period;
[0096] Determining the dynamic characteristics of the first user based on the historical behavior data of the second time period;
[0097] The static features and the dynamic features are fused to obtain fused user features of the first user.
[0098] Historical behavior data in the first time period: refers to the user's historical behavior data over a longer period of time, such as the behavior data in the past month or year.
[0099] Historical behavior data in the second time period: refers to the user's historical behavior data in a shorter time period, such as the behavior data in the past week or day.
[0100] Static features: Features that reflect the long-term stable attributes of users, such as the user’s age, gender, occupation, interests and hobbies, etc.
[0101] Dynamic features: Features that reflect recent changes in user behavior, such as the content that the user has recently browsed, liked, or commented on.
[0102] Fusion of user features: The feature representation obtained by fusing static features and dynamic features can more comprehensively reflect the user's interest preferences and behavior patterns.
[0103] The user's historical behavior data is divided into two time periods. The first time period is longer and is used to extract the user's static features; the second time period is shorter and is used to extract the user's dynamic features. The start time of the first time period is earlier than the start time of the second time period, ensuring that the first time period contains the historical behavior data of the second time period. By dividing the time periods, the user's static features and dynamic features can be extracted separately, providing a data basis for subsequent feature fusion.
[0104] Static features reflect the long-term stable attributes of users. By analyzing the historical behavior data of users over a long period of time, such as browsing, liking, commenting, and collecting, we can extract the user's age, gender, occupation, interests, and hobbies. Extracting static features of users can reflect the long-term stable attributes of users and provide a basis for subsequent feature fusion.
[0105] Dynamic features reflect the changes in users' recent behaviors. By analyzing the historical behavior data of users in a short period of time, such as the content they recently browsed, the content they liked, and the content they commented on, we can extract the users' recent interests, preferences, and behavior patterns. By extracting the users' dynamic features, we can reflect the users' recent behavior changes and provide supplements for subsequent feature fusion.
[0106] The fused user feature is a feature representation obtained by fusing static features and dynamic features. Static features and dynamic features can be fused through feature engineering methods, such as feature crossover, feature combination, feature dimensionality reduction, etc., to obtain a more representative fused user feature.
[0107] By integrating static features and dynamic features, it is possible to more comprehensively reflect users' interest preferences and behavior patterns, and provide more effective input for subsequent feature learning and model training.
[0108] Specifically, fused user features = [joining time, number of posts participated, number of posts, number of replies, number of short-term posts, number of short-term replies, number of short-term likes, number of short-term comments];
[0109] The dimensions of the fused user features can be adjusted according to actual needs to ensure that the user's personal characteristics can be fully reflected. By fusing static features and dynamic features to obtain fused user features, the stable and dynamic features of the user can be fully reflected, providing a data basis for subsequent user interaction behavior analysis.
[0110] Therefore, the fusion of static features and dynamic features can more comprehensively reflect the user's interest preferences and behavior patterns, avoiding the information loss caused by a single feature. Extracting more representative fusion user features provides more effective input for subsequent feature learning and model training. More comprehensive and more representative fusion user features can improve the prediction accuracy of the model, thereby improving the performance of the recommendation system.
[0111] In a possible embodiment, step 220 may specifically include the following steps:
[0112] Analyze the historical behavior data of the first user to obtain the total time the first user has participated in the online forum, the number of online discussion topics in the online forum in which the first user participated, and the content published by the first user;
[0113] Performing semantic analysis on the content posted by the first user to obtain a user evaluation result;
[0114] The professional level value of the first user is calculated based on the total duration, the number of topics and the user evaluation results.
[0115] By analyzing the historical behavior data of the first user in the online forum, such as the user registration time, the time of participating in the discussion, the time of publishing content, etc., the total time the user has joined the online forum can be calculated. By counting the number of discussion topics in which the user participates, the user's activity and participation in the forum can be measured.
[0116] The content published by users is the information output by users in the forum, which can reflect the user's knowledge level and expression ability. The total time the user has joined the forum, the number of topics discussed, and the content published are obtained to provide a data basis for the subsequent calculation of the user's professional level value.
[0117] Semantic analysis refers to analyzing text content to extract semantic information from the text. Natural language processing technologies, such as part-of-speech tagging, named entity recognition, and sentiment analysis, can be used to perform semantic analysis on user-posted content and extract information such as users' opinions, attitudes, and emotions on different topics.
[0118] User evaluation results can reflect the user's understanding of different topics, analytical ability and expression ability. Semantic analysis of user-posted content can more accurately assess the user's knowledge level and expression ability, providing a more reliable basis for the subsequent calculation of the user's professional level value.
[0119] Expertise is a numerical measure of a user's level of expertise in a particular field or topic.
[0120] The user's professional level can be obtained by weighting the total time the user has joined the forum, the number of topics discussed, and the user's evaluation results. Different indicators can be assigned different weights. For example, the weight of the user's evaluation results can be higher than the total time and the number of topics to more accurately reflect the user's professional level. Calculating the user's professional level can better reflect the user's professional level in different fields or topics, and provide a more accurate reference for subsequent personalized recommendations.
[0121] By quantifying the user's historical behavior data, the user's professional knowledge level can be converted into specific values, which is convenient for subsequent analysis and comparison. Taking into account the total time the user has joined the forum, the number of topics discussed, and the user's evaluation results, the user's professional knowledge level can be evaluated from multiple dimensions to avoid the one-sidedness caused by a single indicator. More accurate evaluation of the user's professional knowledge level can improve the accuracy of personalized recommendations and recommend content that is more in line with their professional level and interest preferences.
[0122] In a possible embodiment, step 240 may specifically include the following steps:
[0123] In each time slice, nodes of the graph structure are generated according to the user's historical data, and edges of the graph structure are generated according to the user's interactive behavior data, so as to obtain multiple graph structures; one time slice corresponds to one graph structure;
[0124] Construct interactive behavior dynamic graphs based on multiple graph structures.
[0125] Time slicing: Divide time into several intervals of equal length, each interval is called a time slice.
[0126] Graph structure: A data structure consisting of nodes and edges. Nodes represent entities, and edges represent the relationships between entities.
[0127] User historical data: data records generated by users' various operations on the platform, such as browsing, liking, commenting, and collecting.
[0128] User interaction behavior data: various interactive behaviors between users and platform content, such as browsing, liking, commenting, and collecting.
[0129] Interaction behavior dynamic graph: a type of graph structure data, where nodes represent users or content, edges represent the interaction between users and content, and the graph structure changes over time.
[0130] In each time slice, the nodes of the graph structure are generated according to the user's historical data, and the edges of the graph structure are generated according to the user's interactive behavior data, so as to obtain multiple graph structures; one time slice corresponds to one graph structure. Time is divided into several time slices of equal length, and each time slice corresponds to one graph structure. In each time slice, the nodes of the graph structure are generated according to the user's historical data, such as user nodes and content nodes.
[0131] Generate graph structure edges based on user interaction behavior data, such as browsing, liking, commenting, and other interactive behaviors between users and content. Each time slice corresponds to a graph structure, representing the interactive relationship between users and content during that time period.
[0132] Converting the interactive behavior data between users and content into graph structure data can intuitively represent the interactive relationship between users and content. Each time slice corresponds to a graph structure, which can capture the dynamic changes of the interactive behavior between users and content.
[0133] Connect the graph structures corresponding to multiple time slices in chronological order to construct an interactive behavior dynamic graph. An interactive behavior dynamic graph is a graph structure data, where nodes represent users or content, edges represent the interactive behavior between users and content, and the graph structure changes over time.
[0134] By constructing interactive behavior dynamic graphs, we can more comprehensively represent the interactive relationship between users and content and capture the dynamic changes in the interactive behavior between users and content. The interactive behavior dynamic graph can serve as the data basis for subsequent feature learning and model training using graph convolutional neural networks.
[0135] Converting the interactive behavior data between users and content into graph structure data can intuitively represent the interactive relationship between users and content. Each time slice corresponds to a graph structure, which can capture the dynamic changes of the interactive behavior between users and content. Connecting the graph structures corresponding to multiple time slices to construct an interactive behavior dynamic graph can more comprehensively represent the interactive relationship between users and content, providing a data basis for subsequent feature learning and model training using graph convolutional neural networks.
[0136] In a possible embodiment, step 150 may specifically include the following steps:
[0137] Step 310, calculating the Bayesian loss value according to the predicted user characteristics and the preset user characteristics;
[0138] Step 320, calculating a restriction function value according to the fused user characteristics, predicted user characteristics and professional level value of the first user;
[0139] Step 330, determining a total loss value according to the Bayesian loss value and the constraint function value;
[0140] Step 340: train the initial recommendation model according to the total loss value until the initial recommendation model meets the training stop condition, thereby obtaining a trained target recommendation model.
[0141] The Bayesian loss value is a loss function that measures the difference between the predicted user features and the preset user features. By calculating the difference between the predicted user features and the preset user features, the prediction accuracy of the model can be evaluated. Calculating the Bayesian loss value can quantify the difference between the user features predicted by the model and the actual user features, providing a loss function for subsequent model training.
[0142] The Bayesian loss value is calculated based on the Bayesian Personalized Ranking (BPR) loss function. The BPR loss function is a loss function used in recommendation systems that can effectively measure user preferences for different items.
[0143] The constraint function value is a function that measures whether the model prediction results meet specific constraints. Specific constraint conditions can be designed based on the fused user features, predicted user features, and professional level values of the first user, such as the similarity between the predicted user features and the fused user features of the first user, the relationship between the predicted user features and the professional level values, etc. Calculating the constraint function value can ensure that the model prediction results meet specific constraints and avoid unreasonable model prediction results.
[0144] The total loss value is the weighted sum of the Bayesian loss value and the constraint function value. The relationship between the model prediction accuracy and the constraint conditions can be balanced by adjusting the weights of the Bayesian loss value and the constraint function value.
[0145] Determining the total loss value can comprehensively consider the model prediction accuracy and constraints, and provide a unified loss function for subsequent model training. By continuously iteratively optimizing model parameters and minimizing the total loss value, the model's prediction accuracy can be improved and the model prediction results can be ensured to meet specific constraints. When the model meets the training stop conditions, such as reaching a certain number of training rounds or the loss function converges, training can be stopped to obtain a trained target recommendation model.
[0146] By continuously iterating and optimizing the model parameters, we can eventually obtain a trained target recommendation model that can more accurately predict user characteristics and improve the performance of the recommendation system.
[0147] Therefore, by calculating the Bayesian loss value, the difference between the user features predicted by the model and the actual user features can be quantified, providing a loss function for subsequent model training. Ensure the rationality of model prediction: By calculating the value of the restriction function, it is possible to ensure that the model prediction results meet specific constraints and avoid unreasonable model prediction results. Comprehensively consider prediction accuracy and constraints: By determining the total loss value, the model prediction accuracy and constraints can be comprehensively considered to provide a unified loss function for subsequent model training. By continuously iterating and optimizing the model parameters, a trained target recommendation model is finally obtained, which can more accurately predict user features and improve the performance of the recommendation system.
[0148] In a possible embodiment, step 320 may specifically include the following steps:
[0149] Calculating a first restriction function value according to the fused user characteristics, predicted user characteristics, and expertise of the first user;
[0150] A second restriction function value is calculated according to the fused user feature and the predicted user feature degree of the first user; the restriction function value includes: a first restriction function value and a second restriction function value.
[0151] The first restriction function value can measure the similarity between the predicted user feature and the fused user feature of the first user, and the relationship between the predicted user feature and the professional level value.
[0152] For example, the first restriction function value can be designed so that the higher the similarity between the predicted user features and the fused user features of the first user, the smaller the first restriction function value; the more the relationship between the predicted user features and the professional level value conforms to expectations, the smaller the first restriction function value.
[0153] By calculating the first restriction function value, it can be ensured that there is a certain similarity between the predicted user feature and the fused user feature of the first user, and the relationship between the predicted user feature and the professional level value is in line with expectations.
[0154] The second limiting function value can measure the difference between the predicted user feature and the fused user feature of the first user. For example, the second limiting function value can be designed so that the smaller the difference between the predicted user feature and the fused user feature of the first user, the smaller the second limiting function value.
[0155] By calculating the second restriction function value, it is possible to ensure that the difference between the predicted user features and the fused user features of the first user is within a reasonable range, thereby avoiding unreasonable model prediction results.
[0156] The constraint function value is a weighted sum of the first constraint function value and the second constraint function value. The relationship between the similarity and difference of the model prediction results can be balanced by adjusting the weights of the first constraint function value and the second constraint function value.
[0157] Determining the restriction function value can comprehensively consider the similarity and difference between the predicted user features and the fused user features of the first user, as well as the relationship between the predicted user features and the professional level value, and provide unified constraint conditions for subsequent model training.
[0158] Specifically, the first restriction function ensures that the feature value of each dimension of the fused user feature of the first user is proportional to the professional level value. Through the first restriction function, it is ensured that each dimension of the fused user feature of the first user is proportional to the professional level, reflecting the professional ability of the user.
[0159] The first restriction function means that each dimension of the user's personal feature vector, that is, each feature, should be proportional to the user's expertise. In other words, if the user's expertise is higher, the value of each dimension in the feature vector should also be larger.
[0160] For example, the fused user features of the first user are: [x1, x2, x3, ..., xn], where xi represents the value of the ith feature. The professionalism value is a scalar value, such as P.
[0161] Each dimension xi in the fused user features of the first user should be proportional to the expertise P. For example, if the expertise P increases, then x1, x2, x3, ..., xn should also increase accordingly.
[0162] The second limiting function value: the characteristic value of each dimension of the fused user features of the first user is greater than the characteristic value of each dimension of the predicted user characteristic degree; for example, each dimension of the fused user features of the first user is greater than the predicted user characteristic degree, the first user is the questioner, and the second user corresponding to the predicted user characteristic degree is the question answerer.
[0163] The first restriction function value = the vector difference between the fused user feature and the predicted user feature of the first user * (lower professional degree value - higher professional degree value);
[0164] The lower professional level value is the lower one of the professional level value of the first user and the professional level value of the second user, and the higher professional level value is the higher one of the professional level value of the first user and the professional level value of the second user.
[0165] For example, the feature vector of the questioner is [p1,p2,p3,...,pn]. The feature vector of the answerer is [a1,a2,a3,...,an].
[0166] Each dimension pi in the feature vector of the questioner should be larger than the corresponding dimension ai in the feature vector of the question answerer. For example, p1>a1, p2>a2, p3>a3, and so on.
[0167] Thus, by calculating the first restriction function value, it is possible to ensure that the predicted user features and the fused user features of the first user have a certain degree of similarity, thereby avoiding a large difference between the model prediction results and the user's real features. By calculating the second restriction function value, it is possible to ensure that the difference between the predicted user features and the fused user features of the first user is within a reasonable range, thereby avoiding unreasonable model prediction results. By determining the restriction function value, it is possible to comprehensively consider the similarity and difference between the predicted user features and the fused user features of the first user, as well as the relationship between the predicted user features and the professional level value, thereby providing a unified constraint condition for subsequent model training.
[0168] In the embodiment of the present application, by obtaining multiple groups of training data, each group of training data includes: historical behavior data and preset user features of the first user, the preset user features are the user features of the second user, and the historical behavior data of the first user includes positive feedback behavior data of the second user; according to the historical behavior data, the fused user features, professional level value and interactive behavior dynamic graph of the first user are determined; it can more comprehensively reflect the user's interest preferences, professional level and interactive behavior, thereby improving the comprehensiveness of the response quality evaluation. Based on the interactive behavior dynamic graph, the fused user features are processed by the graph convolutional neural network to obtain the convolution user features; the graph convolutional neural network can capture the complex relationship between the user and the reply, improve the accuracy of feature extraction, and thus improve the accuracy of the reply quality evaluation. The convolution user features are input into the initial recommendation model, and the predicted user features are output; the initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, and the trained target recommendation model is obtained. As a result, the trained target recommendation model can recommend information of users who match the personal characteristics and professional level of the first user according to the personalized needs of the first user, thereby improving the accuracy of the recommendation.
[0169] Based on the above Figure 1 The training method of the recommendation model shown in the embodiment of the present application also provides a training device for the recommendation model, such as Figure 4 As shown, the training device 400 of the recommendation model may include:
[0170] An acquisition module 410 is used to acquire multiple sets of training data, each set of training data includes: historical behavior data of a first user and preset user features, the preset user features are user features of a second user, and the historical behavior data of the first user includes positive feedback behavior data for the second user;
[0171] A determination module 420, for determining the fused user characteristics, the professional level value and the interactive behavior dynamic graph of the first user according to the historical behavior data;
[0172] A processing module 430 is used to process the fused user features through a graph convolutional neural network based on the interactive behavior dynamic graph to obtain convolution user features;
[0173] An input module 440, configured to input the convolutional user features into an initial recommendation model and output predicted user features;
[0174] The training module 450 is used to train the initial recommendation model according to the predicted user characteristics, the preset user characteristics and the professional level value until the initial recommendation model meets the training stop condition, thereby obtaining a trained target recommendation model.
[0175] In a possible embodiment, the determination module 420 is specifically configured to:
[0176] Extracting a fused user feature of the first user from the historical behavior data of the first user;
[0177] Calculating a professional level value of the first user based on the historical behavior data of the first user;
[0178] Acquire user interaction behavior data from multiple groups of historical behavior data of the first user;
[0179] Build interactive behavior dynamic graphs based on user interactive behavior data.
[0180] In a possible embodiment, the determination module 420 is specifically configured to:
[0181] Acquire historical behavior data of a first time period and historical behavior data of a second time period from the historical behavior data of the first user, wherein the duration of the first time period is greater than the duration of the second time period, and the start time of the first time period is earlier than the start time of the second time period;
[0182] Determining static characteristics of the first user based on the historical behavior data of the first time period;
[0183] Determining the dynamic characteristics of the first user based on the historical behavior data of the second time period;
[0184] The static features and the dynamic features are fused to obtain fused user features of the first user.
[0185] In a possible embodiment, the determination module 420 is specifically configured to:
[0186] Analyze the historical behavior data of the first user to obtain the total time the first user has participated in the online forum, the number of online discussion topics in the online forum in which the first user participated, and the content published by the first user;
[0187] Performing semantic analysis on the content posted by the first user to obtain a user evaluation result;
[0188] The professional level value of the first user is calculated based on the total duration, the number of topics and the user evaluation results.
[0189] In a possible embodiment, the determination module 420 is specifically configured to:
[0190] In each time slice, nodes of the graph structure are generated according to the user's historical data, and edges of the graph structure are generated according to the user's interactive behavior data, so as to obtain multiple graph structures; one time slice corresponds to one graph structure;
[0191] Construct interactive behavior dynamic graphs based on multiple graph structures.
[0192] In a possible embodiment, the training module 450 is specifically configured to:
[0193] Calculate the Bayesian loss value based on the predicted user features and the preset user features;
[0194] Calculating a restriction function value according to the fused user characteristics, the predicted user characteristics, and the professional level value of the first user;
[0195] Determine the total loss value based on the Bayesian loss value and the limit function value;
[0196] The initial recommendation model is trained according to the total loss value until the initial recommendation model meets the training stop condition, and a trained target recommendation model is obtained.
[0197] In a possible embodiment, the training module 450 is specifically configured to:
[0198] Calculating a first restriction function value according to the fused user characteristics, predicted user characteristics, and expertise of the first user;
[0199] Calculating a second restriction function value according to the fused user feature and the predicted user feature degree of the first user;
[0200] The limiting function value includes: a first limiting function value and a second limiting function value.
[0201] In the embodiment of the present application, by obtaining multiple groups of training data, each group of training data includes: historical behavior data and preset user features of the first user, the preset user features are the user features of the second user, and the historical behavior data of the first user includes positive feedback behavior data of the second user; according to the historical behavior data, the fused user features, professional level value and interactive behavior dynamic graph of the first user are determined; it can more comprehensively reflect the user's interest preferences, professional level and interactive behavior, thereby improving the comprehensiveness of the response quality evaluation. Based on the interactive behavior dynamic graph, the fused user features are processed by the graph convolutional neural network to obtain the convolution user features; the graph convolutional neural network can capture the complex relationship between the user and the reply, improve the accuracy of feature extraction, and thus improve the accuracy of the reply quality evaluation. The convolution user features are input into the initial recommendation model, and the predicted user features are output; the initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, and the trained target recommendation model is obtained. As a result, the trained target recommendation model can recommend information of users who match the personal characteristics and professional level of the first user according to the personalized needs of the first user, thereby improving the accuracy of the recommendation.
[0202] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0203] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.
[0204] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0205] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory. In a specific embodiment, the memory 502 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0206] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement any one of the recommendation model training methods in the embodiments shown in the figure.
[0207] In one example, the electronic device may further include a communication interface 505 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 505 are connected via a bus 510 and communicate with each other.
[0208] The communication interface 505 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0209] Bus 510 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0210] The electronic device can execute the training method of the recommendation model in the embodiment of the present application, thereby realizing the combination Figure 1-Figure 3 Describes the training method of the recommendation model.
[0211] In addition, in combination with the training method of the recommendation model in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium to implement. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the Figure 1 The training method of the recommendation model.
[0212] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0213] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0214] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0215] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A training method for a recommendation model, characterized in that: The method comprises: Acquire multiple sets of training data, each set of training data includes: historical behavior data of a first user and preset user features, the preset user features are user features of a second user, and the historical behavior data of the first user includes positive feedback behavior data on the user behavior data of the second user; Determine, based on the historical behavior data, the integrated user characteristics, the professional level value, and the interactive behavior dynamic graph of the first user; Based on the interactive behavior dynamic graph, the fused user features are processed through the graph convolutional neural network to obtain the convolution user features; Input the convolutional user features into the initial recommendation model and output the predicted user features; The initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition, thereby obtaining a trained target recommendation model.
2. The method according to claim 1, characterized in that Determining the integrated user characteristics, professional level value and interactive behavior dynamic graph of the first user according to the historical behavior data includes: Extracting a fused user feature of the first user from the historical behavior data of the first user; Calculating a professional level value of the first user based on the historical behavior data of the first user; Acquire user interaction behavior data from multiple groups of historical behavior data of the first user; Build interactive behavior dynamic graphs based on user interactive behavior data.
3. The method according to claim 2, characterized in that The step of extracting the fused user features of the first user from the historical behavior data of the first user includes: Acquire historical behavior data of a first time period and historical behavior data of a second time period from the historical behavior data of the first user, wherein the duration of the first time period is greater than the duration of the second time period, and the start time of the first time period is earlier than the start time of the second time period; Determining static characteristics of the first user based on the historical behavior data of the first time period; Determining the dynamic characteristics of the first user based on the historical behavior data of the second time period; The static features and the dynamic features are fused to obtain fused user features of the first user.
4. The method according to claim 2, characterized in that: The calculating the professional level value of the first user according to the historical behavior data of the first user includes: Analyze the historical behavior data of the first user to obtain the total time the first user has participated in the online forum, the number of online discussion topics in the online forum in which the first user participated, and the content published by the first user; Performing semantic analysis on the content posted by the first user to obtain a user evaluation result; The professional level value of the first user is calculated based on the total duration, the number of topics and the user evaluation results.
5. The method according to claim 2, characterized in that: The step of constructing an interactive behavior dynamic graph based on user interactive behavior data includes: In each time slice, the nodes of the graph structure are generated according to the user's historical data, and the edges of the graph structure are generated according to the user's interactive behavior data, so as to obtain multiple graph structures; one time slice corresponds to one graph structure; Construct interactive behavior dynamic graphs based on multiple graph structures.
6. The method according to claim 1, characterized in that The initial recommendation model is trained according to the predicted user features, the preset user features and the professional level value until the initial recommendation model meets the training stop condition to obtain a trained target recommendation model, including: Calculate the Bayesian loss value based on the predicted user features and the preset user features; Calculating a restriction function value according to the fused user characteristics, the predicted user characteristics, and the professional level value of the first user; Determine the total loss value based on the Bayesian loss value and the limit function value; The initial recommendation model is trained according to the total loss value until the initial recommendation model meets the training stop condition, and a trained target recommendation model is obtained.
7. The method according to claim 6, characterized in that The calculating the restriction function value according to the fused user characteristics, the predicted user characteristics and the professional level value of the first user includes: Calculating a first restriction function value according to the fused user characteristics, predicted user characteristics, and expertise of the first user; A second restriction function value is calculated according to the fused user feature and the predicted user feature degree of the first user; the restriction function value includes: a first restriction function value and a second restriction function value.
8. A training device for a recommendation model, characterized in that: The training device of the recommendation model includes: An acquisition module, used to acquire multiple sets of training data, each set of training data includes: historical behavior data of a first user and preset user features, the preset user features are user features of a second user, and the historical behavior data of the first user includes positive feedback behavior data for the second user; A determination module, used to determine the integrated user characteristics, professional level value and interactive behavior dynamic graph of the first user based on the historical behavior data; A processing module is used to process the fused user features through a graph convolutional neural network based on the interactive behavior dynamic graph to obtain convolution user features; An input module, used to input the convolutional user features into the initial recommendation model and output the predicted user features; The training module is used to train the initial recommendation model according to the predicted user characteristics, the preset user characteristics and the professional level value until the initial recommendation model meets the training stop condition to obtain the trained target recommendation model.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the training method of the recommendation model as described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the training method for the recommendation model as described in any one of claims 1 to 7.
Citation Information
Cited By
Method for determining object preference, model training method and device, equipment and medium
CN121072597A