Semantic perception recommendation method combining large model and knowledge graph

By combining large models and knowledge graphs to extract semantic features and structural features of users and projects, the problem that recommendation systems are difficult to utilize text data and noise data is solved, the performance and accuracy of recommendation systems are improved, and the user's intentions are achieved Granular modeling and capture of structural information.

CN119003787AActive Publication Date: 2024-11-22ZHEJIANG UNIV OF TECH

Patent Information

Application Number
CN202411129026.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-22
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Existing recommendation systems based on knowledge graphs are difficult to effectively utilize text data, and the presence of noisy data affects the accuracy of recommendations, and mainly relying on ID-based data cannot capture semantic information.

Method used

Using semantic perception recommendation method of joint big model and knowledge graph, learn fine-grained semantic features of users and projects from text data through big models, and use multi-layer graph attention network to learn higher-order structural features of user intention from structural data. , deeply fusion of the two features to improve recommended performance.

Benefits of technology

It realizes the extraction of accurate user and project features from text data, reveals user intentions, improves the performance and accuracy of the recommendation system, and effectively alleviates data sparseness and noise problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003787A_ABST
    Figure CN119003787A_ABST
Patent Text Reader

Abstract

The invention discloses a semantic perception recommendation method combining a large model and a knowledge graph. The method comprises the following steps: 1) constructing a collaborative semantic knowledge graph fusing interaction data, the knowledge graph and text data; 2) extracting semantic features of the user and the project from the associated text data of the knowledge graph by using a large model, and establishing semantic feature vectors of the user and the project; 3) learning high-order structural features based on user intention from the association path of the knowledge graph by using the multilayer graph attention network, and generating structural feature vectors of the user and the project; 4) performing deep fusion on the semantic feature vector and the structural feature vector to obtain high-quality feature representation of the user and the project; and 5) performing inner product operation on the feature representations of the user and the item, and predicting the item in which the user is interested. Semantic features and structural features of the user and the project are extracted simultaneously by combining the large model and the knowledge graph, and the accuracy of the recommendation system is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of knowledge graphs, big models, recommendation systems, and particularly provides a semantic-aware recommendation method that combines a big model with a knowledge graph. Background Art

[0002] With the rapid development of the Internet, data is growing exponentially. Users are facing serious information overload problems and find it difficult to select content of interest. Recommendation systems aim to provide users with personalized recommendation information to alleviate the impact of information overload, and have been widely used on network service platforms. Traditional recommendation systems based on collaborative filtering mainly use users' historical interaction data to make personalized recommendations based on the similarities between users or projects, but there are bottleneck problems of cold start and data sparsity. In recent years, researchers have deeply integrated user attributes, project attributes, and related information through knowledge graphs (KGs), and effectively alleviated the problems of data sparsity and cold start through a large amount of auxiliary information, which has become a research hotspot in the current recommendation field.

[0003] The knowledge graph provides rich structured semantic information for the recommendation system. Through a large amount of auxiliary information, it effectively alleviates the data sparsity and cold start problems faced by the traditional collaborative filtering recommendation system. It can be mainly divided into embedding-based recommendation models, path-based recommendation models and graph neural network-based recommendation models.

[0004] The embedding-based recommendation model learns the feature representation of each entity and relationship in a low-dimensional vector space through KG embedding to capture the complex relationships and attribute features between entities. CKE (ACM SIGKDD international conference, 2016) uses the TransR embedding method to extract the structural representation of the project, taking into account the heterogeneity of entities and relationships when embedding, and obtains accurate representations of users and projects. DKN (World Wide Web conference, 2018) combines word and entity embedding, uses TransD technology to perform multi-channel comprehensive representation of news content, and emphasizes the alignment of words and entities to enhance the consistency of information. KTUP (World Wide Web conference, 2019) uses KG's structured data to enhance the user's preference modeling for specific topics, and uses the TransH method to complete user-item interactions and triples. This type of recommendation model can effectively input the complete data representation into the recommendation system, but usually ignores the path relationship of KG and the association between multi-hop entities, and the recommendation results are not very interpretable.

