Commodity recommendation method based on complex space information aggregation
By constructing a knowledge graph in a complex space and integrating multiple scoring mechanisms, the problems of data sparsity and interpretability in existing product recommendation methods are solved, achieving high-precision and highly interpretable product recommendations.
Patent Information
- Application Number
- CN202511384841.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-09-26
AI Technical Summary
Existing product recommendation methods suffer from data sparsity and lack of interpretability, resulting in low recommendation accuracy and an inability to effectively capture users' potential preferences for products.
By constructing a user-product database as a knowledge graph, and utilizing complex space mapping and attention mechanisms, high-quality entity embedding vectors and relation embedding vectors are generated. The model is then optimized by combining a rotational scoring function and a soft-boundary loss function, and recommendations are made by fusing dot product scoring and triplet scoring.
It improves the accuracy and interpretability of product recommendations, captures users' potential preferences for products, reduces information loss, and enhances the accuracy of the recommendation system.
Smart Images

Figure CN120876044A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a product recommendation method based on complex spatial information aggregation. Background Technology
[0002] In the digital age, e-commerce platforms have become an indispensable part of daily life, allowing people to browse product information and purchase items of interest. Product recommendation refers to using technology to analyze user interests and preferences, accurately identifying products that users are truly interested in from a vast array of goods, thereby improving the user's shopping experience, enhancing user stickiness, increasing e-commerce platform sales, and driving the economic development of related enterprises.
[0003] Existing product recommendation methods typically map users and items into a vector space, obtaining their respective embedding vectors. These embedding vectors are then optimized through representation learning to capture the latent associations between users and items. Finally, recommendations are made using the dot product of the user and item embedding vectors. Despite significant progress in existing product recommendation methods, two problems remain. First, the sparsity of product recommendation data leads to low recommendation accuracy. Second, directly using the dot product of user and item embedding vectors as the basis for recommendations lacks interpretability and can lose information about users' latent preferences for products, further reducing recommendation accuracy and potentially causing user churn.
[0004] Therefore, there is a need for a product recommendation method that can alleviate data sparsity, capture users' potential preferences for products, and achieve high accuracy. Summary of the Invention
[0005] In view of this, the present invention provides a product recommendation method based on complex spatial information aggregation, which can alleviate data sparsity, capture users' potential preferences for products, and improve the accuracy of product recommendations.
[0006] A product recommendation method based on complex spatial information aggregation includes: Step S1: Read the user-product database and construct a knowledge graph in the form of head entity-relationship-tail entity triples; Step S2: Obtain the initial entity embedding vector and the initial relation embedding vector through complex space mapping and random initialization; Step S3: Concatenate the initial entity embedding vector and the initial relation embedding vector in the form of triples in the knowledge graph to obtain triple vectors; For each entity, use the attention mechanism in the complex space to assign weights to all triple vectors related to the entity, and sum the triple vectors related to the entity by weight to obtain the updated entity embedding vector, and then combine it with the initial entity embedding vector to obtain the entity embedding vector after aggregating information. Step S4: Combine the initial relation embedding vector and the entity embedding vector after information aggregation according to the existing triplet form in the knowledge graph, use the rotation scoring function to score the combined triplet, and use the soft boundary loss function to calculate the loss value to obtain the final entity embedding vector and the final relation embedding vector. Step S5: Split the final entity embedding vector into user embedding vector and product embedding vector, and find the purchase relationship embedding vector from the final relationship embedding vector; obtain the product's dot product score based on the product embedding vector and the target user embedding vector; concatenate the product embedding vector, the target user embedding vector, and the purchase relationship embedding vector to form a recommendation triple vector; obtain the product's interaction score based on the recommendation triple vector; obtain the product's recommendation score based on the dot product score and the interaction score; and recommend the product to the user based on the recommendation score.
[0007] The product recommendation method based on complex spatial information aggregation provided by the present invention has the following beneficial effects: (1) The present invention has a smaller modeling information loss: Traditional methods often map the knowledge graph to Euclidean space after the shopping network is transformed into a knowledge graph, resulting in a large information loss. This method maps the knowledge graph to complex space and retains more information through the additional parts brought by complex numbers.
[0008] (2) The user embedding and product embedding of the present invention have high quality: Due to the sparsity of data, the product itself contains less information, resulting in low embedding quality in the recommendation system. The present invention constructs a knowledge graph, models products and users as entities in the knowledge graph, and uses a complex space attention mechanism to more accurately assign weights to the triples related to each entity, thereby capturing higher quality triple information and learning more comprehensive user embedding and product embedding representations, which helps to alleviate the problem of low product recommendation accuracy caused by data sparsity.
[0009] (3) The product recommendation accuracy of this invention is high and its interpretability is strong: Existing recommendation systems usually map users and items into a vector space to obtain their respective embedding vectors, then optimize the embedding vectors through representation learning, and finally use the dot product of the user embedding vector and the item embedding vector for recommendation. The simple dot product ignores the user's potential preferences for the product. This method adds the user-purchase-product triple score as the basis for recommendation. By fusing the dot product score and the triple score, it captures the user's potential preferences for the product, further improving the accuracy of product recommendation and enhancing interpretability.
[0010] In summary, this invention improves the quality of product and user embedding by aggregating complex spatial information and adding triplet scores as the basis for recommendations. It captures users' potential preferences for products, which not only improves the accuracy of product recommendations but also enhances the interpretability of the recommendations, enabling more accurate product recommendations for users. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating the product recommendation method based on complex spatial information aggregation provided in an embodiment of the present invention. Detailed Implementation
[0012] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.
[0013] Please see Figure 1 The embodiments of the present invention provide a product recommendation method based on complex spatial information aggregation, including steps S1-S5: Step S1: Read the user-product database and construct a knowledge graph in the form of head entity-relationship-tail entity triples.
[0014] Specifically, using the head entity-relationship-tail entity triplet Constructing knowledge graphs in the form of , , and These are the entity set and the relation set, ; and Representing entities, one of which is a user and the other is a product; , Represent the relationships between entities, and then partition the set of positive sample triples. and negative sample triple set .
[0015] Step S2: Obtain the initial entity embedding vector and the initial relation embedding vector through complex space mapping and random initialization.
[0016] Specifically, step S2 includes: Step S21: Set the real and imaginary dimensions of the entity embedding vector and obtain the initial entity embedding vector through random initialization; Step S22: Set the real and imaginary dimensions of the relation embedding vector, and apply a modulus constraint to each dimension, limiting the modulus of each dimension of the relation embedding vector to 1. Obtain the initial relation embedding vector through random initialization. The real part of each dimension of the initial relation embedding vector is... The imaginary part of each dimension is , It is a randomly generated angle value.
[0017] Step S3: Concatenate the initial entity embedding vector and the initial relation embedding vector in the form of triples in the knowledge graph, and then learn the features to obtain triple vectors. For each entity, use the attention mechanism in the complex space to assign weights to all triple vectors related to the entity, and sum the triple vectors related to the entity by weight to obtain the updated entity embedding vector. Then, perform a residual connection between the updated entity embedding vector and the initial entity embedding vector to obtain the entity embedding vector after aggregating information.
[0018] Specifically, step S3 includes: Step S31: Concatenate the initial entity embedding vector and the initial relation embedding vector according to the existing triplet form in the knowledge graph, and then multiply them with the parameter matrix to obtain the triplet vector, expressed as:
[0019] in, Indicates the entity by head Embedded vector ,relation Embedded vector Tail-end entity Embedded vector The triplet vector formed by the three elements and These represent the real and imaginary parts of the corresponding vector or matrix, respectively. This represents the first learnable parameter matrix, used to learn the information present in the triples; This indicates a vector concatenation operation; Step S32: Based on the obtained triplet vectors, weights are assigned to all triplet vectors related to the entity by performing complex multiplication of the triplet vectors with the parameter matrix and taking the real part. Then, the weights are normalized to obtain the relative attention weights of the triplets, expressed as:
[0020]
[0021] in, Is with The relative attention weights of the relevant triple vectors, It is a physical entity Embedded vector, Is with The absolute attention weights for the triple vectors, Indicates all with The relevant weights are normalized. It is an activation function used to increase the non-linear characteristics of neural networks; This represents the second learnable parameter matrix, obtained by... Perform complex multiplication operations on triple vectors They are assigned corresponding attention weights; Step S33: Using the obtained relative attention weights, the triple vectors related to the entity are weighted and summed to obtain the updated entity embedding vector, expressed as:
[0022] in, This represents the updated entity embedding vector. It is the sigmoid activation function, used to increase the non-linear characteristics of neural networks; Step S34: Multiply the initial entity embedding vector by a parameter matrix, then add it to the updated entity embedding vector, and perform a residual join to obtain the entity embedding vector after aggregation. The expression is:
[0023] in, This represents the entity embedding vector after aggregating information. It is the third learnable parameter matrix, used to learn information from the initial entity embedding vector.
[0024] Step S4: Combine the initial relation embedding vector and the entity embedding vector after information aggregation according to the existing triplet form in the knowledge graph. Use the rotation scoring function to score the combined triplet and use the soft boundary loss function to calculate the loss value to obtain the final entity embedding vector and the final relation embedding vector.
[0025] Specifically, step S4 includes: Step S41: Combine the initial relation embedding vector and the entity embedding vector after aggregation information according to the existing triplet form in the knowledge graph, use a rotation scoring function for scoring, and learn relation pattern information. The relation pattern information is represented in the relation embedding vector, and the expression is:
[0026] in, This represents the encoder's scoring function. Represents the Hadamard product. Represents the L1 norm; Step S42: Define a loss function for the scoring function, update the learnable parameters by minimizing the loss function, and obtain the final entity embedding vector and the final relation embedding vector after training. The loss function is as follows:
[0027] in, Let be the loss function of the encoder. This represents a positive sample triple. It is by Negative sample triples obtained by replacing the head or tail entity. Indicates boundary value hyperparameters, In knowledge graph The set of positive sample triples divided from the sample, In knowledge graph The set of negative sample triples divided from the data. This indicates taking the maximum value.
[0028] Step S5: The final entity embedding vector is split into user embedding vector and product embedding vector, and the purchase relationship embedding vector is found from the final relationship embedding vector; the product embedding vector and the target user embedding vector are multiplied by a dot product to obtain the product's dot product score; the product embedding vector is concatenated with the target user embedding vector and the purchase relationship embedding vector to form a recommendation triple vector, and the interaction score of the product is obtained by scoring the recommendation triple vector through a scoring function. The dot product score and the interaction score are weighted and fused to obtain the product's recommendation score, and the product is recommended to the user based on the recommendation score.
[0029] Specifically, step S5 includes: Step S51: Split the final entity embedding vector into user embedding vector and product embedding vector, and find the purchase relationship embedding vector from the final relationship embedding vector. Step S52: Perform a complex dot product between the product embedding vector and the target user embedding vector to obtain the product's dot product score, expressed as:
[0030] in, For goods The dot product score, For goods The product embedding vector, Embed vectors for target users, The complex dot product refers to multiplying two vectors and taking the real part of each dimension as the dot product score. Through the complex dot product, we can further capture the interaction information between users and items. Step S53, sequentially arrange the goods Product embedding vector Embedded vectors of target users Purchase relationship embedding vector Concatenating the vectors yields the recommended triplet vector. ,pass A one-dimensional complex convolution kernel is used to recommend triple vectors. Perform complex convolution operations to obtain the product images from various viewpoints. The triplet feature vectors are obtained, and then the triplet feature vectors from each perspective are concatenated to obtain the total triplet feature vector. The expression is:
[0031]
[0032] in, Indicates the first One convolutional kernel, , , , They represent the 1st, 2nd, and 3rd respectively. The, the Triple feature vectors from various perspectives From 1 to Integers between [a certain number] Represents the complex convolution operation; Step S54, convert the triplet feature vector Perform complex matrix multiplication with the parameter matrix and take the real part to obtain the product. Interactive rating The expression is:
[0033] in, This represents the fourth learnable parameter matrix, used to evaluate the rationality of the recommended triples; Step S55, place the goods dot product score and interaction rating By performing weighted fusion, the product is obtained. Recommended score The expression is:
[0034] in, This represents the weight value of the dot product score. Indicates the weight value of the interaction rating; Step S56: Recommend products to the user based on the recommendation score.
[0035] Specifically, step S56 includes: Sort all products in descending order of recommendation score, select the top N products with the highest recommendation scores, and push them to the user.
[0036] In summary, the product recommendation method based on complex spatial information aggregation according to the above embodiments has the following beneficial effects: (1) The present invention has a smaller modeling information loss: Traditional methods often map the knowledge graph to Euclidean space after the shopping network is transformed into a knowledge graph, resulting in a large information loss. This method maps the knowledge graph to complex space and retains more information through the additional parts brought by complex numbers.
[0037] (2) The user embedding and product embedding of the present invention have high quality: Due to the sparsity of data, the product itself contains less information, resulting in low embedding quality in the recommendation system. The present invention constructs a knowledge graph, models products and users as entities in the knowledge graph, and uses a complex space attention mechanism to more accurately assign weights to the triples related to each entity, thereby capturing higher quality triple information and learning more comprehensive user embedding and product embedding representations, which helps to alleviate the problem of low product recommendation accuracy caused by data sparsity.
[0038] (3) The product recommendation accuracy of this invention is high and its interpretability is strong: Existing recommendation systems usually map users and items into a vector space to obtain their respective embedding vectors, then optimize the embedding vectors through representation learning, and finally use the dot product of the user embedding vector and the item embedding vector for recommendation. The simple dot product ignores the user's potential preferences for the product. This method adds the user-purchase-product triple score as the basis for recommendation. By fusing the dot product score and the triple score, it captures the user's potential preferences for the product, further improving the accuracy of product recommendation and enhancing interpretability.
[0039] In summary, this invention improves the quality of product and user embedding by aggregating complex spatial information and adding triplet scores as the basis for recommendations. It captures users' potential preferences for products, which not only improves the accuracy of product recommendations but also enhances the interpretability of the recommendations, enabling more accurate product recommendations for users.
[0040] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A product recommendation method based on complex spatial information aggregation, characterized in that, include: Step S1: Read the user-product database and construct a knowledge graph in the form of head entity-relationship-tail entity triples; Step S2: Obtain the initial entity embedding vector and the initial relation embedding vector through complex space mapping and random initialization; Step S3: Concatenate the initial entity embedding vector and the initial relation embedding vector in the form of triples in the knowledge graph to obtain triple vectors; For each entity, use the attention mechanism in the complex space to assign weights to all triple vectors related to the entity, and sum the triple vectors related to the entity by weight to obtain the updated entity embedding vector, and then combine it with the initial entity embedding vector to obtain the entity embedding vector after aggregating information. Step S4: Combine the initial relation embedding vector and the entity embedding vector after information aggregation according to the existing triplet form in the knowledge graph, use the rotation scoring function to score the combined triplet, and use the soft boundary loss function to calculate the loss value to obtain the final entity embedding vector and the final relation embedding vector. Step S5: Split the final entity embedding vector into user embedding vector and product embedding vector, and find the purchase relationship embedding vector from the final relationship embedding vector; obtain the product's dot product score based on the product embedding vector and the target user embedding vector. The product embedding vector, target user embedding vector, and purchase relationship embedding vector are concatenated to form a recommendation triple vector. The interaction score of the product is obtained based on the recommendation triple vector. The recommendation score of the product is obtained based on the dot product score and the interaction score. Products are recommended to users based on the recommendation score.
2. The product recommendation method based on complex spatial information aggregation according to claim 1, characterized in that, Step S1 specifically includes: Read the user-product database, using the head entity-relationship-tail entity triple. Constructing knowledge graphs in the form of , , and These are the entity set and the relation set, ; and Representing entities, one of which is a user and the other is a product; , It represents the relationship between entities.
3. The product recommendation method based on complex spatial information aggregation according to claim 2, characterized in that, Step S2 specifically includes: Step S21: Set the real and imaginary dimensions of the entity embedding vector and obtain the initial entity embedding vector through random initialization; Step S22: Set the real and imaginary dimensions of the relation embedding vector, and apply a modulus constraint to each dimension, limiting the modulus of each dimension of the relation embedding vector to 1. Obtain the initial relation embedding vector through random initialization. The real part of each dimension of the initial relation embedding vector is... The imaginary part of each dimension is , It is a randomly generated angle value.
4. The product recommendation method based on complex spatial information aggregation according to claim 2, characterized in that, Step S3 specifically includes: Step S31: Concatenate the initial entity embedding vector and the initial relation embedding vector according to the existing triplet form in the knowledge graph, and then multiply them with the parameter matrix to obtain the triplet vector, expressed as: in, Indicates the entity by head Embedded vector ,relation Embedded vector Tail-end entity Embedded vector The triplet vector formed by the three elements and Let these represent the real and imaginary parts of the corresponding vector or matrix, respectively. This represents the first learnable parameter matrix. This indicates a vector concatenation operation; Step S32: Based on the obtained triplet vectors, weights are assigned to all triplet vectors related to the entity by performing complex multiplication of the triplet vectors with the parameter matrix and taking the real part. Then, the weights are normalized to obtain the relative attention weights of the triplets, expressed as: in, Is with The relative attention weights of the relevant triple vectors, It is a physical entity Embedded vector, Is with The absolute attention weights for the triple vectors Indicates all with The relevant weights are normalized. It is an activation function. This represents the second learnable parameter matrix; Step S33: Using the obtained relative attention weights, the triple vectors related to the entity are weighted and summed to obtain the updated entity embedding vector, expressed as: in, This represents the updated entity embedding vector. It is the sigmoid activation function; Step S34: Multiply the initial entity embedding vector by a parameter matrix, then add it to the updated entity embedding vector, and perform a residual join to obtain the entity embedding vector after aggregation. The expression is: in, This represents the entity embedding vector after aggregating information. It is the third learnable parameter matrix.
5. The product recommendation method based on complex spatial information aggregation according to claim 4, characterized in that, Step S4 specifically includes: Step S41: Combine the initial relation embedding vector and the entity embedding vector after aggregation information according to the existing triplet form in the knowledge graph, use a rotation scoring function for scoring, and learn relation pattern information. The relation pattern information is represented in the relation embedding vector, and the expression is: in, This represents the encoder's scoring function. Represents the Hadamard product. Represents the L1 norm; Step S42: Define a loss function for the scoring function, update the learnable parameters by minimizing the loss function, and obtain the final entity embedding vector and the final relation embedding vector after training. The loss function is as follows: in, Let the loss function of the encoder be... This represents a positive sample triple. It is by Negative sample triples obtained by replacing the head or tail entity. Indicates boundary value hyperparameters, In knowledge graph The set of positive sample triples divided from the sample, In knowledge graph The set of negative sample triples divided from the data. This indicates taking the maximum value.
6. The product recommendation method based on complex spatial information aggregation according to claim 5, characterized in that, Step S5 specifically includes: Step S51: Split the final entity embedding vector into user embedding vector and product embedding vector, and find the purchase relationship embedding vector from the final relationship embedding vector. Step S52: Perform a complex dot product between the product embedding vector and the target user embedding vector to obtain the product's dot product score, expressed as: in, For goods The dot product score, For goods The product embedding vector, Embed vectors for target users, Represents the complex dot product; Step S53, sequentially arrange the goods Product embedding vector Embedded vectors of target users Purchase relationship embedding vector Concatenating the vectors yields the recommended triplet vector. ,pass A one-dimensional complex convolution kernel is used to recommend triple vectors. Perform complex convolution operations to obtain the product images from various viewpoints. The triplet feature vectors are obtained, and then the triplet feature vectors from each perspective are concatenated to obtain the total triplet feature vector. The expression is: in, Indicates the first One convolutional kernel, , , , They represent the 1st, 2nd, and 3rd respectively. The, the Triple feature vectors from various perspectives From 1 to Integers between [a certain number] Represents the complex convolution operation; Step S54, convert the triplet feature vector Perform complex matrix multiplication with the parameter matrix and take the real part to obtain the product. Interactive rating The expression is: in, This represents the fourth learnable parameter matrix; Step S55, place the goods dot product score and interaction rating By performing weighted fusion, the product is obtained. Recommended score The expression is: in, This represents the weight value of the dot product score. Indicates the weight value of the interaction rating; Step S56: Recommend products to the user based on the recommendation score.
7. The product recommendation method based on complex spatial information aggregation according to claim 6, characterized in that, Step S56 specifically includes: Sort all products in descending order of recommendation score, select the top N products with the highest recommendation scores, and push them to the user.
Citation Information
Patent Citations
Personalized recommendation method based on collaborative knowledge graph
CN112149004A
Intelligent question and answer method and system based on numerical control machine tool fault knowledge graph
CN116150337A
Multi-modal information enhancement recommendation method based on knowledge graph
CN118296226A
Quaternion-based graph neural network social recommendation method
CN120144881A
Method and device for recommending goods, method and device for training goods knowledge graph, and method and device for training model
US20240303507A1