Commodity recommendation method based on adaptive weight adjustment double-path compensation
By constructing a heterogeneous information network graph and optimizing the weights of adjacent edges, combined with graph neural networks and adaptive weighted word frequency inverse document score calculation, the recommendation score weights are dynamically adjusted, solving the problem of noise interference and dynamic balance of user interests in the recommendation system, and achieving accurate and robust product recommendations.
Patent Information
- Application Number
- CN202511129518.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-11-21
AI Technical Summary
Existing recommendation systems are susceptible to interference from high-frequency, low-value noise data when processing heterogeneous interaction data between users and products. They struggle to dynamically balance short-term user preferences and long-term interests, and the contradiction between computational efficiency and recommendation latency is prominent, especially in real-time recommendation scenarios where they are unable to adapt to dynamic changes in user behavior.
By constructing a heterogeneous information network graph, an adaptive weight adjustment method is designed to optimize the weights of adjacent edges. Combined with graph neural networks, the vector features of users and products are learned. The recommendation scores of users and products are calculated using vector inner product and adaptive weighted word frequency inverse document score. The weights are dynamically adjusted through a compensation recommendation method, integrating recent and long-term preferences.
It effectively suppresses noise data interference, achieves robustness and timeliness of user and product features, improves the accuracy and personalization of recommendation results, and significantly alleviates the cold start problem.
Smart Images