[0005] Path-based recommendation models provide additional information to the recommendation process through multi-order paths from users to candidate items. These paths can be modeled through recurrent neural networks and attention mechanisms to predict user preferences. RippleNet (ACM international conference, 2018) assigns weights to each hop neighbor in the path according to the user's interaction history, propagates the user's clicked items through the links of KG, and then reveals the user's potential preferences. However, all propagation paths between a given user and an item may contain irrelevant paths, which will lead to the incorrect propagation of user preferences. To solve this problem, MEIRec (ACM SIGKDD international conference, 2019) uses predefined meta-paths to guide the aggregation of neighbor information and optimizes the accuracy of recommendations by precisely controlling the flow of information. PGPR (International ACMSIGIR conference, 2019) uses reinforcement learning to identify and optimize key user-item relationship paths in KG, guides path selection through a policy network, and directly affects the generation of recommendation decisions. This type of recommendation model can effectively capture the relationship path information on KG, but often ignores the overall structural information of the graph, and it also requires a high cost to accurately define or extract meta-paths.

[0006] The GNN-based recommendation model uses the multi-layer information aggregation mechanism of graph neural networks to collect information from neighbor nodes through the topological structure of KG and interaction graphs, which is used to update the representation of the central node and recursively propagate information between the layers of GNN. KGCN (International World Wide Web Conferences, 2019) captures the association between entities and their neighbors through graph convolution operations, effectively learning and updating the feature representation of entities. KGAT (ACM Knowledge Discovery and Data Mining, 2019) constructs the user-item graph and knowledge graph into a unified heterogeneous graph, and dynamically selects key nodes and connections in the graph through the attention mechanism, enhancing the accuracy and interpretability of recommendations. KGIN (The Web Conference, 2021) identifies the user's potential intention by analyzing the interaction between users and items, and aggregates the information in the graph on this basis to analyze the motivation of the user's shopping behavior. This type of recommendation model may have the problem of insufficient information extraction when locally aggregating node features, and its recommendation effect is greatly limited by the quality and coverage of the data used.

[0007] There are still two challenging issues in the existing knowledge graph-based recommendation system. On the one hand, the recommendation system mainly relies on ID-based data and cannot utilize the text data of KG. Text data contains rich explicit features of users and items, but the recommendation system cannot capture the semantic information. On the other hand, the ID-based data used by the recommendation system contains a large amount of implicit feedback, and its noise data (such as misclicks or popularity deviations) will affect the accuracy of recommendations. Summary of the invention

[0008] In view of the problems that existing recommendation systems based on knowledge graphs have difficulty in effectively utilizing text data and have noisy data, the present invention proposes a semantic-aware recommendation method that combines a large model and a knowledge graph. The semantic understanding ability of a large language model (LLM) is used to learn the fine-grained semantic features of users and items from the text data of KG, and a multi-layer graph attention network is used to learn high-order structural features about user intentions from the structural data of KG. The two features are then deeply fused into high-quality feature representations of users and items, thereby further improving the system performance of recommendations.

[0009] In order to solve the technical problem, the present invention adopts the following technical solution:

[0010] A semantic-aware recommendation method combining a large model and a knowledge graph includes the following steps:

[0011] 1) Build a collaborative semantic knowledge graph

[0012] Definition 1: Interaction data: In the recommendation scenario, let represents a set of M users, Represents a set of N items. User interactions on items, such as clicks, purchases, or views, are collected by implicit feedback and represented as a user-item interaction matrix Y∈R M×N , where y uv =1 means that user u interacts with item v, otherwise y uv =0;

[0013] Definition 2: Knowledge Graph: Knowledge graph stores real-world facts covering project attributes or external common sense knowledge in the form of heterogeneous graphs. Where h is the head entity, r is the relationship, and t is the tail entity. and is a collection of entities and relationships; in the recommendation scenario, an item Corresponding to an entity Building a Project - Entity Alignment Collection Where (v,z) represents the item v and the entity in the knowledge graph Alignment, which enables the knowledge graph to provide auxiliary information for interaction data;

