Personalized recommendation method and apparatus
Patent Information
- Application Number
- CN202511661161.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2045-11-12
AI Technical Summary
[0003]有鉴于此,本发明提供一种个性化推荐方法及装置,结合静态知识图谱和用户动态行为知识图谱,有效解决了传统知识图谱召回内容固定、非个性化的技术问题,提升用户的使用体验
[0071]由以上方案可知,本发明提供一种个性化推荐方法及装置,通过根据用户的查询信息加载静态知识图谱,得到静态嵌入矩阵,根据用户的标识加载用户动态行为知识图谱,得到行为嵌入矩阵和行为权重向量矩阵,并基于静态嵌入矩阵、所述行为嵌入矩阵和所述行为权重向量矩阵进行融合分析,有效地将用户动态行为知识图谱映射至静态知识图谱,生成反映用户特定兴趣的个性化的推荐结果,本发明结合静态知识图谱和用户动态行为知识图谱,有效解决了传统知识图谱召回内容固定、非个性化的技术问题,提升用户的使用体验。
Smart Images

Figure CN121502082B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a personalized recommendation method and apparatus. Background Technology
[0002] Currently, intelligent agents need to combine knowledge graph retrieval augmented generation (RAG) technology and knowledge graph recall to achieve relevant content retrieval. However, these recall methods only consider the static semantic relevance of the retrieved content. Different users asking the same question will receive the same retrieved content, failing to incorporate real-time user behaviors (such as viewing, saving, liking, and negative feedback within the platform), thus lacking personalization. For example, when users A and B search for "science fiction movies," they receive the same recommendations and summaries, failing to reflect individual preferences (e.g., A likes action science fiction, while B likes philosophical science fiction). In other words, the recommendation results in existing technologies lack dynamism and personalization, leading to inaccurate recommendations and significantly impacting the user experience. Summary of the Invention
[0003] In view of this, the present invention provides a personalized recommendation method and apparatus that combines static knowledge graphs and user dynamic behavior knowledge graphs, effectively solving the technical problems of fixed and non-personalized content recall by traditional knowledge graphs, and improving the user experience.
[0004] The first aspect of this invention provides a personalized recommendation method, comprising:
[0005] Receive user query information;
[0006] The static knowledge graph is loaded based on the user's query information to obtain a static embedding matrix. The user's dynamic behavior knowledge graph is loaded based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix.
[0007] A fusion matrix is generated based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix;
[0008] Based on the starting node and the fusion matrix, a fusion analysis result is generated; wherein the starting node is an entity in the user query information; the fusion analysis result includes multiple path information.
[0009] Based on the fusion analysis results and the user's query information, a recommendation result is generated.
[0010] Optionally, the construction process of the static knowledge graph includes:
[0011] Retrieve entity information from the database;
[0012] The large model is invoked, and preset prompts guide it to extract the relationships between entities in the entity information of the database.
[0013] By treating entities as nodes and the relationships between entities as edges, a static knowledge graph is generated.
[0014] Optionally, the update process of the user dynamic behavior knowledge graph includes:
[0015] When user behavior information is captured, the edge weights in the user dynamic behavior knowledge graph are updated based on the user behavior information; wherein, the user dynamic behavior knowledge graph is generated with the user node as the center, and nodes and edges related to the user node are added based on the user behavior information; the edge weights in the user dynamic behavior knowledge graph are generated based on user behavior weight, comment sentiment score, time decay factor and behavior occurrence timestamp.
[0016] Optionally, generating the fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix includes:
[0017] A similarity score matrix is generated based on the node embedding similarity between the static embedding matrix and the behavioral embedding matrix.
[0018] Based on the similarity score matrix, the attention probability between behavioral nodes and static nodes is determined;
[0019] The attention probability between behavioral nodes and static nodes is adjusted using the behavioral weight vector matrix to obtain the target attention probability between behavioral nodes and static nodes;
[0020] Based on the target attention probability between the behavior node and the static node, the updated static node is obtained, and the fusion matrix is generated based on the updated static node.
[0021] Optionally, generating the fusion analysis result based on the starting node and the fusion matrix includes:
[0022] An adjacency matrix is generated based on the fusion matrix, edge timestamps, and one-hot encoding of the starting node.
[0023] Starting from the initial node, multiple path information is obtained by exploring the adjacency matrix;
[0024] Calculate the link score between nodes in each path information, sort the path information according to the link score between nodes in the path information, and generate the fusion analysis results.
[0025] Optionally, generating recommendation results based on the fusion analysis results and the user's query information includes:
[0026] For each path information in the fusion analysis result, calculate the embedding similarity between the fusion embedding of the path information and the embedding of the user's query.
[0027] The path information is sorted according to the embedding similarity to obtain the recommendation results.
[0028] Optionally, the static knowledge graph also includes community summaries corresponding to community nodes, and the path information in the recommendation results is also associated with community summaries.
[0029] Optionally, the method for generating community summaries corresponding to community nodes in the static knowledge graph includes:
[0030] Community detection is performed on entities in the static knowledge graph to generate multiple communities;
[0031] For each community, a large model is invoked, and the model is guided by preset prompts to identify the node relationships between communities, and a community summary is output.
[0032] The community summary is stored in the metadata of the static knowledge graph as a node attribute.
[0033] Optionally, after generating the recommendation results based on the fusion analysis results and the user's query information, the method further includes:
[0034] The large model is invoked, and pre-set prompts guide it to perform natural language processing on the recommendation results to generate conversational recommendation results.
[0035] A second aspect of the present invention provides a personalized recommendation device, comprising:
[0036] The receiving unit is used to receive user query information;
[0037] The loading unit is used to load a static knowledge graph based on the user's query information to obtain a static embedding matrix, and to load a dynamic user behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix.
[0038] A fusion unit is configured to generate a fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix.
[0039] An analysis unit is used to generate a fusion analysis result based on the starting node and the fusion matrix; wherein the starting node is an entity in the user query information; and the fusion analysis result includes multiple path information.
[0040] The recommendation result generation unit is used to generate recommendation results based on the fusion analysis results and the user's query information.
[0041] Optionally, the personalized recommendation device further includes:
[0042] The entity information acquisition unit is used to acquire entity information from the database;
[0043] The large model invocation unit is used to invoke the large model and guide it to extract the relationships between entities in the entity information of the database through preset prompts.
[0044] The static knowledge graph generation unit is used to generate a static knowledge graph by using entities as nodes and the relationships between entities as edges.
[0045] Optionally, the personalized recommendation device further includes:
[0046] The dynamic behavior knowledge graph update unit is used to update the edge weights in the user dynamic behavior knowledge graph based on the user's behavior information when the user's behavior information is captured. The user dynamic behavior knowledge graph is generated by adding nodes and edges related to the user node based on the user's behavior information, with the user node as the center. The edge weights in the user dynamic behavior knowledge graph are generated based on user behavior weights, comment sentiment scores, time decay factors, and behavior occurrence timestamps.
[0047] Optionally, the fusion unit includes:
[0048] The similarity score matrix generation unit is used to generate a similarity score matrix based on the node embedding similarity between the static embedding matrix and the behavior embedding matrix.
[0049] An attention probability determination unit is used to determine the attention probability between behavioral nodes and static nodes based on the similarity score matrix.
[0050] The adjustment unit is used to adjust the attention probability between the behavior node and the static node using the behavior weight vector matrix to obtain the target attention probability between the behavior node and the static node.
[0051] The fusion matrix generation unit is used to obtain updated static nodes based on behavioral nodes and the target attention probability between behavioral nodes and static nodes, and to generate a fusion matrix based on the updated static nodes.
[0052] Optionally, the analysis unit includes:
[0053] The adjacency matrix generation unit is used to generate an adjacency matrix based on the fusion matrix, edge timestamps, and one-hot encoding of the starting node.
[0054] The path exploration unit is used to explore multiple path information in the adjacency matrix, starting from the starting node;
[0055] The link score calculation unit is used to calculate the link score between nodes in each path information, sort the path information according to the link score between nodes in the path information, and generate the fusion analysis results.
[0056] Optionally, the recommendation result generation unit includes:
[0057] An embedding similarity calculation unit is used to calculate the embedding similarity between the fusion embedding of the path information and the user's query embedding for each path information in the fusion analysis result.
[0058] The recommendation result generation subunit is used to sort the path information according to the embedding similarity to obtain the recommendation result.
[0059] Optionally, the static knowledge graph also includes community summaries corresponding to community nodes, and the path information in the recommendation results is also associated with community summaries.
[0060] Optionally, the personalized recommendation device further includes:
[0061] The community detection unit is used to perform community detection on entities in the static knowledge graph and generate multiple communities.
[0062] The large model invocation unit is also used to invoke the large model for each community, guide the large model to identify the node relationships between communities through preset prompts, and output a community summary.
[0063] A storage unit is used to store the community summary in the metadata of the static knowledge graph as a node attribute.
[0064] Optionally, the personalized recommendation device further includes:
[0065] The large model invocation unit is also used to invoke the large model, guiding it to perform natural language processing on the recommendation results through preset prompts to generate conversational recommendation results.
[0066] A third aspect of the present invention provides an electronic device, comprising:
[0067] One or more processors;
[0068] A storage device on which one or more programs are stored;
[0069] When the one or more programs are executed by the one or more processors, the one or more processors implement the personalized recommendation method as described in any one of the first aspects.
[0070] A fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the personalized recommendation method as described in any one of the first aspects.
[0071] As can be seen from the above scheme, the present invention provides a personalized recommendation method and apparatus. By loading a static knowledge graph based on the user's query information to obtain a static embedding matrix, and loading a user dynamic behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix, the present invention performs fusion analysis based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix, effectively mapping the user dynamic behavior knowledge graph to the static knowledge graph, generating personalized recommendation results that reflect the user's specific interests. The present invention combines static knowledge graph and user dynamic behavior knowledge graph, effectively solving the technical problems of fixed and non-personalized content recall in traditional knowledge graphs, and improving the user experience. Attached Figure Description
[0072] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0073] Figure 1 A detailed flowchart of a personalized recommendation method provided in an embodiment of the present invention;
[0074] Figure 2 A flowchart illustrating a method for generating a fusion matrix according to another embodiment of the present invention;
[0075] Figure 3 A flowchart illustrating a method for generating fusion analysis results, provided in another embodiment of the present invention;
[0076] Figure 4 A schematic diagram of a personalized recommendation device provided in another embodiment of the present invention;
[0077] Figure 5 This is a schematic diagram of an electronic device that implements a personalized recommendation method, according to another embodiment of the present invention. Detailed Implementation
[0078] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0079] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0080] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties.
[0081] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0082] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0083] This invention provides a personalized recommendation method, such as... Figure 1 As shown, the specific steps include:
[0084] S101, Receive user query information.
[0085] In the practical application of this invention, the user's query information can be voice information, text information, etc., and the user can input it on a mobile phone, personal computer, etc., without limitation.
[0086] It is understandable that if the voice information can be recognized by speech-to-text software, then this is not a limitation.
[0087] S102. Load the static knowledge graph based on the user's query information to obtain the static embedding matrix. Load the user's dynamic behavior knowledge graph based on the user's identifier to obtain the behavior embedding matrix and the behavior weight vector matrix.
[0088] Among them, the static knowledge graph can ensure that new content is stored in a timely manner through periodic offline updates. It should be noted that the static knowledge graph is used as a read-only resource, unaffected by user behavior, and supports multi-user sharing. Unlike the static retrieval of static content graphs or the persistent graph modification of MKGAT, this invention avoids write lock contention and maintains data isolation.
[0089] The user dynamic behavior knowledge graph can reflect the latest user preferences by incrementally updating the embedded nodes. Each user's user dynamic behavior knowledge graph is maintained independently without affecting other users or modifying the static knowledge graph, ensuring user isolation and supporting multi-user scenarios.
[0090] Specifically, Neo4j Cypher can be used to query user query information to obtain the corresponding static knowledge graph, and Redis.get(user_id) statement can be used to obtain the user dynamic behavior knowledge graph. No restrictions are imposed here.
[0091] In the practical application of this invention, the construction process of the static knowledge graph can be, but is not limited to, obtaining entity information from the database; then, calling the large model and guiding the large model to extract the relationships between entities in the entity information from the database through preset prompts; using entities as nodes and the relationships between entities as edges to generate a static knowledge graph, which is not limited here.
[0092] Among them, the construction of static knowledge graphs is based on structured data of the database content, and entities and relations can be represented by, but are not limited to, RDF triples.
[0093] Using video data as an example, we first retrieve entity information from the video database, including but not limited to program name, type, actors, directors, plot keywords, etc., without limitation. Here, "single" represents an entity (e.g., "program: XX"), and "edge" represents a relationship (e.g., "program-lead actor-lead actor name").
[0094] In the specific implementation of this invention, graph structures can be stored using, but are not limited to, graph databases (such as Neo4j). During construction, the graph is automatically generated through entity linking and relationship extraction algorithms (large models can be extracted through prompt word engineering). Embedded representations employ a vectorized model to pre-compute and store node vectors.
[0095] Among them, the vectorization model can support the conversion of text into vectors. It can use, but is not limited to, the open-source bge-m3 to support the conversion of text into 1024-dimensional vectors, and can use node names to calculate node vectors. There are no restrictions here.
[0096] In the practical application of this invention, the process of constructing a user dynamic behavior knowledge graph may include, but is not limited to, capturing user behavior information in real time; taking user nodes as the center, adding nodes and edges related to user nodes based on user behavior information to generate a user dynamic behavior knowledge graph, which is not limited here.
[0097] The edge weights in the user dynamic behavior knowledge graph are generated based on user behavior weights, comment sentiment scores, time decay factors, and behavior timestamps. The edge weights are updated when a behavior occurs; that is, when user behavior information is captured, the edge weights in the user dynamic behavior knowledge graph are updated based on the user behavior information.
[0098] It should be noted that the user dynamic behavior knowledge graph is built asynchronously based on multiple user behaviors. It can adopt, but is not limited to, event-driven mechanisms to construct and update the user dynamic behavior knowledge graph in real time. No limitation is made here.
[0099] In the actual application of this invention, user behavior includes, but is not limited to, interactive behavior (likes, comments, sharing, negative feedback, etc.), video viewing behavior (viewing duration, skipping segments, rewatching segments, etc.), and dialogue behavior (preferences expressed in chat, such as "I like science fiction movies"), etc., which are not limited here.
[0100] This section provides an example of adding nodes and edges related to a user node based on the user's behavior, centered around the user node. For instance, watching a video adds an edge "User-Watch-Program Name", with weights based on the viewing duration. Initially, the graph is empty. Behavioral events are processed through an asynchronous queue (such as Kafka) to construct a serialized graph or embedding vectors.
[0101] In the specific implementation of this invention, a user dynamic behavior knowledge graph can be used, but is not limited to a distributed key-value store (such as Redis). The user ID is used as the key to initialize an empty dynamic graph or an embedded vector (serialized format or 1024-dimensional vector). No limitation is made here.
[0102] In the specific implementation of this invention, it can be deployed as a stateless microservice, and a message queue (Kafka) can be integrated for asynchronous behavior updates. No limitation is made here.
[0103] By employing distributed key-value storage (such as Redis partitioning, with user ID as the key) and stateless services, different user dynamic behavior graphs are independently stored and asynchronously updated, supporting multi-user concurrency. This is superior to the centralized storage of MKGAT and RecKG, reduces scalability bottlenecks, and is suitable for multi-user scenarios in dialogue systems.
[0104] In the specific implementation of this invention, the edge weights can be updated using, but are not limited to, the following formula:
[0105] ;
[0106] in, It is the edge weight. It's the learning rate. It is a behavior weight (e.g., 1.0 for liking, -1.0 for disliking). It is the sentiment score for comments (which can be achieved by directly calling a large model with few-shot cue words, or by fine-tuning a large model, or by customizing an NLP classification model (not a large model). There are no restrictions here, and the range is [-1,1]). It is the fusion coefficient. It is the time decay factor. It is a behavior timestamp. Incrementally update the node embedding (computed using a pre-trained vector model), serialize and store it back to Redis.
[0107] It is understandable that the learning rate, fusion coefficient, and decay factor can be preset and modified by experts and technicians. The above is just an example and is not a limitation.
[0108] The user dynamic behavior knowledge graph of this invention incorporates time decay and negative feedback behavior suppression during updates, prioritizing recent behaviors and suppressing irrelevant content. Compared to SKGRec's simple behavior weighting or RecKG's static path mining, it effectively improves dynamism and personalization accuracy.
[0109] S103. Generate a fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix.
[0110] This invention generates a personalized fusion matrix based on a static embedding matrix, a behavior embedding matrix, and a behavior weight vector matrix. It combines static knowledge graphs and dynamic behavior knowledge graphs to achieve personalized recall. While considering static semantics, it also takes into account the user's personalized in-site behavior and dialogue responses, further incorporating user behavior time weights to effectively combine semantics and personalized content. This allows subsequent recommendation results to reflect the user's specific interests, significantly improving the personalization of video dialogue content and user satisfaction.
[0111] In the practical application of this invention, a generated fusion embedded copy can be generated as a temporary representation for subsequent queries without altering the original static knowledge graph.
[0112] Optionally, in another embodiment of the present invention, one implementation of step S103 is as follows: Figure 2 As shown, it includes:
[0113] S201. Generate a similarity score matrix based on the node embedding similarity in the static embedding matrix and the behavioral embedding matrix.
[0114] In the practical application of this invention, the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix can be represented as follows:
[0115] Static embedding matrix: ;
[0116] Behavioral embedding matrix: ;
[0117] Behavioral weight vector matrix: .
[0118] Specifically, the nodes in the behavior embedding matrix can be calculated using the following formula. Nodes in the static embedding matrix Similarity is used to generate an attention score matrix. :
[0119] ;
[0120] Among them, dot product Measuring semantic relevance It is a scaling factor (to prevent the value from being too large).
[0121] S202. Based on the similarity score matrix, determine the attention probability between behavioral nodes and static nodes.
[0122] In practical applications of this invention, the attention probability between behavioral nodes and static nodes can be determined using, but is not limited to, the following calculation formula. :
[0123] ;
[0124] It should be noted that it is necessary to ensure , representing a behavior node For static nodes attention, The range is 1~ , where is the local variable for summation.
[0125] S203. Adjust the attention probability between the behavior node and the static node using the behavior weight vector matrix to obtain the target attention probability between the behavior node and the static node.
[0126] This invention reflects dynamic behavior weights, such as boosting likes and suppressing negative feedback, by adjusting attention probabilities. This can be achieved through, but is not limited to, the following calculation formula:
[0127] ;
[0128] in, For target attention probability, Map the behavior weight vector matrix to a gain or inhibition factor, such as a like ( Enhance correlation, negative feedback ( Reduce attention.
[0129] S204. Based on the action nodes and the target attention probability between the action nodes and the static nodes, the updated static nodes are obtained, and a fusion matrix is generated based on the updated static nodes.
[0130] In the practical application of this invention, the updated static node can be obtained by moving, but is not limited to, the following formula. :
[0131] ;
[0132] ;
[0133] in, It is a behavior graph for static nodes Personalized adjustments, integration and embedding This is a temporary copy and does not modify the original static graph. After updating all static nodes, the final output is the fusion matrix. .
[0134] In the practical application of this invention, for negative feedback behavior ( Furthermore, it can suppress the embedding of related static nodes, ensuring that the weight of irrelevant nodes (such as types that users dislike) is limited, thereby reducing the recommendation probability.
[0135] ;
[0136] in, It can be pre-set and modified by experts, technicians, etc. The above is just an example and is not limited here.
[0137] S104. Generate fusion analysis results based on the starting node and fusion matrix.
[0138] The starting node is the entity in the user's query information; the fusion analysis results include multiple path information.
[0139] Optionally, in another embodiment of the present invention, one implementation of step S104 is as follows: Figure 3 As shown, it includes:
[0140] S301. Generate an adjacency matrix based on the fusion matrix, edge timestamps, and one-hot encoding of the starting node.
[0141] Specifically, edge weights can be calculated using, but are not limited to, the following formulas. And based on edge weights Generate adjacency matrix :
[0142] ;
[0143] in, It's sigmoid. It is the one-hot encoding of the starting node. It's a timestamp.
[0144] S302. Starting from the initial node, explore the adjacency matrix to obtain multiple path information.
[0145] The path information can be represented as actor A-program B-type C, without any limitation here.
[0146] In the practical application of this invention, multiple path information can be obtained by exploring the adjacency matrix through, but not limited to, breadth-first search (BFS). Specifically, the number of path information can be preset or modified by experts, technicians, etc., and is not limited here.
[0147] S303. Calculate the link score between nodes in each path information, sort the path information according to the link score between nodes in the path information, and generate the fusion analysis results.
[0148] In the practical application of this invention, the link score between nodes in the path information can be calculated using, but is not limited to, the following formula. :
[0149] ;in, It is the damping factor, which can be, but is not limited to, 0.15.
[0150] S105. Based on the fusion analysis results and the user's query information, generate recommendation results.
[0151] In the practical application of this invention, it may be possible, but is not limited to, calculating the embedding similarity between the fusion embedding of the path information and the user's query embedding for each path information in the fusion analysis result; then, sorting the path information according to the embedding similarity to obtain the recommendation result, which is not limited here.
[0152] The user's query embedding can be calculated using a pre-defined vectorized model.
[0153] The specific methods for calculating similarity can include, but are not limited to:
[0154] ;in, For query embedding.
[0155] In the practical application of this invention, community summaries can also be associated with the path information in the recommendation results. The community summaries can be generated during the construction of the static knowledge graph. In another embodiment of this invention, the generation method of the community summaries corresponding to community nodes in the static knowledge graph can be, but is not limited to, performing community detection on entities in the static knowledge graph to generate multiple communities; then, for each community, a large model is called, and the large model is guided by preset prompt words to identify the node relationships between communities and output the community summary; finally, the community summary is stored in the metadata of the static knowledge graph as a node attribute.
[0156] The community detection method can be implemented using, but is not limited to, methods such as the Leiden algorithm and spectral clustering; no specific method is specified here. For example, programs of the same type (such as historical dramas) and related entities can be clustered into a community.
[0157] Assuming there are K community nodes and the node relationships between communities are: type-historical drama, then the community summary output by the large model would be as follows: This community focuses on the interpretation of Tang Dynasty stories, with a focus on historical drama themes and inspirational narratives.
[0158] In the practical application of this invention, after generating recommendation results, a large model can be invoked. Preset prompts guide the model to perform natural language processing on the recommendation results, generating conversational recommendation results. For example: "Recommended: 'XXXX,' a period drama starring actors A and B, belonging to the Tang Dynasty historical inspirational drama genre. You might like it due to your recent preference for period dramas." Additionally, video content (cover + title) can be attached. By implementing personalized and interpretable content recommendations within the dialogue, the limitations of static semantic recall are overcome, significantly improving the personalization of video dialogue content and user satisfaction, thereby enhancing user stickiness and repeat purchase intentions.
[0159] As can be seen from the above scheme, the present invention provides a personalized recommendation method. By loading a static knowledge graph based on the user's query information to obtain a static embedding matrix, and loading a user dynamic behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix, the present invention performs a fusion analysis based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix, effectively mapping the user dynamic behavior knowledge graph to the static knowledge graph, generating personalized recommendation results that reflect the user's specific interests. The present invention combines static knowledge graphs and user dynamic behavior knowledge graphs, effectively solving the technical problems of fixed and non-personalized content recall in traditional knowledge graphs, and improving the user experience.
[0160] Another embodiment of the present invention provides a personalized recommendation device, such as... Figure 4As shown, it specifically includes:
[0161] The receiving unit 401 is used to receive user query information.
[0162] The loading unit 402 is used to load a static knowledge graph based on the user's query information to obtain a static embedding matrix, and to load a dynamic user behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix.
[0163] Optionally, in another embodiment of the present invention, one implementation of the personalized recommendation device further includes:
[0164] The entity information acquisition unit is used to acquire entity information from the database.
[0165] The large model invocation unit is used to invoke large models, guiding them to extract relationships between entities from entity information in the database using preset prompts.
[0166] The static knowledge graph generation unit is used to generate a static knowledge graph by using entities as nodes and the relationships between entities as edges.
[0167] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0168] Optionally, in another embodiment of the present invention, one implementation of the personalized recommendation device further includes:
[0169] The dynamic behavior knowledge graph update unit is used to update the edge weights in the user's dynamic behavior knowledge graph based on the captured user behavior information.
[0170] Among them, the user dynamic behavior knowledge graph is generated by adding nodes and edges related to user nodes based on user behavior information, with user nodes as the center; the edge weights in the user dynamic behavior knowledge graph are generated based on user behavior weights, comment sentiment scores, time decay factors, and behavior timestamps.
[0171] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0172] The fusion unit 403 is used to generate a fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix.
[0173] Optionally, in another embodiment of the present invention, one implementation of the fusion unit 403 further includes:
[0174] The similarity score matrix generation unit is used to generate a similarity score matrix based on the node embedding similarity between the static embedding matrix and the behavior embedding matrix.
[0175] The attention probability determination unit is used to determine the attention probability between behavioral nodes and static nodes based on the similarity score matrix.
[0176] The adjustment unit is used to adjust the attention probability between the behavior node and the static node using the behavior weight vector matrix, so as to obtain the target attention probability between the behavior node and the static node.
[0177] The fusion matrix generation unit is used to obtain updated static nodes based on behavioral nodes and the target attention probability between behavioral nodes and static nodes, and to generate a fusion matrix based on the updated static nodes.
[0178] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0179] Analysis unit 404 is used to generate fusion analysis results based on the starting node and the fusion matrix.
[0180] The starting node is the entity in the user's query information; the fusion analysis results include multiple path information.
[0181] Optionally, in another embodiment of the present invention, the analysis unit 404 includes, in one implementation:
[0182] The adjacency matrix generation unit is used to generate an adjacency matrix based on the fusion matrix, edge timestamps, and one-hot encoding of the starting node.
[0183] The path exploration unit is used to explore multiple path information in the adjacency matrix starting from the starting node.
[0184] The link score calculation unit is used to calculate the link score between nodes in each path information, sort the path information according to the link score between nodes in the path information, and generate the fusion analysis results.
[0185] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0186] The recommendation result generation unit 405 is used to generate recommendation results based on the fusion analysis results and the user's query information.
[0187] For details on the specific operation of the units disclosed in the above embodiments of the present invention, please refer to the corresponding method embodiments, such as... Figure 1 As shown, it will not be elaborated further here.
[0188] Optionally, in another embodiment of the present invention, one implementation of the recommendation result generation unit includes:
[0189] The embedding similarity calculation unit is used to calculate the embedding similarity between the fused embedding of the path information and the user's query embedding for each path information in the fusion analysis result.
[0190] The recommendation result generation subunit is used to sort the path information according to the embedding similarity to obtain the recommendation result.
[0191] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0192] Optionally, in another embodiment of the present invention, the static knowledge graph also includes community summaries corresponding to community nodes, and the path information in the recommendation results is also associated with the community summaries.
[0193] Optionally, in another embodiment of the present invention, one implementation of the personalized recommendation device further includes:
[0194] The community detection unit is used to perform community detection on entities in a static knowledge graph and generate multiple communities.
[0195] The large model invocation unit is also used to invoke the large model for each community, guide the large model to identify the node relationships between communities through preset prompts, and output a community summary.
[0196] Storage units are used to store community summaries in the metadata of a static knowledge graph as node attributes.
[0197] The specific working process of the units disclosed in the above embodiments of the present invention can be found in the corresponding method embodiments, and will not be repeated here.
[0198] As can be seen from the above scheme, the present invention provides a personalized recommendation device. By loading a static knowledge graph based on the user's query information to obtain a static embedding matrix, and loading a user dynamic behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix, the device performs a fusion analysis based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix. This effectively maps the user dynamic behavior knowledge graph to the static knowledge graph, generating personalized recommendation results that reflect the user's specific interests. The present invention combines a static knowledge graph and a user dynamic behavior knowledge graph, effectively solving the technical problems of fixed and non-personalized content recall in traditional knowledge graphs, and improving the user experience.
[0199] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0200] Another embodiment of the present invention provides an electronic device, such as... Figure 5 As shown, it includes:
[0201] One or more processors 501.
[0202] Storage device 502, on which one or more programs are stored.
[0203] When the one or more programs are executed by the one or more processors 501, the one or more processors 501 implement the personalized recommendation method as described in the above embodiments.
[0204] Another embodiment of the present invention provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the personalized recommendation method as described in the above embodiments.
[0205] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0206] It should be noted that the computer-readable medium described above in this invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0207] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0208] Another embodiment of the present invention provides a computer program product, which, when executed, performs the personalized recommendation method described above.
[0209] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, it performs the functions defined in the methods of the embodiments of the present invention.
[0210] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in this invention is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely exemplary forms of implementing the invention.
[0211] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0212] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with technical features of the present invention (but not limited to) that have similar functions.
Claims
1. A personalized recommendation method, characterized by, include: Receive user query information; The static knowledge graph is loaded based on the user's query information to obtain a static embedding matrix. The user's dynamic behavior knowledge graph is loaded based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix. A fusion matrix is generated based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix; Based on the starting node and the fusion matrix, a fusion analysis result is generated; wherein the starting node is an entity in the user query information; the fusion analysis result includes multiple path information. Based on the fusion analysis results and the user's query information, a recommendation result is generated. 2.The personalized recommendation method of claim 1, wherein, The construction process of the static knowledge graph includes: Retrieve entity information from the database; The large model is invoked, and preset prompts guide it to extract the relationships between entities in the entity information of the database. By treating entities as nodes and the relationships between entities as edges, a static knowledge graph is generated. 3.The personalized recommendation method of claim 1, wherein, The update process of the user dynamic behavior knowledge graph includes: When user behavior information is captured, the edge weights in the user dynamic behavior knowledge graph are updated based on the user behavior information; wherein, the user dynamic behavior knowledge graph is generated with the user node as the center, and nodes and edges related to the user node are added based on the user behavior information; the edge weights in the user dynamic behavior knowledge graph are generated based on user behavior weight, comment sentiment score, time decay factor and behavior occurrence timestamp. 4.The personalized recommendation method of claim 1, wherein, The step of generating a fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix includes: A similarity score matrix is generated based on the node embedding similarity between the static embedding matrix and the behavioral embedding matrix. Based on the similarity score matrix, the attention probability between behavioral nodes and static nodes is determined; The attention probability between behavioral nodes and static nodes is adjusted using the behavioral weight vector matrix to obtain the target attention probability between behavioral nodes and static nodes; Based on the target attention probability between the behavior node and the static node, the updated static node is obtained, and the fusion matrix is generated based on the updated static node.
5. The personalized recommendation method according to claim 1, characterized in that, The step of generating fusion analysis results based on the starting node and the fusion matrix includes: An adjacency matrix is generated based on the fusion matrix, edge timestamps, and one-hot encoding of the starting node. Starting from the initial node, multiple path information is obtained by exploring the adjacency matrix; Calculate the link score between nodes in each path information, sort the path information according to the link score between nodes in the path information, and generate the fusion analysis results.
6. The personalized recommendation method according to claim 1, characterized in that, The step of generating recommendation results based on the fusion analysis results and the user's query information includes: For each path information in the fusion analysis result, calculate the embedding similarity between the fusion embedding of the path information and the embedding of the user's query. The path information is sorted according to the embedding similarity to obtain the recommendation results.
7. The personalized recommendation method according to claim 6, characterized in that, The static knowledge graph also includes community summaries corresponding to community nodes, and the path information in the recommendation results is also associated with community summaries.
8. The personalized recommendation method according to claim 7, characterized in that, The generation methods for community summaries corresponding to community nodes in the static knowledge graph include: Community detection is performed on entities in the static knowledge graph to generate multiple communities; For each community, a large model is invoked, and the model is guided by preset prompts to identify the node relationships between communities, and a community summary is output. The community summary is stored in the metadata of the static knowledge graph as a node attribute.
9. The personalized recommendation method according to claim 7, characterized in that, After generating the recommendation results based on the fusion analysis results and the user's query information, the process further includes: The large model is invoked, and pre-set prompts guide it to perform natural language processing on the recommendation results to generate conversational recommendation results.
10. A personalized recommendation device, characterized in that, include: The receiving unit is used to receive user query information; The loading unit is used to load a static knowledge graph based on the user's query information to obtain a static embedding matrix, and to load a dynamic user behavior knowledge graph based on the user's identifier to obtain a behavior embedding matrix and a behavior weight vector matrix. A fusion unit is configured to generate a fusion matrix based on the static embedding matrix, the behavior embedding matrix, and the behavior weight vector matrix. An analysis unit is used to generate a fusion analysis result based on the starting node and the fusion matrix; wherein the starting node is an entity in the user query information; and the fusion analysis result includes multiple path information. The recommendation result generation unit is used to generate recommendation results based on the fusion analysis results and the user's query information.
Citation Information
Patent Citations
Point of interest recommendation method based on time sequence knowledge graph, medium and electronic equipment
CN118377979A
Industrial chain collaborative recommendation method driven by multi-view knowledge graph
CN120105126A