Figure CN120996906A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of recommendation systems, and particularly relates to a commodity recommendation method based on adaptive weight adjustment and double-path compensation. BACKGROUND
[0002] A recommendation system is an important research direction in the fields of artificial intelligence and data mining, and its core goal is to recommend the most relevant items to users' interests from a large number of commodities or contents according to the historical behaviors and preferences of users. The recommendation system is widely used in real-world scenarios, such as personalized commodity recommendation of e-commerce websites, content pushing of video platforms, news distribution of social media, etc.
[0003] The development of the recommendation system started from the traditional collaborative filtering method. With the explosive growth of Internet users and the diversification of data types, the recommendation system has gradually become a core technology connecting users and information. Early recommendation systems mainly relied on explicit feedback of users (such as ratings or clicks), but due to data sparsity and dynamic changes in user preferences, its effect was significantly limited.
[0004] In recent years, with the rise of deep learning, recommendation methods based on graph neural networks (GNN) such as GraphSAGE and GAT can effectively aggregate multi-hop neighbor information and capture complex association patterns by modeling user-item interaction graphs. For example, GAT (graph attention network) dynamically allocates weights to neighbor nodes through self-attention mechanism, improving the recommendation ability of long-tail commodities. Heterogeneous GNN further integrates multiple types of nodes such as users, commodities, categories, and brands, enhancing the fusion ability of cross-domain information. These methods have significantly improved the accuracy and diversity of recommendations in e-commerce and social platform scenarios.
[0005] Although these methods have achieved remarkable results in recommendation tasks, their practical application still faces the following core challenges: first, user behavior data generally has high-dimensional sparsity characteristics, accompanied by a large amount of redundant noise data, and existing models are prone to introduce interference signals in the feature extraction process, leading to a decrease in the confidence of the recommendation results; second, user preferences show significant dynamic evolution characteristics, and existing methods are difficult to balance between computational efficiency and dynamic preference modeling accuracy, especially in real-time recommendation scenarios, the computational overhead of model updating and feature retraining contradicts the recommendation delay, which is increasingly prominent. Therefore, there is an urgent need for a recommendation method that can accurately model user behavior, efficiently fuse multi-source information, timely capture user dynamic preferences, and adapt to sparse scenarios. SUMMARY
[0006] The technical problem solved by the present application is to overcome the shortcomings of the prior art and provide a commodity recommendation method based on adaptive weight adjustment two-way compensation, which can accurately model user behavior, efficiently fuse multi-source information, timely capture user dynamic preferences, and significantly alleviate the cold start problem. Mainly includes the following steps:
[0007] Step 1: input the user's historical interaction data with the commodity, and construct a heterogeneous information network graph;
[0008] Step 2: preset an adaptive weight adjustment method to adjust the weight of adjacent edges of the heterogeneous information network graph;
[0009] Step 3: learn the vector features of users and commodities using a graph neural network method;
[0010] Step 4: calculate the first recommendation score of the user and the commodity using the vector inner product;
[0011] Step 5: preset an adaptive weighted term frequency inverse document score calculation method to calculate the second recommendation score of the user and the commodity;
[0012] Step 6: preset a compensation recommendation method to fuse the first recommendation score and the second recommendation score to obtain a third recommendation score. In step 1, the input user's historical interaction data with the commodity is used to construct a heterogeneous information network graph, which specifically includes:
[0013] The heterogeneous information network graph is defined as: G=(N, E), including object node set N and link relationship set E, the heterogeneous information network graph contains multiple types of nodes N∈{User (U), Item (I), Category (C), Address (A)} and links E∈{purchase relationship (UI_buy), click relationship (UI_click), collection relationship (UI_like), subordinate relationship (UC, UA, IC, IA)}, wherein the numerical value of the purchase relationship and the click relationship represents the weight of the corresponding link.
[0014] In step 2, the preset adaptive weight adjustment method is used to adjust the weight of adjacent edges of the heterogeneous information network graph, which specifically includes:
[0015] Let UI_click ij represent the number of times the user U i clicks the commodity I j , then the dynamic adjustment method is:
[0016] UI_click ij ′=ω final ·UI_click ij ,
[0017] ωfinal =γ(t)·ω category ·ω credubility (1)
[0018] γ(t) is the click behavior time decay factor:
[0019]
[0020] Among them, t now t0 is the current time, t0 is the time when the first click occurred, and λ is the decay coefficient with a value of 0.05.
[0021] ω category It uses category-level weights based on global statistics to de-weight click behavior in excessively popular categories.
[0022]
[0023] in, It is product I j Total clicks for the category it belongs to. cat_max It has the highest number of clicks across all categories;
[0024] ω credubility It is the behavioral credibility weight:
[0025]
[0026] The core behaviors include user purchases and user favorites, with a weight of 1.1; intermediate behaviors include browsing time and number of clicks, with a weight of 1.0; the user's average browsing time for this product is greater than 5 seconds and less than half an hour, and the number of clicks does not exceed 20; if neither of the above two behaviors is met, the user's behavior is judged to have low credibility.
[0027] In step 3, the vector features of users and products are learned using a graph neural network method, specifically including:
[0028] After updating the link weights of the heterogeneous information network graph, the vector features of users and products are learned as follows:
[0029] V U V I =RGCN(G), (5)
[0030] Among them, RGCN(G) is a heterogeneous graph neural network node vector learning method, used to process different link types through a relation-specific weight matrix, and to obtain the vector features of nodes by convolution and aggregation of neighbor information. It is the learned user node feature vector matrix, |U| is the number of user nodes, and d U It is a user characteristic dimension, the aforementioned is the learned item node feature vector matrix, |I| is the number of item nodes, d I is the item feature dimension, here let d U = d I = 128.
[0031] In step 4, the first recommendation score of the user and the item is obtained by using the calculation of the inner product of the vector, specifically including:
[0032] Based on the vector features of the user and the item obtained in step 3, the first recommendation score of the user and the item is calculated by calculating the inner product of the vector:
[0033]
[0034] wherein, is the learned feature vector of the user U i , is the learned feature vector of the item I j , sigmoid is an activation function, that is, the first recommendation score of the user and the item.
[0035] In step 5, a preset adaptive weighted term frequency inverse document score calculation method is used to calculate the second recommendation score of the user and the item, specifically including:
[0036] Select BM25 as the adaptive weighted term frequency inverse document score calculation method to calculate the recommendation score of the item to the user, taking the user U i and the item I j as an example:
[0037]
[0038] wherein, is the number of times that the user U i clicks the item I j , the parameter k1 is a parameter used for weighting, and the parameter B is used to control the influence degree of length normalization on the result, this method sets k1 = 80 and B = 0.5;
[0039] In the calculation process, the adaptive weight adjustment method in step 2 is used to dynamically adjust the click behavior value:
[0040]
[0041] The adjusted calculation method is:
[0042]
[0043]
[0044] wherein, i.e. the second recommendation score of the user and the commodity.
[0045] In step 6, the preset compensation recommendation method fuses the first recommendation score and the second recommendation score to obtain a third recommendation score, and specifically comprises:
[0046] For a user U i and a commodity I j , the preset compensation recommendation method is:
[0047]
[0048] wherein, the weight parameter ω1 is adjusted according to the user activity, representing the daily online duration of the user U i in the last month, when the daily online duration in the last month is greater than 10 minutes, the recent preference recommendation score is increased on the final recommendation score, i.e. ω1 takes 0.6; otherwise, the long-term preference recommendation score is increased on the final recommendation score, i.e. ω1 takes 0.4, is the third recommendation score of the commodity I j to the user U i .
[0049] In step 6, the training set D1 is constructed with the purchase behavior data of the binary group (U i , I j ), wherein the commodity I j is the positive example of the user U i ; n commodities I y are randomly selected from other commodities to constitute the negative example set D2 of the user U i . Then the loss function is defined as:
[0050]
[0051] wherein, |D1| represents the number of the training set D1, |D2| represents the number of the negative example set D2, and the training target is to minimize the objective function loss, wherein all parameters in the objective function loss are updated through the combination of back propagation and stochastic gradient descent.
[0052] The beneficial effects achieved by the present application are:
[0053] A commodity recommendation method based on adaptive weight adjustment and two-way compensation is proposed, multi-source information is efficiently fused by using a heterogeneous information network, and the recent preferences of users are iteratively updated in a timely manner; the long-term preferences of users are accurately modeled by using an adaptive weighted term frequency inverse document frequency calculation method; and the reliability of the recommendation result is improved and the cold start problem is significantly alleviated by fusing the two-way recommendation scores by using a designed compensation recommendation method. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 A method flowchart of an exemplary embodiment of the present application;
[0055] Figure 2 A commodity heterogeneous information network graph in an exemplary embodiment of the present application; DETAILED DESCRIPTION
[0056] The present application is a commodity recommendation method based on adaptive weight adjustment and two-way compensation, mainly including constructing a heterogeneous information network graph, adaptive weight adjustment of the heterogeneous information network graph, learning vector features of users and commodities, obtaining a first recommendation score by vector inner product, calculating a second recommendation score by adaptive weighted term frequency inverse document frequency, and a commodity recommendation method for fusing two-way recommendation scores by using a compensation recommendation method.
[0057] To implement the above method, the following will be combined with the accompanying drawings Figure 1 The method flow of an exemplary embodiment of the present application is described:
[0058] Step 1: Constructing a heterogeneous information network graph. The present application defines the node and link types of the heterogeneous information network graph, and completes the modeling of the graph by using the historical interaction data of users on commodities, which is used to learn the potential feature vectors of users and commodities.
[0059] The step 1 constructs a heterogeneous information network graph:
[0060] The heterogeneous information network graph is defined as: G=(N, E), including an object node set N and a link relationship set E, as shown in Figure 2 The heterogeneous information network graph G contains multiple types of nodes N E {user (User, U), commodity (Item, I), category (Category, C), address (Address, A)} and links E {such as purchase relationship (UI_buy), click relationship (UI_click), collection relationship (UI_like), and subordinate relationship (UC, UA, IC, IA)}. Among them, the values on the purchase relationship and click relationship links represent the weight of this link, that is, the number of user behaviors, such as Figure 2 “1, 2, 3, 5, 6, 7, 15” in
[0061] The existing heterogeneous graph neural network vector learning method requires a large amount of computing resources, so when constructing the heterogeneous information network graph G, the method only retains the behavior data of the last 50 different commodities interacted by each user, which can focus on capturing the recent user preferences and quickly update to adapt to the changing user preferences.
[0062] Step 2: Adaptive weight adjustment of heterogeneous information network graph. After constructing the heterogeneous information network graph, the application designs an adaptive weight adjustment method to adjust the weights of adjacent edges of the heterogeneous information network graph, avoiding misleading recommendations by high-frequency low-value noise data.
[0063] The step 2 adaptive weight adjustment of the heterogeneous information network graph specifically includes:
[0064] In the heterogeneous information network graph G, there will be high-frequency low-value noise data for click behavior, so an adaptive weight adjustment method is designed to dynamically adjust the weights of adjacent edges to avoid misleading recommendations. For example, the i-th user is represented by U i , the j-th commodity is represented by I j , the number of times that the user U ij clicks the commodity I i is represented by UI_click j , and the dynamic adjustment method is:
[0065] UI_click ij ′=ω final ·UI_click ij ,
[0066] ω final =γ(t)·ω category ·ω credubility , (1)
[0067] γ(t) is a click behavior time decay factor:
[0068]
[0069] where t now is the current time, t0 is the time of the first click behavior, and λ is the decay coefficient, for example, 0.05.
[0070] ω category is the category layer weight based on global statistics, which reduces the weight of click behavior in over-popular categories such as "computer":
[0071]
[0072] where, is the commodity I jThe total click volume of the category to which the user belongs, click cat_max is the largest click volume among all categories.
[0073] ω credubility is the behavior credibility weight:
[0074]
[0075] Among them, the core behavior includes user purchase and user collection, and the weight value is 1.1, indicating that the click behavior has high credibility; the intermediate behavior includes browsing time and click times, and the weight value is 1.0; the user's average browsing time of this product is greater than 5 seconds and less than half an hour, and the click times are not more than 20 times; if the above two behaviors are not met at the same time, it is determined that the user behavior credibility is low. For example: user U i purchased product I j , no matter how long the average time of browsing this product is, it is determined as a core behavior; if user U i does not purchase or collect product I j , and the click times exceed 20 times, and the stay time of each time is less than 5s, it is very likely that the user is brushing click volume, so it is determined as a noise behavior.
[0076] Step 3: learn the vector features of users and products. The present application utilizes the existing heterogeneous graph neural network node vector learning method to obtain the vector features of users and products by convolution and aggregation of neighbor information, which are used to calculate the recommendation score between users and products.
[0077] The step 3 of learning the vector features of users and products specifically includes:
[0078] After updating the link weight of the heterogeneous information network graph G, the vector feature learning method of the user and the product is:
[0079] V U ,V I =RGCN(G), (5)
[0080] Among them, the present method preferably adopts a relationship graph convolution network (RGCN) to learn the features of the heterogeneous information network graph. In the field of heterogeneous graph embedding, in addition to RGCN, there are Metapath2Vec, HAN and other optional schemes. For example, Metapath2Vec needs to rely on artificially defined meta paths to capture relationship semantics, and its flexibility is limited and difficult to adapt to complex networks; while HAN integrates multiple relationship features through an attention mechanism, but has high computational overhead for large-scale heterogeneous graphs. Compared with the above, RGCN effectively solves the technical defects of traditional methods that are strongly dependent on artificial rules and have high parameter complexity by designing independent relationship-specific weight matrices for different edge types, combining grouping convolution and base transformation strategies. The is the learned user node feature vector matrix, |U| is the number of user nodes, d U is the user feature dimension, the is the learned item node feature vector matrix, |I| is the number of item nodes, d I is the item feature dimension. In order to speed up the calculation and save computer resources, here d U =d I =128.
[0081] Step 4: Vector inner product to get the first kind of recommendation score. The present application calculates the first kind of item recommendation score for the user through the vector inner product of the vector features of the user and the item.
[0082] The step 4 vector inner product to get the first kind of recommendation score specifically includes:
[0083] After obtaining the vector features of the user and the item, the first kind of item recommendation score for the user can be obtained by vector inner product, taking user U i and item I j as an example:
[0084]
[0085] wherein, is the learned feature vector of user U i , is the learned feature vector of item I j , sigmoid is an activation function, that is, the first recommendation score of the user and the item, which is the recommendation score obtained according to the recent item preference features of the user.
[0086] Step 5: Adaptive weighted term frequency inverse document score to calculate the second kind of recommendation score. The present application designs an adaptive weighted term frequency inverse document score calculation method to calculate the second kind of recommendation score of the user and the item from the overall behavior data of the user.
[0087] The step 5 adaptive weighted term frequency inverse document score to calculate the second kind of recommendation score specifically includes:
[0088] In order to capture the long-term item preference of the user and make the recommendation result more comprehensive, the present method selects to use an existing term frequency inverse document score calculation method BM25 to calculate the item recommendation score for the user. BM25 (Best Matching 25) is a classic information retrieval algorithm, which is an improved version based on Okapi TF-IDF algorithm, aiming to solve some shortcomings of Okapi TF-IDF algorithm. Taking user U i and item I j as an example, based on the classic form:
[0089]
[0090] Available:
[0091]
[0092] wherein, is the user U i clicks the number of times of the commodity I j , the parameter k1 is a parameter for weighting, and the parameter B is used to control the influence degree of length normalization on the result. This method sets k1 = 80 and B = 0.5.
[0093] In the calculation process, there is high-frequency low-value noise data in the click behavior, so the adaptive weight adjustment method in step 2 is still used to dynamically adjust the click behavior value, filter low-quality behavior data, and avoid misleading the recommended result, that is:
[0094]
[0095] wherein, the weight parameter ω final The calculation method is described in step 2. Therefore, the adjusted The calculation method is:
[0096]
[0097]
[0098] wherein, that is, the recommendation score of the second commodity to the user, which is the recommendation score obtained according to the overall commodity purchase trend of the user.
[0099] Step 6: The compensation recommendation method fuses two recommendation scores. The present application designs a method of weighting two recommendation scores to obtain a final recommendation score according to the monthly average daily activity of the user. When the monthly average daily activity exceeds a set threshold, the weight of the recommendation score obtained under the recent preference trend is increased; otherwise, the weight of the recommendation score obtained under the long-term preference trend is increased. This can more flexibly recommend commodities to users.
[0100] The step 6 compensation recommendation method fuses two recommendation scores, specifically including:
[0101] For the user U i and the commodity I j , two recommendation scores are obtained through the above steps: and wherein, is the recommendation score obtained according to the recent commodity preference characteristics of the user, is the recommendation score obtained according to the overall commodity purchase trend of the user. In the business scenario, the difference in user activity is often very large, so a preset compensation recommendation method is designed to combine two recommendation scores to better recommend commodities to users:
[0102]
[0103] where ω1 is a weight parameter, which can be adjusted according to business rules. representing the user U i The average online duration per day in the last month. When the average online duration per day in the last month is greater than 10 minutes, the recent preference recommendation score is increased The influence on the final recommendation score; otherwise, the long-term preference recommendation score is increased The influence on the final recommendation score. is the commodity I j The final recommendation score of the user U i .
[0104] In step 6, the training set D1 is constructed with the binary tuple purchase behavior data (U i , I j ). In addition to the positive example of purchasing the commodity I j for the user U i , n commodities I y are randomly selected from the commodities of the user U i to form the negative example set D2, and the loss function is defined as:
[0105]
[0106] where |D1| represents the number of the training set D1, |D2| represents the number of the negative example set D2, and the training target is to minimize the objective function loss, wherein all parameters in the objective function loss are updated by combining back propagation and stochastic gradient descent.
[0107] The application is a kind of two-way compensation commodity recommendation method based on adaptive weight adjustment, first design a kind of heterogeneous information network graph construction method, through the definition node and adjacent edge type to user historical interaction data graph structure modeling, to capture the potential correlation characteristics of user and commodity.In addition, the noise interference problem of different adjacent edge types in the heterogeneous network is also considered, and then an adaptive weight adjustment mechanism is proposed to dynamically optimize the weight of the graph adjacent edge, effectively suppressing the deviation of high-frequency low-value data on the recommendation result.Again, the node features are convolved and aggregated using the heterogeneous graph neural network, and the low-dimensional vector representation of the user and the commodity is learned, and the direct interaction recommendation score of the user and the commodity is calculated through the vector inner product.Combined with the adaptive weighted term frequency inverse document frequency model, the implicit long-term preference features are mined from the user global behavior data to generate the second recommendation score based on statistical rules.Finally, a dynamic compensation fusion strategy is adopted, and the threshold is set according to the user monthly active data, when the user activity exceeds the threshold, the recommendation score weight of the recent preference trend is strengthened, otherwise the weight distribution of the long-term preference trend is focused, and finally the precise commodity recommendation is realized through the weighted fusion of the two-way recommendation score, so as to balance the dynamic balance of short-term behavior and long-term interest, and improve the robustness and personalized adaptation ability of the recommendation system.
[0108] Based on the above method, the following system modules can be constructed accordingly:
[0109] The heterogeneous information network graph module is constructed, the node and link type of the heterogeneous information network graph are defined, the graph modeling is completed through the historical interaction data of the user to the commodity, and the potential feature vector of the user and the commodity is learned.
[0110] The adaptive weight adjustment module of the heterogeneous information network graph is constructed to design an adaptive weight adjustment method to adjust the weight of the adjacent edge of the heterogeneous information network graph, and avoid the misleading of the high-frequency low-value noise data on the recommendation result.
[0111] The vector feature learning module of user and commodity is constructed, the existing heterogeneous graph neural network node vector learning method is used to convolve and aggregate the neighbor information to obtain the vector feature of the user and the commodity, which is used to calculate the recommendation score between the user and the commodity.
[0112] The first recommendation score module is constructed, the vector feature of the user and the commodity is calculated through the vector inner product to obtain the first recommendation score of the commodity to the user.
[0113] The second recommendation score module is constructed, and a kind of adaptive weighted term frequency inverse document score calculation method is designed to calculate the second recommendation score of the user and the commodity from the overall behavior data of the user.
[0114] A two-path recommendation score module based on a compensation recommendation method is constructed, and a method of obtaining a final recommendation score by weighting two recommendation scores according to the monthly average daily activity of the user is designed, when the monthly average daily activity exceeds a set threshold, the weight of the recommendation score obtained under the recent preference trend is increased, otherwise the weight of the recommendation score obtained under the long-term preference trend is increased, so that the user can be more flexibly recommended goods.
[0115] The beneficial effects achieved by the present application are:
[0116] A commodity recommendation method based on adaptive weight adjustment and double-path compensation is proposed, and a heterogeneous graph neural network is combined with a dynamic weight fusion mechanism to ensure the robustness and timeliness of user and commodity feature representation, so that the recommendation system is no longer disturbed by noise data; through the dynamic compensation strategy of double-path recommendation score, the balance matching of user short-term and long-term interest is realized, and the accuracy and personalized adaptation ability of the recommendation result are significantly improved.
[0117] With the explosive growth of Internet e-commerce and user behavior data, the commodity recommendation system is facing severe challenges. The existing recommendation method often causes recommendation deviation due to high-frequency low-value noise data interference when processing heterogeneous interaction data of users and commodities, and it is difficult to dynamically balance the short-term preference and long-term interest of users. For example, some users may be over-recommended due to frequent browsing of certain commodities in the near future, while their long-term potential demand is ignored; on the contrary, low-active users may not be able to obtain accurate recommendations due to lack of recent behavior data. In addition, traditional methods often rely on single feature representation or fixed weight fusion strategy, which is difficult to adapt to the dynamic changes of user behavior patterns. Therefore, there is an urgent need for a recommendation method that can suppress noise interference, flexibly adapt to user activity characteristics, and consider short-term and long-term interests. The double-path compensation commodity recommendation method based on adaptive weight adjustment proposed in the present application suppresses the interference of noise data on feature learning by constructing a heterogeneous information network and dynamically optimizing the adjacent edge weight; combined with a heterogeneous graph neural network and an adaptive weighted term frequency-inverse document frequency calculation method, the direct interaction features and global behavior patterns of users and commodities are captured respectively; finally, through a dynamic compensation fusion strategy, the weight distribution of double-path recommendation score is dynamically adjusted according to the monthly average daily activity data of the user, which not only ensures the recent preference trend of high-active users, but also considers the long-term interest mining of low-active users, so as to realize accurate, robust and personalized commodity recommendation and provide users with more accurate recommendation services that meet their real needs.
[0118] The above examples are not in any way to limit the present application, through the above description, the relevant staff can fully change and modify in a variety of ways without deviating from the scope of the inventive concept, any other improvement and application of the above examples in the equivalent transformation way, all belong to the protection scope of the present application, the technical scope of the present application is not limited to the content of the specification, must be determined according to the technical scope of the claims.
Claims
1. A product recommendation method based on adaptive weight adjustment and dual-path compensation, characterized in that, Includes the following steps: Step 1: Input users' historical interaction data with products and construct a heterogeneous information network diagram; Step 2: Preset an adaptive weight adjustment method to adjust the weights of adjacent edges in the heterogeneous information network graph; Step 3: Use graph neural network methods to learn the vector features of users and products; Step 4: Calculate the first recommendation score for the user and the product using the vector inner product; Step 5: Preset the adaptive weighted word frequency inverse document score calculation method to calculate the second recommendation score for users and products; Step 6: The preset compensation recommendation method merges the first recommendation score and the second recommendation score to obtain the third recommendation score.
2. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 1, characterized in that, In step 1, the step of inputting historical user interaction data for products and constructing a heterogeneous information network graph specifically includes: Define a heterogeneous information network graph as: G = (N, E), which includes a set of object nodes N and a set of link relationships E. The heterogeneous information network graph contains multiple types of nodes N∈{User(User, U), Item(I), Category(C), Address(A)} and links E∈{Purchase relationship(UI_buy), Click relationship(UI_click), Favorite relationship(UI_like), Subordinate relationship(UC, UA, IC, IA)}, where the numerical values of the purchase relationship and click relationship represent the weight of the corresponding link.
3. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 2, characterized in that, In step 2, a preset adaptive weight adjustment method is used to adjust the weights of adjacent edges in the heterogeneous information network graph, specifically including: Use UI_click ij Indicates user U i Click on product I j The number of times is adjusted dynamically as follows: UI_click ij ′=ω final ·UI_click ij , oh final =γ(t)·ω category ·oh credubility , (1) γ(t) is the click behavior time decay factor: Among them, t now t0 is the current time, t0 is the time when the first click occurred, and λ is the decay coefficient with a value of 0.
05. ω category It uses category-level weights based on global statistics to de-weight click behavior in excessively popular categories. in, It is product I j Total clicks for the category it belongs to. cat_max It has the highest number of clicks across all categories; ω credubility It is the behavioral credibility weight: The core behaviors include user purchases and user favorites, with a weight of 1.1; intermediate behaviors include browsing time and number of clicks, with a weight of 1.0; the user's average browsing time for this product is greater than 5 seconds and less than half an hour, and the number of clicks does not exceed 20; if neither of the above two behaviors is met, the user's behavior is judged to have low credibility.
4. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 3, characterized in that, In step 3, the vector features of users and products are learned using a graph neural network method, specifically including: After updating the link weights of the heterogeneous information network graph, the vector features of users and products are learned as follows: V U ,V I =RGCN(G),(5) Among them, RGCN(G) is a heterogeneous graph neural network node vector learning method, used to process different link types through a relation-specific weight matrix, and to obtain the vector features of nodes by convolution and aggregation of neighbor information. It is the learned user node feature vector matrix, |U| is the number of user nodes, and d U It is a user characteristic dimension, the aforementioned It is the learned feature vector matrix of product nodes, |I| is the number of product nodes, and d I This is the product feature dimension, let d here. U =d I =128.
5. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 4, characterized in that, In step 4, the first recommendation score for the user and the product is obtained by calculating the vector inner product, specifically including: Based on the vector features of users and products obtained in step 3, the first recommendation score for users and products is obtained by calculating the vector inner product: in, It is the user U that was learned i eigenvectors, It is the product I that I learned about. j The feature vectors are sigmoid, which is the activation function. This refers to the user's and product's first recommendation score.
6. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 5, characterized in that, In step 5, an adaptive weighted word frequency inverse document score calculation method is preset to calculate the second recommendation score for users and products, specifically including: BM25 was selected as the adaptive weighted term frequency inverse document score calculation method to calculate the product recommendation score for the user, with user U as the reference. i And Product I j For example: in, User U i Click on product I j The number of times, parameter k1 is used for weighting, and parameter B is used to control the degree of influence of length normalization on the result. In this method, k1 = 80 and B = 0.5; During the calculation process, the adaptive weight adjustment method in step 2 is used to dynamically adjust the click behavior values: Adjusted The calculation method is as follows: in, This refers to the second recommendation score from users and products.
7. The product recommendation method based on adaptive weight adjustment and dual-path compensation according to claim 6, characterized in that, In step 6, the preset compensation recommendation method merges the first recommendation score and the second recommendation score to obtain a third recommendation score, specifically including: For user U i And Product I j The default compensation recommendation method is: The weight parameter ω1 is adjusted based on user activity. User U i Average daily online time over the past month: If the average daily online time over the past month is greater than 10 minutes, the recent preference recommendation score will be increased. The impact on the final recommendation score is determined by ω1 being 0.6; conversely, a smaller ω1 increases the long-term preference recommendation score. The impact on the final recommended score, i.e., ω1 is set to 0.
4. For product I j For user U i The third recommended score. Step 6 also includes using the purchase behavior data of the binary pair (U i ,I j Construct a training set D1, where item I j For user U i Positive examples; randomly select n items I from other items. y Composition of user U i Given the negative example set D2, the loss function is defined as: Where |D1| represents the number of training examples D1, and |D2| represents the number of negative examples D2. The training objective is to minimize the objective function loss, where all parameters in the objective function loss are updated through a combination of backpropagation and stochastic gradient descent.