[0014] Definition 3: Text data: Assume that user u interacts with k items. Based on the user-item interaction records, we use the original IDs of the user and item to collect the text comment data t of user u on all items in the original dataset. u , where t u ={c1,c2,...,c k}, collect text comments t of different users on project v v , text dataset where {t u ,t v}∈T;

[0015] Given the user-item interaction matrix Y, the knowledge graph Build a collaborative semantic knowledge graph with text data T;

[0016] 2) Extracting semantic features using large models

[0017] To ensure consistency and quality of information, users and projects design prompt templates and Guide LLM to generate high-quality semantic information. LLM generates user and project profiles in a specific format based on the prompt template. The user profile includes the type and characteristics of user preferences, and the project profile includes the type, advantages, disadvantages, and recommendation reasons of the project.

[0018] Text review data for each user or item or Input into LLM, and use LLM's contextual understanding ability and extensive database resources to enhance massive text data and generate personalized user profiles u and project profiles v , LLM uses text data to enhance semantic information in the form of:

[0019]

[0020] Get user profiles u and project profiles v Finally, in order for the recommendation system to effectively utilize semantic information, a semantic encoder is used to convert s u and v Converted into an embedding vector:

[0021]

[0022] in is the semantic feature representation of user u; is the semantic feature representation of item v; is the OpenAIEmbedding text embedding model; MLP(·) is a multi-layer perceptron, which is used to unify the length of the semantic feature vector;

[0023] The text embedding model aims to convert text information into a dense vector of fixed length. The converted vector not only reflects the semantic content of the text, but also ensures that semantically similar texts have similar vector representations in the embedding space. Through large-scale pre-training and optimization, the OpenAI Embedding model can provide richer and deeper text semantic representations, laying the foundation for subsequent recommendation systems to utilize semantic information.

[0024] 3) Extract structural features using multi-layer graph attention networks;

[0025] 4) Fusion of semantic features and structural features

[0026] The semantic features and structural features extracted above have different embedding vector spaces and cannot be directly fused. It is necessary to map these two features into a common vector space and use the comparative modeling method to map the structural features. and semantic features Perform bidirectional alignment, where The calculation formula is:

[0027]

[0028] Where sim(·) represents the cosine similarity, σ ↓ is a multi-layer perceptron, used to Map to The feature space of

[0029] During the alignment process, and As positive sample pairs, these positive sample pairs are brought close to each other through model training to achieve bidirectional feature alignment, thereby obtaining the embedded vector e after the fusion of user and item u and e v :

[0030]

[0031] 5) Model training

[0032] Perform the inner product operation on the embedding vectors of the user and item obtained above to predict the possibility of user u purchasing item v in The definition is as follows:

[0033]

[0034] The Bayesian Personalized Ranking (BPR) loss function is used to model the positive and negative samples of user interactions. Assuming that user u has interacted with item v, it is assumed that user u prefers item v rather than other items j without interaction. The BPR loss function is expressed as:

[0035]

[0036] in is a training dataset consisting of observed positive sample pairs (u, v) and unobserved negative sample pairs (u, j), and σ(·) is the sigmoid function;

[0037] In addition, the loss function for the fusion of semantic features and structural features is defined as:

[0038]

[0039] in is the negative sample semantic representation of sample n;

[0040] The overall loss function of the training model consists of the BPR loss function, the feature fusion loss function, and the regularization loss function:

[0041]

[0042] in are the parameters of the model; λ1 and λ2 are the control feature fusion loss functions and two parameters of the regularized loss function;

[0043] Recommend personalized items to users based on the above-trained semantic-aware recommendation model.

[0044] Further, the process of step 3) is as follows:

[0045] (3.1) User Intention Modeling

[0046] User intent refers to the reason why users choose items, reflecting the commonality of all user behaviors. Different intentions model different user behavior patterns. User intent is modeled through relationship combinations. Different relationship combinations can model different intentions to express fine-grained user-item relationships. Therefore, an attention mechanism is used to assign a representation to each intent i∈I in the knowledge graph. The embedding representation of user intent is:

[0047]

[0048] where e ris the embedding representation of relation r, α(r,i) is the attention coefficient of relation r, and each relation is assigned an attention score to distinguish its importance in the knowledge graph. The calculation formula is:

[0049]

[0050] where w ri is a trainable weight for a specific relationship r and intention i;

[0051] (3.2) Aggregate User Representation

[0052] The first-order connected set of user u can be defined as Where i represents user intent and v represents item. Based on this set, the embedding vector of user u is calculated:

[0053]

[0054] in is the first-order embedding vector of user u, is the initial embedding vector of item v, ⊙ represents the element-wise product, β(u,i) is the attention coefficient of different user intentions i, and the calculation formula is:

[0055]

[0056] in is the initial embedding vector of user u;

[0057] The above formulas (5) and (6) embed different user intentions into the user's embedding vector to enhance the important role of user intention in user representation;

[0058] (3.3) Aggregate Item Representation

[0059] There are different relational connections between items and entities, and the similarity between items is obtained through different relationship combinations and connected entities;

[0060] The first-order connected set of item v is defined as Where r represents a relationship and z represents an entity. Based on this set, the embedding vector of item v is calculated:

[0061]

[0062] in is the first-order embedding vector of item v, is the initial embedding vector of entity z;

[0063] Similarly, the first-order connected set of entity z is defined as Based on this set, calculate the embedding vector of entity z:

[0064]

[0065] in is the first-order embedding vector of entity z;

[0066] (3.4) Multi-layer aggregation feature output

[0067] By aggregating the first-order embedding vectors of users, items, and entities, their high-order embedding vectors are obtained. This aggregation method can not only capture the direct relationship between users and items, but also capture the indirect relationship on the relationship path, thereby extracting structural features based on user intentions. The calculation formula is:

[0068]

[0069] in, Represent the embedding vectors of user u, item v, and entity z in (l-1) hops respectively;

[0070] The comprehensive structural features of user u and item v are calculated by accumulating the embedding vectors of different hops:

[0071]

[0072] The model can encode complex user intentions and structural information into low-dimensional embedding vectors, and control the depth and breadth of information aggregation through the number of hops. The beneficial effects of the present invention are as follows: the semantic-aware recommendation system of the joint large model and knowledge graph provided by the present invention uses the contextual understanding ability of LLM to extract semantic features from text data, and accurately models users and projects at a fine-grained level; uses a multi-layer graph attention network to learn high-order structural features containing user intentions from structural data, and reveals the relationship between users and projects at the intention level; deeply integrates semantic features and structural features to obtain high-quality feature representations of users and projects, effectively improving recommendation performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 This is a block diagram of the principle of the semantic-aware recommendation method that combines a large model and a knowledge graph.

[0074] Figure 2 It is a user profile generated based on LLM. DETAILED DESCRIPTION

[0075] The specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.

[0076] Reference Figure 1 and Figure 2 , a semantic-aware recommendation method combining a large model and a knowledge graph, comprising the following steps:

[0077] 1) Build a collaborative semantic knowledge graph

[0078] Extract the interaction between users and items from the user's historical interaction data and construct the interaction relationship (u,i), where u represents the user and i represents the item. Obtain all the interaction data and represent it as the user-item interaction matrix Y∈R M×N , where y uv =1 means that user u interacts with item v, otherwise y uv =0, in the example of the present invention, the recommended item is books, the original data set is the Amazon-Book data set, the interaction data contains 9696 user nodes, 9848 item nodes, and the number of interaction edges is 176457;

[0079] Define the knowledge graph based on the attributes and semantic information of the project Where h is the head entity, r is the relationship, and t is the tail entity. Build an item-entity alignment set Where (v,z) represents the alignment of item v and entity z in the knowledge graph. In the example of the present invention, the knowledge graph contains 88,573 entity nodes and 2,557,746 triples;

[0080] In the original dataset Amazon-Book, according to the ID of the user or item, the text review data {c1,c2,...,c k}, after preprocessing the data, the corresponding text content is obtained or in is the user u’s comments on all his interactive products, is the comments after different users and items v interact, text dataset in

[0081] Given the user-item interaction matrix Y, the knowledge graph and text data T to build a collaborative semantic knowledge graph, such as Figure 1 As shown on the left;

[0082] 2) Extracting semantic features using large models

[0083] by Figure 2 Take the LLM enhanced user review information in as an example, c1, c2 and c3 are user u1's reviews of all purchased books. These review data are preprocessed and written into the same file, that is, Then, design prompt templates for user and project information enhancement respectively and User Profile The form of Figure 2As shown in the "Prompt Template" in the project prompt template The format is similar to that of the user profile; the user profile contains a summary of the types of items the user likes and shopping preferences, and the item profile contains a summary of the item type, advantages, disadvantages, and reasons for recommending the item;

[0084] The comment text for each user and item Enter into LLM in sequence and enter the prompt template at the same time LLM is used to semantically enhance massive text data and generate personalized user profiles u and project profiles v , User Profiles u and project profiles v Contains accurate preferences and characteristics;

[0085] In order for the recommendation system to effectively utilize semantic information, a semantic encoder is used to convert s u and v Encoded into the form of embedded vectors, where the semantic encoder uses the OpenAI Embedding model, and the generated semantic feature representations of users and items are and

[0086] Since different text embedding models generate feature vectors of different lengths, a multi-layer perceptron (MLP) is used to convert the semantic feature vector into a form consistent with the length of the structural feature vector.

[0087] 3) Use a multi-layer graph attention network to extract structural features. The process is as follows:

[0088] (3.1) User Intention Modeling

[0089] Different intentions represent different driving forces for users to interact with items. Users driven by similar intentions will have preferences for similar items. User intentions are generated by relationship modeling, such as Figure 1 In the example, the user u1 has an intention i, and u1 interacts with three project nodes. User u has k intentions, and the value of k is set to 4 in the method of the present invention;

[0090] Different combinations of relations will generate different intentions, so each relation is assigned an attention score α to distinguish its importance in the knowledge graph. Different intentions have different impacts on user behavior. In order to measure the weight of each intent, an attention mechanism is used to assign an embedding representation e to each intent i. i ;

[0091] (3.2) Aggregate User Representation

[0092] The first-order connectivity and user intention around user u are extracted, and the surrounding information is aggregated to obtain the representation of user u. represents the first-order connectivity and user intention around user u, Figure 1 Take user u1 as an example, Contains {(i1,v1),(i1,v2)…(i k ,v2),(i k ,v3)};

[0093] According to the user's interest in different products, the attention score β(u,i) is calculated. The attention score reflects the user's preference strength for different intentions. Then, the attention score β(u,i) is weighted element-wise multiplied with the features of the item to obtain the first-order embedding representation of user u.

[0094] In this way, the user representation not only contains the connection relationship with the items, but also reflects the user’s intention and interest in different items. For example, if intention i1 is higher than intention i k If the influence on user u1 is high, then the features of intention i1 will account for a larger proportion in the representation of user u1;

[0095] (3.3) Aggregate Item Representation

[0096] Extract the first-order connectivity around item v and aggregate the surrounding information to get the representation of item v. represents the first-order connectivity around item v, with Figure 1 Take project v1 as an example, Contains {(r1,e1),(r2,e2),(r3,e3)};

[0097] For each connection (r, z), we represent the relation r by its embedding e r and the embedding representation of entity z Perform element-wise multiplication and then average all concatenation results to obtain the first-order embedding representation of item v

[0098] (3.4) Multi-layer aggregation feature output

[0099] The core idea of ​​multi-layer aggregation layer is to aggregate the features of nodes with those of their neighboring nodes layer by layer through a recursive method, so as to capture higher-order connection relationships and feature information. Each layer of aggregation will expand on the basis of the previous layer, so that the node representation contains more information;

[0100] First, user u and item v have their own initial embedding representation and These representations are based on raw features or embeddings obtained from previous training;

[0101] For each layer l (from 1 to L, L is the total number of aggregation layers), the representations of users and items are calculated by formula (9). The user representation combines the user's previous layer representation, item embedding and intent representation, and the item representation is updated by aggregating the representations of its neighbor entities and relations;

[0102] After each layer l of aggregation, the representation of users and items will be updated and contain more high-level information. After L layers of aggregation, the final representation of users and items on the knowledge graph is and

[0103] 4) Fusion of semantic features and structural features

[0104] Both user and project nodes will receive two feature representations, namely semantic features and structural features. By combining structural features and semantic features, richer and more comprehensive user and project representations can be constructed;

[0105] Using the contrast modeling method in formula (11), the structural features and semantic features are aligned in both directions. In the alignment process, the structural features and semantic features are regarded as positive sample pairs. These positive sample pairs are brought closer to each other through model learning to align the two feature representations. Finally, the aligned fusion representation of user and item nodes is obtained: u and e v ;

[0106] 5) Model training

[0107] The user final vector and item final vector obtained above are input into formula (13) to predict the possibility of user u purchasing item v

[0108] Secondly, according to the loss function of formula (16), the interaction probability of positive samples is expanded Probability of interaction with negative samples The difference between them makes the calculated positive sample interaction probability approach the correct label, making the user and object vectors more accurate.

[0109] Then, the training process is continuously repeated to continuously reduce the loss of formula (16) so that the embedding representations of users and objects converge and the final embedding representations of users and objects are obtained.

[0110] Finally, the interaction probability is calculated based on the converged user and object embedding representations for recommendation.

[0111] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.

Claims

1. A semantic-aware recommendation method combining a large model and a knowledge graph, characterized in that: The method comprises the following steps: 1) Build a collaborative semantic knowledge graph Definition 1: Interaction data: In the recommendation scenario, let represents a set of M users, Represents a set of N items. User interactions on items, such as clicks, purchases, or views, are collected by implicit feedback and represented as a user-item interaction matrix Y∈R M×N , where y uv =1 means that user u interacts with item v, otherwise y uv =0; Definition 2: Knowledge Graph: Knowledge graph stores real-world facts covering project attributes or external common sense knowledge in the form of heterogeneous graphs. Where h is the head entity, r is the relationship, and t is the tail entity. and is a collection of entities and relationships; in the recommendation scenario, an item Corresponding to an entity Building a Project - Entity Alignment Collection Where (v,z) represents the item v and the entity in the knowledge graph Alignment, which enables the knowledge graph to provide auxiliary information for interaction data; Definition 3: Text data: Assume that user u interacts with k items. Based on the user-item interaction records, we use the original IDs of the user and item to collect the text comment data t of user u on all items in the original dataset. u , where t u ={c1,c2,...,c k }, collect text comments t of different users on project v v , text dataset where {t u ,t v }∈T; Given the user-item interaction matrix Y, the knowledge graph Build a collaborative semantic knowledge graph with text data T; 2) Extracting semantic features using large models To ensure consistency and quality of information, users and projects design prompt templates and Guide LLM to generate high-quality semantic information. LLM generates user and project profiles in a specific format based on the prompt template. The user profile includes the type and characteristics of user preferences, and the project profile includes the type, advantages, disadvantages, and recommendation reasons of the project. Text review data for each user or item or Input into LLM, and use LLM's contextual understanding ability and extensive database resources to enhance massive text data and generate personalized user profiles u and project profiles v , LLM uses text data to enhance semantic information in the form of: Get user profiles u and project profiles v Finally, in order for the recommendation system to effectively utilize semantic information, a semantic encoder is used to convert s u and v Converted into an embedding vector: in is the semantic feature representation of user u; is the semantic feature representation of item v; is the OpenAIEmbedding text embedding model; MLP(·) is a multi-layer perceptron, which is used to unify the length of the semantic feature vector; 3) Extract structural features using multi-layer graph attention networks; 4) Fusion of semantic features and structural features The structural features were analyzed by comparative modeling. and semantic features Perform bidirectional alignment, where The calculation formula is: Where sin(·) represents the cosine similarity, σ ↓ is a multi-layer perceptron, used to Map to The feature space of During the alignment process, and As positive sample pairs, these positive sample pairs are brought close to each other through model training to achieve bidirectional feature alignment, thereby obtaining the embedded vector e after the fusion of user and item u and e v : 5) Model training Perform the inner product operation on the embedding vectors of the user and item obtained above to predict the possibility of user u purchasing item v in The definition is as follows: The Bayesian Personalized Ranking (BPR) loss function is used to model the positive and negative samples of user interactions. Assuming that user u has interacted with item v, it is considered that user u prefers item v rather than other items j without interaction. The BPR loss function is expressed as: in is a training dataset consisting of observed positive sample pairs (u, v) and unobserved negative sample pairs (u, j), and σ(·) is the sigmoid function; In addition, the loss function for the fusion of semantic features and structural features is defined as: in is the negative sample semantic representation of sample n; The overall loss function of the training model consists of the BPR loss function, the feature fusion loss function, and the regularization loss function: in are the parameters of the model; λ1 and λ2 are the control feature fusion loss functions and two parameters of the regularized loss function; Recommend personalized items to users based on the above-trained semantic-aware recommendation model.

2. The semantic-aware recommendation method combining a large model and a knowledge graph as claimed in claim 1, characterized in that: The process of step 3) is as follows: (3.1) User Intention Modeling The attention mechanism is used to assign a representation to each intention i∈I in the knowledge graph, and the embedding representation of user intention is: where e r is the embedding representation of relation r, α(r,i) is the attention coefficient of relation r, and each relation is assigned an attention score to distinguish its importance in the knowledge graph. The calculation formula is: where w ri is a trainable weight for a specific relationship r and intention i; (3.2) Aggregate User Representation The first-order connected set of user u is defined as Where i represents user intent and v represents item. Based on this set, the embedding vector of user u is calculated: in is the first-order embedding vector of user u, is the initial embedding vector of item v, ⊙ represents the element-wise product, β(u,i) is the attention coefficient of different user intentions i, and the calculation formula is: in is the initial embedding vector of user u; The above formulas (5) and (6) embed different user intentions into the user's embedding vector to enhance the important role of user intention in user representation; (3.3) Aggregate Item Representation There are different relational connections between items and entities, and the similarity between items is obtained through different relationship combinations and connected entities; The first-order connected set of item v is defined as Where r represents a relationship and z represents an entity. Based on this set, the embedding vector of item v is calculated: in is the first-order embedding vector of item v, is the initial embedding vector of entity z; The first-order connected set of entity z is defined as Based on this set, calculate the embedding vector of entity z: in is the first-order embedding vector of entity z; (3.4) Multi-layer aggregation feature output By aggregating the first-order embedding vectors of users, items, and entities, their high-order embedding vectors are obtained. This aggregation method can not only capture the direct relationship between users and items, but also capture the indirect relationship on the relationship path, thereby extracting structural features based on user intentions. The calculation formula is: in, Represent the embedding vectors of user u, item v, and entity z in (l-1) hops respectively; The comprehensive structural features of user u and item v are calculated by accumulating the embedding vectors of different hops: The model is able to encode complex user intent and structural information into low-dimensional embedding vectors and control the depth and breadth of information aggregation through the number of hops.

Citation Information

Patent Citations

  • Personalized recommendation method based on knowledge graph

    CN112214685A

  • Content recommendation method based on semantic feature and knowledge feature fusion

    CN115659018A

  • Tourist route recommendation method based on large language model and knowledge graph

    CN117407606A

Cited By

  • Library inventory management method and system

    CN119228271A

  • Multi-dimensional fusion meta universe and vertical AI model collaborative innovation platform

    CN119443116A

  • Search recommendation task joint training method and system based on large language model

    CN120104862A

  • Automatic modeling agent system based on MCP protocol and large model

    CN120259557A

  • Big language model and knowledge graph collaborative inter-table relationship recommendation method and system

    CN121561114A