Knowledge recommendation method, device and equipment based on knowledge graph
Patent Information
- Application Number
- CN202211021920.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-08-24
AI Technical Summary
文本匹配方法的本质是通过文本的相似性的学习,得到与用户问题相似的问题,但并不能有效预测用户在该问题之后还想追问的问题或还想获取的知识,同时对于用户问题不清晰的场景下,无法匹配到有效的知识
[0019]本申请提供的基于知识图谱的知识推荐方法、装置及设备,通过根据本次会话的对话上文信息,识别用户意图,并确定本次会话所涉及的数据对象和候选知识;结合知识图谱,根据用户意图、所涉及的数据对象和候选知识确定知识图谱中对应的目标节点;根据用户的用户信息和知识图谱的图结构信息确定目标节点的邻居节点的聚合权重,使得邻居节点聚合权重融合了用户信息和知识图谱的图结构信息等多元信息,基于邻居节点的聚合权重将邻居节点的特征向量与目标节点的特征向量聚合,得到目标节点聚合后的特征向量,聚合时充分学习了知识图谱中用户信息、知识图谱图结构等多元信息,目标节点的特征向量有效聚合了知识图谱中目标节点关联的特征信息,使得本次会话相关的用户、商品、商家、用户意图、候选知识等节点的特征表示得到了有效的增强,提高了知识推荐模型的表达能力,将增强后的特征向量输入到推荐排序算法进行候选知识的预估参数预估,提升了预估参数预估的精准度,从而提升了知识推荐的精准度,推荐结果能够精准地覆盖用户还想追问的问题和还想获取的知识,可以减少用户的主动问询次数,缓解人工客服的需求,能更好更全面的解决用户问题,提升用户的满意度。
Smart Images

Figure CN115392262B_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a knowledge recommendation method, apparatus, and device based on knowledge graphs. Background Technology
[0002] In fully automated dialogues between users and intelligent customer service, there may be situations where the machine cannot answer questions or the responses do not fully resolve the user's issues. In such cases, accurately predicting user intent and extended interests, anticipating potential follow-up questions, and recommending high-quality knowledge can reduce users' inquiries, alleviate the need for human customer service, and thus better and more comprehensively resolve user problems, improve user satisfaction, and promote sales.
[0003] In intelligent customer service knowledge recommendation scenarios, text matching methods are typically used. This involves matching the user's question with the text of candidate knowledge to obtain highly relevant knowledge for recommendation. The essence of text matching is to learn text similarity to identify questions similar to the user's question. However, it cannot effectively predict follow-up questions or additional knowledge the user might want to acquire. Furthermore, it fails to match effective knowledge when the user's question is unclear. Summary of the Invention
[0004] This application provides a knowledge recommendation method, apparatus, and device based on knowledge graphs to improve the accuracy and effectiveness of recommending knowledge to users.
[0005] On the one hand, this application provides a knowledge recommendation method based on knowledge graphs, including:
[0006] In response to receiving a user's question, determine the user's intent, the data objects involved, and candidate knowledge based on the context of the current conversation;
[0007] Based on the user intent, the data objects involved, and the candidate knowledge, determine the corresponding target node in the knowledge graph;
[0008] The aggregation weights of the neighboring nodes of the target node are determined based on the user information of the user and / or the graph structure information of the knowledge graph. The feature vectors of the neighboring nodes are aggregated with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node.
[0009] Based on the feature vectors aggregated from the target nodes, the candidate knowledge is sorted, and knowledge is recommended based on the sorting results.
[0010] On the other hand, this application provides a knowledge recommendation device based on a knowledge graph, comprising:
[0011] The knowledge filtering module is used to respond to the user's question and determine the user's intent, the data objects involved, and candidate knowledge based on the context of the conversation.
[0012] The graph learning module is used to determine the target node in the knowledge graph based on the user intent, the data objects involved, and candidate knowledge; determine the aggregation weights of the neighboring nodes of the target node based on the user information and / or the graph structure information of the knowledge graph; and aggregate the feature vectors of the neighboring nodes with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node.
[0013] The recommendation and ranking module is used to rank the candidate knowledge according to the feature vector aggregated from the target node, and to recommend knowledge based on the ranking result.
[0014] On the other hand, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0015] The memory stores computer-executed instructions;
[0016] The processor executes computer execution instructions stored in the memory to implement the method described above.
[0017] On the other hand, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.
[0018] On the other hand, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0019] The knowledge recommendation method, apparatus, and device provided in this application identify user intent and determine the data objects and candidate knowledge involved in the current conversation based on the context of the dialogue. Combining this with the knowledge graph, the method determines the corresponding target node in the knowledge graph based on the user intent, the involved data objects, and the candidate knowledge. It then determines the aggregation weights of the target node's neighboring nodes based on the user's information and the graph structure information of the knowledge graph. This aggregation weights integrate multiple information such as user information and the graph structure information of the knowledge graph. Based on these aggregation weights, the feature vectors of the neighboring nodes are aggregated with the feature vector of the target node to obtain the aggregated feature vector of the target node. The aggregation process fully learns from the knowledge graph. By incorporating diverse information such as user information and knowledge graph structure, the feature vectors of target nodes effectively aggregate the feature information associated with target nodes in the knowledge graph. This significantly enhances the feature representations of nodes related to users, products, merchants, user intent, and candidate knowledge in this conversation, thereby improving the expressive power of the knowledge recommendation model. The enhanced feature vectors are then input into the recommendation ranking algorithm to predict the parameters of candidate knowledge, improving the accuracy of parameter prediction and thus enhancing the accuracy of knowledge recommendation. The recommendation results can accurately cover the questions users still want to ask and the knowledge they still want to acquire, reducing the number of times users actively inquire, alleviating the need for human customer service, and better and more comprehensively solving user problems, thereby improving user satisfaction. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 This is an example diagram of a system architecture on which this application is based;
[0022] Figure 2 This is a flowchart of a knowledge graph-based knowledge recommendation method provided in an example embodiment of this application;
[0023] Figure 3 A schematic diagram of section types and relationships in an example knowledge graph provided for an example embodiment of this application;
[0024] Figure 4 A flowchart of a knowledge recommendation method based on a knowledge graph, provided as another example embodiment of this application;
[0025] Figure 5 This is a flowchart illustrating feature vector aggregation based on an example embodiment of this application;
[0026] Figure 6 Example diagram of a 2-hop ego graph of a node provided in an example embodiment of this application;
[0027] Figure 7 A framework diagram of a knowledge recommendation model provided in an example embodiment of this application;
[0028] Figure 8 This is a schematic diagram of the structure of a knowledge recommendation device based on a knowledge graph provided in an example embodiment of this application;
[0029] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an example embodiment of this application.
[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0032] First, let me explain the terms used in this application:
[0033] Knowledge recommendation: By modeling user browsing and conversation behavior information, we can predict users' knowledge needs and recommend the most suitable knowledge points to users.
[0034] Recommendation ranking algorithm: The algorithm estimates and ranks the click-through rates of candidate knowledge, and returns several candidate knowledge with higher estimated click-through rates for recommendation based on the ranking results.
[0035] Knowledge heterogeneous graph: It is a multi-source information knowledge base with a directed graph structure composed of entities, relations and attributes. Unlike strong relation knowledge graphs based on expert knowledge, most nodes in a knowledge heterogeneous graph are weak relations with co-occurrence properties.
[0036] This application provides a knowledge recommendation method based on a knowledge graph. In response to a user's question, while providing feedback through a question-and-answer system, the method simultaneously uses a knowledge recommendation system to determine the user's intent, the relevant data objects, and candidate knowledge based on the context of the current conversation. Based on the user's intent, the relevant data objects, and candidate knowledge, the method identifies the corresponding target node in the knowledge graph. The method then determines the aggregation weights of the target node's neighboring nodes based on the user's information and the graph structure of the knowledge graph. The feature vectors of the neighboring nodes are then aggregated with the feature vector of the target node to obtain the aggregated feature vector of the target node. Based on the aggregated feature vector of the target node, the candidate knowledge is ranked, and knowledge recommendation is performed according to the ranking results. This method can accurately predict the user's subsequent intent and recommend high-precision knowledge to the user, precisely covering any follow-up questions and knowledge the user wants to acquire. This reduces the number of times users actively inquire, alleviates the need for human customer service, and provides a better and more comprehensive solution to user problems.
[0037] For example, Figure 1 This is an example diagram of the system architecture upon which this application is based. Figure 1 As shown, the system architecture includes: terminals and servers.
[0038] The server can be a server providing intelligent question-answering services, such as an intelligent customer service system, an intelligent form question-answering system, or an intelligent customer service robot. Specifically, it can be a server cluster deployed in the cloud. This server deploys intelligent question-answering and knowledge recommendation services, stores a knowledge recommendation ranking model and a knowledge graph. Through preset computational logic within the server, while implementing intelligent question-answering functions, it can also implement the knowledge recommendation method based on the knowledge graph provided in this application through the knowledge recommendation service, and can provide the recommended knowledge back to the terminal. Additionally, the server can store training data required for training, and based on this training data, the knowledge recommendation ranking model and knowledge graph are trained to obtain the trained knowledge recommendation ranking model and knowledge graph.
[0039] The terminal can specifically be a hardware device with network communication, computing and information display functions, including but not limited to smartphones, tablets, desktop computers, and Internet of Things devices.
[0040] Through communication and interaction with the server, when a user submits a question to the intelligent question-answering service using a terminal, the server can obtain the user's question in real time, call the intelligent question-answering service to provide feedback to the terminal, and simultaneously obtain the context of the current conversation based on the user's question. Based on this context, the server identifies the user's intent and determines multi-dimensional feature information such as the data objects involved, and recalls candidate knowledge based on this multi-dimensional feature information. According to the user's intent, the data objects involved, and the candidate knowledge, the server determines the corresponding target node in the knowledge graph. Based on the user's information and the graph structure of the knowledge graph, the server determines the aggregation weights of the target node's neighboring nodes. Based on these aggregation weights, the feature vectors of the neighboring nodes are aggregated with the feature vector of the target node to obtain the aggregated feature vector of the target node. Based on the aggregated feature vector of the target node, the candidate knowledge is ranked, and knowledge recommendations are made based on the ranking results. The server outputs the response information and knowledge recommendation results to the terminal. The terminal outputs the response information and knowledge recommendation results through the interactive interface.
[0041] Figure 1 In the system architecture shown, the intelligent question answering service and the knowledge recommendation service are deployed on the same server / service cluster. In other embodiments, the intelligent question answering service and the knowledge recommendation service can be deployed on different servers, which is not specifically limited here.
[0042] Figure 1 The interactive interface shown only illustrates the question input in the most recent round, demonstrating an example of outputting knowledge recommendation results along with the response information. In previous rounds of the current session (such as the first and / or second round), the server can also perform knowledge recommendations and output the recommendations along with the response information. Figure 1 This is not shown in the text, but it does not restrict other rounds from not recommending knowledge.
[0043] In this embodiment, the recommended knowledge may include questions that the user may want to ask and knowledge information that matches those questions, questions that the user may want to ask, or knowledge information that the user may be interested in; no specific limitations are made here.
[0044] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0045] Figure 2 This is a flowchart illustrating a knowledge recommendation method based on a knowledge graph, provided as an example embodiment of this application. Figure 2 As shown, the specific steps of this method are as follows:
[0046] Step S201: In response to receiving the user's question, determine the user's intent, the data objects involved, and candidate knowledge based on the context of the current conversation.
[0047] In this embodiment, in response to receiving a user's question, the answer information for the question is generated through an intelligent question-answering service. At the same time, the context information of the current conversation is obtained through a knowledge recommendation service, and knowledge recommendations are made based on the context information of the current conversation and the knowledge graph to accurately recommend knowledge that the user may want to continue to acquire.
[0048] The context information for this conversation is determined based on the content of the conversation. This context information may include questions asked by the user in each round of the conversation, as well as relevant information about data objects such as products, merchants, and orders involved in the conversation. The context information for this conversation can be extracted from the conversation content or retrieved by querying partial information from the conversation content. A single conversation can be the entire process of a session, which may include multiple rounds of dialogue between the user and the intelligent customer service.
[0049] For example, information about the products involved can be found based on product links in the conversation; order numbers can be extracted from the conversation, and information such as the order's shipping status, logistics status, and payment status can be obtained based on the order number; merchant information can be obtained based on the interface accessed through the conversation, etc.
[0050] In this embodiment, based on the context of the current conversation, the user's intent can be identified, the data objects involved in the current conversation can be determined, and candidate knowledge can be obtained.
[0051] The data objects include products, merchants, orders, and other objects that users may consult. Candidate knowledge can include all or part of the candidate knowledge in the knowledge base.
[0052] For example, candidate knowledge in the knowledge base can be roughly screened based on the context of the current conversation to identify some candidate knowledge that the user may be interested in. In the subsequent knowledge recommendation process, the candidate knowledge will be finely screened and recommended.
[0053] Step S202: Determine the corresponding target node in the knowledge graph based on the user intent, the data objects involved, and the candidate knowledge.
[0054] The knowledge graph is a heterogeneous graph trained on a large amount of training data based on specific scenarios where knowledge recommendation methods are applied. Nodes in the knowledge graph include various types such as users, products, merchants, intents, and knowledge. Nodes can have their own attribute information. An edge between two nodes indicates a relationship between them.
[0055] In addition, the specific types of nodes included in the knowledge graph, the information contained in the node attributes, and the types of relationships between edges between nodes can be set and adjusted according to the needs of specific application scenarios. The knowledge graph is trained based on a large amount of training data for specific application scenarios. The specific structure of the knowledge graph is not specifically limited here.
[0056] For example, a knowledge graph may include nodes such as users, sessions, products, merchants, intents, knowledge, and orders. The intents raised in a user-initiated session, as well as the products, merchants, and orders involved in the session content, can all be associated with the session, allowing the knowledge graph to contain richer and more detailed association information, which helps to enhance the feature representation of the nodes.
[0057] Optionally, the knowledge graph can also include nodes of the intent keyword type. Through the intent keyword node, an association can be established with the intent and knowledge containing the keyword. This can effectively establish indirect associations between different intents, between intents and knowledge, and between different knowledge through intent keywords, so that the knowledge graph can contain richer and more detailed association information, which helps to enhance the feature representation of the nodes.
[0058] Optionally, the knowledge graph can also include nodes of the "scene package" type. Different scene packages can contain different intents, and there is a relationship between the scene package and the intents it contains. Furthermore, merchants can subscribe to one or more scene packages, and there is a relationship between the merchant and the subscribed scene packages. This allows the knowledge graph to increase the association between intents and scenes, containing richer and more detailed association information, which helps to enhance the feature representation of nodes.
[0059] For example, the types of nodes contained in a knowledge graph example, and the relationships between different types of nodes, can be described as follows: Figure 3 As shown, nodes include types such as user, session, product, merchant, intent, knowledge, order, and intent keywords. The possible relationships between different types of nodes are as follows: Figure 3 As shown in the image.
[0060] Based on the context of the dialogue in this session, after determining the user intent, the data objects involved, and the candidate knowledge, we identify the intent nodes corresponding to the user intent, the nodes corresponding to the data objects involved, and the knowledge nodes corresponding to the candidate knowledge in the knowledge graph. This allows us to determine the nodes in the knowledge graph that are relevant to this session and use these nodes as target nodes.
[0061] Step S203: Determine the aggregation weights of the neighboring nodes of the target node based on the user's user information and the graph structure information of the knowledge graph. Aggregate the feature vectors of the neighboring nodes with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node.
[0062] After identifying the target nodes in the knowledge graph that are relevant to the current session, each target node is used as the central node. The aggregation weights of the neighboring nodes of the central node are determined by fusing the user information of the current user and the graph structure information of the knowledge graph. Based on the aggregation weights, the feature vectors of the neighboring nodes are aggregated onto the central node to obtain the aggregated feature vector of the central node. This enhances the feature representation of the target nodes related to the current session, such as users, products, merchants, user intent, and candidate knowledge.
[0063] For example, in this step, the feature vectors of each neighbor node of the target node can be weighted and summed according to the aggregation weight of the neighbor nodes, and then the weighted summation result can be added to the feature vector of the target node to obtain the aggregated feature vector of the target node.
[0064] For example, in this step, the feature vectors of the outer nodes can be aggregated onto the inner nodes sequentially based on the distance between the neighboring nodes and the target node, until the feature vectors of the target node's 1-hop neighbor nodes are aggregated onto the target node, thus obtaining the aggregated feature vector of the target node.
[0065] Step S204: Sort the candidate knowledge according to the feature vectors aggregated from the target nodes, and recommend knowledge based on the sorting results.
[0066] Among them, the feature vector of the target node after aggregation effectively aggregates the feature information of neighboring nodes in the knowledge graph. During aggregation, it fully learns information such as user information, node ternary relationship information and graph structure in the knowledge graph, which effectively enhances the feature vector of the target node.
[0067] In this step, a recommendation ranking algorithm is used to estimate the parameters of candidate knowledge based on the feature vector aggregated from the target nodes, and the candidate knowledge is ranked based on the obtained estimated parameters. One or more candidate knowledge items with higher estimated parameters are then recommended to the user according to the ranking results.
[0068] In addition, if the estimated parameters of candidate knowledge are all low (such as below the preset parameter threshold), knowledge may not be recommended to the user.
[0069] The prediction parameter is used to predict the probability that the user will perform a preset action (such as clicking or confirming) after the candidate knowledge is recommended to the user. For example, the prediction parameter can be the click-through rate or the acceptance rate.
[0070] For example, a recommendation ranking algorithm can be used to predict the click-through rate (CTR) of candidate knowledge based on the feature vector aggregated from the target nodes, and then rank the candidate knowledge based on the predicted CTR. The K candidate knowledge items with the highest CTRs are then recommended to the user based on the ranking results. Here, K is an integer, and K can be set and adjusted according to the needs of the actual application scenario; no specific limitation is made here.
[0071] In this embodiment, in response to receiving a user's question, the system identifies the user's intent based on the context of the current conversation and determines the data objects and candidate knowledge involved in the current conversation. Combining this with the knowledge graph, the system determines the corresponding target node in the knowledge graph based on the user's intent, the involved data objects, and the candidate knowledge. Based on the user's information and the graph structure information of the knowledge graph, the system determines the aggregation weights of the target node's neighboring nodes. This ensures that the neighboring node aggregation weights incorporate diverse information such as user information and the graph structure information of the knowledge graph. Based on the neighboring node aggregation weights, the feature vectors of the neighboring nodes are aggregated with the feature vector of the target node to obtain the aggregated feature vector of the target node. During aggregation, the system fully learns from the user information in the knowledge graph. By incorporating diverse information such as the knowledge graph structure, the feature vectors of target nodes effectively aggregate the feature information associated with target nodes in the knowledge graph. This significantly enhances the feature representations of nodes related to users, products, merchants, user intent, and candidate knowledge in this conversation, improving the expressive power of the knowledge recommendation model. The enhanced feature vectors are then input into the recommendation ranking algorithm to predict the parameters of candidate knowledge, improving the accuracy of parameter prediction and thus enhancing the accuracy of knowledge recommendation. The recommendation results can accurately cover the questions users still want to ask and the knowledge they still want to acquire, reducing the number of times users actively inquire, alleviating the need for human customer service, and better and more comprehensively solving user problems, thereby improving user satisfaction.
[0072] In one alternative embodiment, such as Figure 4 As shown, step S201 above can be implemented using the following steps:
[0073] Step S401: In response to receiving a question from the user, obtain the context information of the current conversation.
[0074] In this embodiment, after receiving a user's question, the answer information is generated through an intelligent question-and-answer service. At the same time, the context information of the current conversation is obtained through a knowledge recommendation service.
[0075] The preceding dialogue information in this session is determined based on the content of the current conversation. This preceding dialogue information may include questions raised by the user in each round of the conversation, as well as relevant information about data objects such as products, merchants, and orders involved in the conversation. The preceding dialogue information can be extracted from the conversation content or retrieved by querying partial information from the conversation content. A single conversation can be the entire process of a session, which may include multiple rounds of dialogue between the user and the intelligent customer service.
[0076] For example, information about the products involved can be found based on product links in the conversation; order numbers can be extracted from the conversation, and information such as the order's shipping status, logistics status, and payment status can be obtained based on the order number; merchant information can be obtained based on the interface accessed through the conversation, etc.
[0077] Specifically, this step can obtain the context information of each round of dialogue in this session, or the context information of one or more rounds of dialogue in this session.
[0078] Step S402: Perform intent recognition on the user's question in the dialogue context to obtain the user's intent.
[0079] After obtaining the context information of the current conversation, the context information is input into the intent recognition model, which then identifies the intent corresponding to the context information.
[0080] Among them, the intent recognition model can be a classification model that determines the corresponding intent category based on the context information of the input dialogue.
[0081] Optionally, the context information of this conversation may include one or more rounds of conversation context information in this conversation. In this step, intent recognition can be performed on the user questions in at least one round of conversation context information to obtain the user intent for each round of conversation in at least one round of conversation.
[0082] For example, the context information of each round of dialogue in the current session can be input into the intent classification model. By identifying the user intent of that round of dialogue through the intent classification model, the user intent of each round of dialogue can be obtained.
[0083] By identifying user intent in multi-turn dialogues through intent recognition models, we can accurately predict user intent, cover the user's true intent as much as possible, and recall more candidate knowledge based on the user intent in multi-turn dialogues, so that the candidate knowledge covers as much of the knowledge that the user wants to obtain as possible.
[0084] Optionally, in this step, the context information of the multi-turn dialogue in this session can also be input into the intent classification model for intent classification. Based on the probability corresponding to each intent classification, one or more intent classifications with higher probabilities are selected as the user classification obtained by recognition.
[0085] Step S403: Determine the data objects and attribute information of the data objects involved in the dialogue context.
[0086] The data objects include products, merchants, orders, and other objects that users may inquire about. Different types of data objects have different attribute information. Product attribute information may include product category, product tags, price, and other product-related information; merchant attribute information may include merchant rating, merchant tags, address, and other merchant-related information; and order attribute information may include shipping status, logistics status, payment status, delivery time, and other order-related information.
[0087] In this embodiment, after obtaining the context information of the current conversation, the data objects involved in the current conversation and the attribute information of the data objects required to recall candidate knowledge can be obtained based on the context information.
[0088] Specifically, which attribute information of the data object is obtained in this step can be determined based on the attribute information on which the recall candidate knowledge is based. Different application scenarios can be configured to recall candidate knowledge based on different attribute information, and the specific attribute information of the data object obtained in this step can be different.
[0089] For example, the product attribute information obtained in this step includes, but is not limited to, the category to which it belongs, the product identifier, and the product type identifier. The merchant attribute information obtained in this step includes, but is not limited to, the merchant name and category label. The order attribute information obtained in this step includes, but is not limited to, the shipping status, the logistics status, and the payment status.
[0090] Furthermore, steps S402 and S403 can be performed in parallel or in any order, without any specific limitation here.
[0091] Step S404: Based on the user intent and the attribute information of the data object, query the knowledge base to obtain candidate knowledge.
[0092] In this embodiment, based on the user's intent and the attribute information of the data objects involved in the current session, some candidate knowledge related to the current session can be filtered from the knowledge base to narrow down the range of candidate knowledge to be recommended, improve the efficiency of knowledge recommendation, and at the same time ensure that the filtered candidate knowledge can cover the user's needs.
[0093] In this step, the knowledge in the knowledge base is roughly screened based on the context of the current conversation to identify candidate knowledge that the user may be interested in. In the subsequent knowledge recommendation process, the candidate knowledge will be finely screened and recommended.
[0094] Specifically, after obtaining the user intent in step S402, the knowledge base can be queried based on the user intent to obtain candidate knowledge associated with it. Similarly, after obtaining the attribute information of the data objects involved in this session in step S403, the knowledge base can be queried based on the attribute information of the data objects to obtain candidate knowledge related to the data objects involved in this session. By acquiring candidate knowledge through these two methods, the scope of candidate knowledge related to this session can be expanded as much as possible, ensuring that the obtained candidate knowledge covers the user's needs.
[0095] Furthermore, based on the attribute information of the data objects involved in this session, the popular user intents corresponding to each data object are determined, and the knowledge base is queried to obtain candidate knowledge associated with each popular user intent. The data objects include at least one of the following: products, merchants, and orders.
[0096] For example, if this conversation involves product A, then based on historical dialogue data related to product A, intent recognition can be performed to determine the intents related to product A, and the number of inquiries for these intents can be calculated. The intents with the highest number of inquiries can then be selected as the most popular user intents for product A. The first number can be set and adjusted according to the needs of the actual application scenario; no specific limitation is made here.
[0097] For example, if this conversation involves store B, then based on historical dialogue data related to store B, intent recognition can be performed to determine the intents related to store B, and the number of inquiries for these store B-related intents can be calculated. The second number of intents with the highest number of inquiries can then be selected as the most popular user intents for store B. This second number can be set and adjusted according to the needs of the actual application scenario; no specific limitation is made here.
[0098] For example, if this conversation involves a specific logistics status of order C, then based on historical dialogue data related to that specific logistics status, intent recognition can be performed to determine the intents related to that specific logistics status. The number of inquiries for these intents can be calculated, and the third most frequent intents are selected as the most popular user intents for order C. The third most frequent intent can be set and adjusted according to the needs of the actual application scenario; no specific limitations are imposed here.
[0099] Optionally, when retrieving candidate knowledge by querying the knowledge base based on the attribute information of the data objects involved in this session, popular knowledge related to the data objects involved can be retrieved. For example, knowledge with a high number of inquiries related to the merchants involved in this session can be retrieved as candidate knowledge.
[0100] By determining the popular user intent corresponding to each data object based on the attribute information of the data objects involved in this session, and querying the knowledge base to obtain candidate knowledge associated with each popular user intent, the recall scope of candidate knowledge can be expanded, and the candidate knowledge related to this session can be covered as much as possible, so that the obtained candidate knowledge can cover the user's needs.
[0101] Alternatively, step S404 can also be implemented in the following manner:
[0102] Based on the user intent and the attribute information of the data object, the knowledge base is queried to obtain candidate knowledge that belongs to the data object and is associated with the user intent.
[0103] In this embodiment, in response to receiving a user's question, the intent of the user's question in the dialogue context of the current session is identified by obtaining the dialogue context information. Based on the user's intent, the knowledge base is queried to obtain candidate knowledge. This allows for accurate prediction of the user's intent and retrieval of a large number of candidate knowledge based on the user's intent. Furthermore, the data objects and attribute information of the data objects involved in the dialogue context are determined. Based on the attribute information of the data objects, the knowledge base is queried to obtain candidate knowledge. By obtaining candidate knowledge through these two methods, the relevant candidate knowledge of the current session can be covered as much as possible, expanding the scope of candidate knowledge retrieval and ensuring that the obtained candidate knowledge can cover the user's needs.
[0104] In one alternative embodiment, when recalling candidate knowledge, candidate knowledge associated with the user intent can also be recalled solely based on the user intent determined from the context of the current conversation.
[0105] In one optional embodiment, in step S203 above, determining the aggregation weights of the target node's neighbor nodes based on the user's user information and the graph structure information of the knowledge graph can be implemented in the following way:
[0106] Based on the user's information and / or the graph structure information of the knowledge graph, determine at least one of the following weights for the target node's neighboring nodes: user information weight, edge information weight, and Laplace weight; based on at least one of the following weights for the target node's neighboring nodes: user information weight, edge information weight, and Laplace weight, determine the aggregate weight of the target node's neighboring nodes.
[0107] Among them, the user information weight is determined based on the user's feature vector and the feature vectors of neighboring nodes, while the edge information weight is determined based on the node triplet relationship information of neighboring nodes.
[0108] Specifically, for any neighboring node, the user information weight of the neighboring node can be the inner product of the user's feature vector and the neighboring node's feature vector. Using E... user This represents the feature vector of a user, that is, the feature vector of the node corresponding to the user; denoted by E. neibor The feature vector of a neighboring node is represented by S. user Let S represent the weight of user information of neighboring nodes. user =E user ·E neibor .
[0109] The node triplet relationship information of neighbor nodes refers to the information of the triplet formed by the neighbor node, its corresponding inner node, and the edge between the neighbor node and its corresponding inner node, representing the graph relationship information. The edge information weights of neighbor nodes are determined based on the node triplet relationship information of neighbor nodes, which can be the inner product of the feature vector of the corresponding inner node and the feature vector of the neighbor edge between the neighbor node and its corresponding inner node. Specifically, assuming the neighbor node is the i-hop neighbor of the target node, then the corresponding inner node of the neighbor node refers to the i-1-hop neighbor node directly connected to the neighbor node / the target node.
[0110] For example, using E self Represent the feature vector of a neighboring node; use E edge The feature vector representing the neighbor edge between a neighbor node and an inner node is denoted by S. edge Let S represent the edge information weights of neighboring nodes. edge =E self ·E edge .
[0111] Optionally, the aggregate weight of a neighboring node can be determined based on the user information weight, edge information weight, and Laplace weight of the neighboring nodes. Specifically, the user information weight and edge information weight of each neighboring node can be normalized, and the aggregate weight of the neighboring node can be determined based on the normalization result and the Laplace weight of each neighboring node.
[0112] For example, using E laplace The Laplace weight of a neighboring node is represented by S. neibor Let the aggregate weight of the neighboring nodes be represented, then we have Among them, V neibor The set of neighboring nodes connected to the inner node, where softmax is the normalization function.
[0113] Optionally, the aggregation weight of neighboring nodes can be determined based on the user information weights of neighboring nodes. Specifically, the user information weights of each neighboring node can be normalized, and the normalized user information weights can be used as the aggregation weights of the neighboring nodes.
[0114] Optionally, the aggregation weight of neighboring nodes can be determined based on the edge information weights of neighboring nodes. Specifically, the edge information weights of each neighboring node can be normalized, and the normalized edge information weights can be used as the aggregation weights of the neighboring nodes.
[0115] Optionally, the aggregation weight of a neighboring node can be determined based on the user information weight and edge information weight of the neighboring nodes. Specifically, the user information weight and the edge information weight of each neighboring node can be normalized, and the sum of the normalized user information weight and the normalized edge information weight of the neighboring node can be used as the aggregation weight of that neighboring node.
[0116] Furthermore, based on the aggregation weights of neighboring nodes, the feature vectors of neighboring nodes are aggregated with the feature vectors of inner nodes. This can be achieved by weighted summation of the feature vectors of neighboring nodes based on their aggregation weights, and then adding the weighted summation result to the feature vectors of inner nodes to obtain the aggregated feature vectors of inner nodes.
[0117] Feature vector aggregation can be achieved through graph convolutional networks, which have learnable weight parameters that are determined after optimization during model training.
[0118] For example, using E self-new Let represent the feature vector after aggregation of inner nodes, then we have
[0119] Among them, V neibor represents the set of neighboring nodes connected to this inner node. W represents the weight parameters of the graph convolutional network used for feature aggregation.
[0120] By determining the user information weights of neighboring nodes based on their feature vectors and those of their neighboring nodes, and the edge information weights based on the node triplet relationships of neighboring nodes, the Laplace weights of neighboring nodes are determined. Finally, the aggregation weights of neighboring nodes are determined based on their user information weights, edge information weights, and Laplace weights. This aggregation weight integrates diverse information such as user information, graph relationships, and graph structure from the knowledge graph. Based on this aggregation weight, the feature vectors of neighboring nodes are aggregated onto the target node, effectively aggregating related knowledge information from the knowledge graph to obtain an enhanced feature representation of the target node, thus improving the feature representation capability of the target node's feature vectors.
[0121] In one alternative embodiment, such as Figure 5 As shown, step S203 above can be implemented using the following steps:
[0122] Step S501: Construct an n-hop ego graph for each target node, where n is a positive integer.
[0123] The n-hop ego graph is a graph centered on the target node and composed of all neighboring nodes whose distance to the target node is less than or equal to n. n can be set and adjusted according to the needs of the actual application scenario; for example, n can be 1, 2, or 3, without specific limitations here.
[0124] For example, Figure 6 A 2-hop ego graph for a target node is a subgraph of a knowledge graph. This 2-hop ego graph is centered on the target node and includes all neighboring nodes whose distance to the target node is less than or equal to 2 (i.e., including the target node's 1-hop and 2-hop neighbors), as well as the edges between the nodes. Figure 6 The neighboring nodes within the inner dashed circle (e.g., V1, V2, V3, V4) are the target node's 1-hop neighbors, while the neighboring nodes within the outer dashed circle (e.g., V5, V6, V7, V8, V9) are the target node's 2-hop neighbors. 11 e 12 e 13 and e 14 These are the edges between the four 1-hop neighbor nodes and the target node. 21 e 22 e 23 e 24 and e 25 These are the edges between 5 two-hop neighbor nodes and their associated one-hop neighbor nodes.
[0125] In this step, for each target node, all neighboring nodes in the knowledge graph whose distance to the target node is less than or equal to n can be obtained. The target node and all neighboring nodes whose distance to the target node is less than or equal to n are used as nodes in the ego graph to construct an n-hop ego graph for the target node.
[0126] In this embodiment, the distance between a node and its neighboring nodes can be represented by the hop count. For any node, the i-hop neighboring node represents the neighboring node at a distance of i from the node. Here, i takes the value 1, 2, ..., n.
[0127] Specifically, we can first find the 1-hop neighbor of the target node, then find the 2-hop neighbor based on the 1-hop neighbor, and so on until we find the n-hop neighbor of the target node. This way, we can find all the neighbor nodes in the knowledge graph that are less than or equal to n from the target node.
[0128] In the n-hop ego graph of the target node, the n-hop neighbor nodes are the external nodes (i.e., leaf nodes) of the ego graph, and the other neighbor nodes are the internal nodes (i.e., branch nodes) of the ego graph.
[0129] Optionally, when obtaining the 1-hop neighbor nodes of any internal node in the ego graph, if the number of 1-hop neighbor nodes of the internal node is greater than or equal to a preset number, the 1-hop neighbor nodes of the internal node are downsampled to reduce the number of neighbor nodes of the target node in the ego graph, while preserving the overall structural features of the ego graph. This can improve the efficiency of ego graph construction and the efficiency of knowledge recommendation based on the ego graph.
[0130] For example, taking n=2, when finding the 1-hop neighbor of the target node, if the number of 1-hop neighbor nodes is greater than or equal to a preset number, then a portion of the 1-hop neighbor nodes are sampled as internal nodes of the ego graph. For the 1-hop neighbor (internal node) of the target node in the ego graph, when finding the 2-hop neighbor (i.e., the 1-hop neighbor of the internal node), if the number of 1-hop neighbor nodes of the internal node is greater than or equal to a preset number, then a portion of the 1-hop neighbor nodes of the internal node can be used as nodes of the ego graph.
[0131] Optionally, when downsampling neighbor nodes, random sampling can be performed; or sampling can be performed based on the node type and the priority of different node types. For example, assuming the preset number is 4, such as... Figure 6 As shown, V0 is also a 1-hop neighbor of the target node, but the target node has 5 1-hop neighbors, which is greater than the preset number of 4. Therefore, neighbor downsampling is performed, and only 4 of the 1-hop neighbors are sampled, while V0 is not sampled. Figure 6 The dashed line in the diagram represents a 1-hop neighbor node of the target node in the knowledge graph, but it is not sampled as a node in the ego graph. That is, the ego graph does not include V0 and the edge between V0 and the target node.
[0132] For example, suppose the target node's one-hop neighbor nodes include product nodes, merchant nodes, user nodes, and intent nodes, where the priority of each node type, from highest to lowest, is: intent node, user node, product node, and merchant node. When finding the target node's one-hop neighbor nodes, if the number of one-hop neighbor nodes is greater than or equal to a preset number, then according to the priority of each node type, intent nodes are sampled first, then user nodes, and so on, until the number of sampled one-hop neighbor nodes reaches the preset number.
[0133] The preset quantity can be set and adjusted according to the needs and experience of actual application scenarios, and no specific limit is set here.
[0134] In addition, to reduce the computational overhead of real-time knowledge recommendation, the information of the neighboring nodes of each node in the knowledge graph can be maintained in advance, such as establishing the index information of the neighboring nodes, and neighbor downsampling can be performed on nodes with too many neighboring nodes, so as to achieve efficient real-time ego graph construction and ego graph-based knowledge recommendation computation.
[0135] Step S502: Based on the n-hop ego graph of the target node, and according to the distance between the neighboring nodes and the target node, the feature vectors of the outer nodes are aggregated onto the inner nodes in sequence until the feature vectors of the target node's 1-hop neighboring nodes are aggregated onto the target node, thus obtaining the aggregated feature vector of the target node.
[0136] In this step, based on the n-hop ego graph of each target node, the feature information of the neighboring nodes in the ego graph is aggregated onto the target node to enhance the feature representation capability of the target node's feature vector.
[0137] If n is greater than 1, the n-hop ego graph of the target node includes multiple neighbor nodes with different hop counts. Neighbor nodes with the same hop count of 1 are considered as one layer, and the neighbor nodes in the n-hop ego graph of the target node can be divided into n layers.
[0138] For example, such as Figure 6 The 2-hop ego graph shown has two layers. The first layer includes the target node's 1-hop neighbors, and the second layer includes the target node's 2-hop neighbors. A 1-hop neighbor is considered an inner node relative to its 2-hop neighbors; a 2-hop neighbor is considered an outer node relative to its 1-hop neighbors.
[0139] For the n-hop ego graph of the target node (n is greater than 1), in this step, based on the distance between the neighboring nodes and the target node, the feature vectors of the outer nodes are aggregated onto the inner nodes in turn, until the feature vectors of the target node's 1-hop neighboring nodes are aggregated onto the target node, thus obtaining the aggregated feature vector of the target node.
[0140] Specifically, for an n-hop ego graph of a target node, firstly, each n-1 hop neighbor node is taken as the center node (inner node), and the nodes among the n-hop neighbors of the target node that are directly connected to the current center node are taken as the outer nodes of the center node. The aggregation weight of the outer nodes is determined, and the feature vectors of the outer nodes are aggregated onto the feature vector of the center node to obtain the aggregated feature vector of the center node, thus obtaining the aggregated feature vector of each n-1 hop neighbor node. Then, the n-2 hop neighbor nodes are taken as the center node (inner node), and the nodes among the n-1 hop neighbors of the target node that are directly connected to the current center node are taken as the outer nodes of the center node. The aggregation weight of the outer nodes is determined, and the feature vectors of the outer nodes are aggregated onto the feature vector of the center node to obtain the aggregated feature vector of each n-2 hop neighbor node. This process continues until the feature vectors of the 1-hop neighbors are aggregated onto the target node to obtain the aggregated feature vector of the target node.
[0141] For example, for Figure 6 In the 2-hop ego graph shown, for each 1-hop neighbor of the target node, if the 1-hop neighbor is directly connected to at least one 2-hop neighbor (i.e., there is an edge between it and at least one 2-hop neighbor), then the feature vectors of the at least one 2-hop neighbor directly connected to the 1-hop neighbor are aggregated onto the feature vector of the 1-hop neighbor, resulting in the aggregated feature vector of the 1-hop neighbor. After aggregating for each 1-hop neighbor, the feature vectors of all 1-hop neighbor nodes are aggregated onto the feature vector of the target node, resulting in the aggregated feature vector of the target node.
[0142] Optionally, this step can be achieved by performing graph convolution on the n-hop ego graph of each target node to aggregate feature vectors.
[0143] In this embodiment, by constructing an n-hop ego graph of the target node, the feature vectors of the outer nodes are aggregated onto the inner nodes sequentially based on the n-hop ego graph of the target node, until the feature vectors of the target node's 1-hop neighbor nodes are aggregated onto the target node's feature vector, thus obtaining the aggregated feature vector of the target node. This can efficiently and accurately aggregate the feature vectors of the target node's multi-hop neighbor nodes onto the target node's feature vector, thereby improving the feature representation capability of the target node's feature vector.
[0144] Furthermore, when aggregating the feature vectors of outer nodes onto any inner node, the aggregation weight of the outer node is determined based on the user's information and the graph structure information of the knowledge graph. Based on the aggregation weight of the outer node, the feature vectors of the outer node are aggregated with the feature vectors of the inner node to obtain the aggregated feature vector of the inner node.
[0145] Specifically, the aggregation weight of any outer node is determined based on the user's user information and the graph structure information of the knowledge graph. This can be achieved in the following way:
[0146] Based on the user's information and / or the graph structure information of the knowledge graph, determine at least one of the following weights of the target node's outer nodes: user information weight, edge information weight, and Laplace weight; based on at least one of the following weights of the target node's outer nodes: user information weight, edge information weight, and Laplace weight, determine the aggregate weight of the target node's outer nodes.
[0147] Among them, the weight of user information is determined based on the feature vector of the user and the feature vector of the outer node, and the weight of edge information is determined based on the node triplet relationship information of the outer node.
[0148] Specifically, for any outer node, the user information weight of the outer node can be the inner product of the user's feature vector and the feature vector of the outer node.
[0149] For example, using E user This represents the feature vector of a user, that is, the feature vector of the node corresponding to the user; denoted by E. neibor The feature vector of the outer node is represented by S. user Let S represent the weight of the user information in the outer node. user =E user ·E neibor .
[0150] The node triplet relationship information of the outer node refers to the information of the triplet formed by the outer node, the corresponding inner node, and the edge between the outer node and the corresponding inner node, which represents the graph relationship information. The edge information weights of the outer node can be determined based on the node triplet relationship information of the outer node, which can be the inner product of the feature vector of the corresponding inner node and the feature vectors of the neighboring edges between the outer node and the corresponding inner node.
[0151] For example, using E self Represent the feature vector of the inner node; use E edge The feature vector representing the neighbor edges between outer and inner nodes is denoted by S. edge Let S represent the edge information weights of the outer node. edge =E self ·E edge .
[0152] Optionally, the aggregate weight of the outer nodes can be determined based on the user information weight, edge information weight, and Laplace weight of the outer nodes. Specifically, the user information weight and edge information weight of each outer node can be normalized, and the aggregate weight of the outer nodes can be determined based on the normalization results and the Laplace weight of each outer node.
[0153] For example, using E laplace The Laplace weight of the outer node is represented by S. neibor Let the aggregation weight of the outer node be represented, then: Among them, V neibor It is the set of neighboring nodes connected to the inner node, and softmax is the normalization function.
[0154] Optionally, the aggregation weight of the outer nodes can be determined based on the user information weights of the outer nodes. Specifically, the user information weights of each outer node can be normalized, and the normalized user information weights can be used as the aggregation weights of the outer nodes.
[0155] Optionally, the aggregation weight of the outer nodes can be determined based on the edge information weights of the outer nodes. Specifically, the edge information weights of each outer node can be normalized, and the normalized edge information weights can be used as the aggregation weights of the outer nodes.
[0156] Optionally, the aggregate weight of an outer node can be determined based on the user information weight and edge information weight of the outer node. Specifically, the user information weight and edge information weight of each outer node can be normalized, and the sum of the normalized user information weight and the normalized edge information weight of the outer node can be used as the aggregate weight of that outer node.
[0157] Furthermore, based on the aggregation weights of the outer nodes, the feature vectors of the outer nodes are aggregated with the feature vectors of the inner nodes. This can be achieved by weighted summation of the feature vectors of the outer nodes based on their aggregation weights, and then adding the weighted summation result to the feature vectors of the inner nodes to obtain the aggregated feature vectors of the inner nodes.
[0158] For example, using E self-new Let represent the feature vector after aggregation of inner nodes, then we have
[0159] Among them, V neibor represents the set of neighboring nodes connected to this inner node. W represents the weight parameters of the graph convolutional network used for feature aggregation.
[0160] By determining the user information weights of neighboring nodes based on their feature vectors and those of their neighboring nodes, and the edge information weights based on the node triplet relationships of neighboring nodes, the Laplace weights of neighboring nodes are determined. Finally, the aggregation weights of neighboring nodes are determined based on their user information weights, edge information weights, and Laplace weights. This aggregation weight integrates diverse information such as user information, graph relationships, and graph structure from the knowledge graph. Based on this aggregation weight, the feature vectors of neighboring nodes are aggregated onto the target node, effectively aggregating related knowledge information from the knowledge graph to obtain an enhanced feature representation of the target node, thus improving the feature representation capability of the target node's feature vectors.
[0161] In an optional embodiment, after constructing the n-hop ego graph of each target node in step S501, the feature vectors of neighboring nodes can be aggregated onto the target node based on the n-hop ego graph of the target node to obtain the aggregated feature vector of the target node:
[0162] Aggregate the feature vector of each node in the n-hop ego graph with the feature vectors of its one-hop neighbors to obtain the feature vector of each node after the first aggregation. Aggregate the feature vector of each node after the first aggregation with the feature vector of its one-hop neighbors to obtain the feature vector of each node after the second aggregation. And so on, performing n aggregations to obtain the feature vector of each node after each aggregation. Take the weighted sum of the feature vector of the target node after each aggregation and the original feature vector of the target node before the first aggregation to obtain the feature vector of the target node after aggregation.
[0163] For example, taking the 2-hop ego graph of the target node as an example, the feature vector of each node in the ego graph can be aggregated with the feature vector of the 1-hop neighbor node to obtain the feature vector of each node after the first aggregation; the feature vectors of the 1-hop neighbor node of the target node after the first aggregation are aggregated onto the target node to obtain the feature vector of the target node after the second aggregation; the original feature vector of the target node, the feature vector after the first aggregation, and the feature vector after the second aggregation are weighted and summed to obtain the feature vector of the target node after aggregation.
[0164] The weight of each feature vector can be determined based on the number of aggregations. Feature vectors that are aggregated more times have lower weights. For example, the weight of a feature vector after the first aggregation of the target node can be 1 / 1, the weight after the second aggregation can be 1 / 2, and so on, with the weight of the feature vector after the nth aggregation being 1 / n. The weight of the original feature vectors of the target node before the first aggregation can be 1.
[0165] This method can aggregate the features of the target node's multi-hop neighbor nodes onto the target node, effectively aggregating the associated knowledge information in the knowledge graph to obtain an enhanced feature representation of the target node, thereby improving the feature representation capability of the target node's feature vector.
[0166] For example, Figure 7 A framework diagram of a knowledge recommendation model provided in an example embodiment of this application is shown below. Figure 7 As shown, the knowledge recommendation model can include a graph learning layer and a recommendation ranking algorithm layer. The graph learning layer generates an n-hop ego graph of the target node based on the knowledge graph through graph sampling and performs graph convolution. This allows it to fuse multi-dimensional information such as user information and graph structure information to determine the weight parameters of neighboring nodes. Based on these weight parameters, it aggregates the feature vectors of the target node's n-hop neighbors into the target node's feature vector, thereby enhancing the feature vectors of the target nodes (users, merchants, products, intents, knowledge) involved in the current session within the knowledge graph and improving the expressive power of these target node feature vectors. The recommendation ranking algorithm layer uses a trained recommendation ranking algorithm to estimate the predicted parameters of candidate knowledge based on the aggregated feature vectors of target nodes (users, merchants, products, intents, knowledge). It then ranks the candidate knowledge based on the estimated parameter values, using the candidate knowledge with higher estimated parameters as the advancement result.
[0167] This knowledge recommendation model framework introduces heterogeneous knowledge graphs for information enhancement based on sequence recommendation. It extracts and learns graph relationship information from the heterogeneous knowledge graph through graph learning. The graph sampling layer efficiently models node graph information by sampling the ego graph of nodes. The graph convolutional layer generates weight parameters for neighboring nodes by fusing multi-dimensional information such as users, node relationships, and graph information, effectively aggregating related knowledge information from the heterogeneous knowledge graph to obtain enhanced node feature vectors. Finally, the enhanced node feature vectors (including user, product, merchant, intent, and knowledge nodes) are input into the recommendation ranking algorithm to predict candidate knowledge prediction parameters, improving the predictive ability of the knowledge recommendation model and effectively increasing the accuracy of knowledge recommendations. By accurately predicting user intent and extended interests, it recommends suitable knowledge to users, reducing users' proactive inquiries, better and more comprehensively solving user problems, improving user satisfaction, and alleviating the need for human customer service.
[0168] In this embodiment, the knowledge graph and knowledge recommendation model are obtained after training with a large amount of training data. During the training process, the feature vectors of the nodes in the knowledge graph and the parameters of the neural network are optimized.
[0169] For example, the initial values of the feature vectors of nodes in a knowledge graph can be determined by pre-training the knowledge graph using a trans E model, or they can be randomly initialized and generated.
[0170] Training data can be obtained from a large amount of historical dialogue logs, capturing the context of rounds 0-T in each session and the input question for the next round (T+1). The context of rounds 0-T in each session is used as the input sample, and the input question for the next round (T+1) is used as the label to generate a positive sample. Alternatively, labels can be generated by concatenating unrelated intents through negative sampling, forming negative samples with the context of rounds 0-T. This process can generate a large amount of training data containing both positive and negative samples.
[0171] The context information from rounds 0-T of each session is input into the knowledge recommendation model. The knowledge recommendation model performs the following knowledge recommendation process: Based on the context information of the current session, the user intent, the data objects involved, and candidate knowledge are determined; based on the current knowledge graph, the target node in the knowledge graph is determined according to the user intent, the data objects involved, and the candidate knowledge; based on the user information and / or the graph structure information of the knowledge graph, the aggregation weights of the neighboring nodes of the target node are determined; based on the aggregation weights of the neighboring nodes, the feature vectors of the neighboring nodes are aggregated with the feature vectors of the target node to obtain the aggregated feature vector of the target node, and the feature vector of the target node is updated; based on the aggregated feature vector of the target node, the predicted parameters of the candidate knowledge are estimated, and the candidate knowledge is ranked based on the predicted parameters, and knowledge recommendation is performed based on the ranking results.
[0172] The specific process of knowledge recommendation is similar to the corresponding process in the knowledge recommendation method based on knowledge graphs in the above method embodiments, and will not be repeated here.
[0173] Furthermore, based on the knowledge recommendation results and the labels in the training data, the model parameters are updated so that the estimated parameters for positive samples tend to be 1, and the estimated parameters for negative samples tend to be 0. After multiple rounds of training on a large amount of training data, a well-trained knowledge graph and knowledge recommendation model are obtained.
[0174] Figure 8 This is a schematic diagram of the structure of a knowledge graph-based knowledge recommendation device provided in an example embodiment of this application. The device provided in this embodiment is applied to the aforementioned server, such as... Figure 8 As shown, the knowledge recommendation device 80 based on knowledge graphs includes: a knowledge filtering module 81, a graph learning module 82, and a recommendation ranking module 83.
[0175] Among them, the knowledge filtering module 81 is used to respond to the user's question and determine the user's intent, the data objects involved, and candidate knowledge based on the context of the dialogue in this session.
[0176] The graph learning module 82 is used to determine the target node in the knowledge graph based on the user intent, the data objects involved, and the candidate knowledge; to determine the aggregation weights of the neighboring nodes of the target node based on the user information and / or the graph structure information of the knowledge graph; and to aggregate the feature vectors of the neighboring nodes with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node.
[0177] The recommendation ranking module 83 is used to rank candidate knowledge according to the feature vectors aggregated from the target nodes, and to recommend knowledge based on the ranking results.
[0178] The apparatus provided in this embodiment can be specifically used to perform the above-described... Figure 2 The specific functions and technical effects of the solutions provided in the corresponding method embodiments will not be elaborated here.
[0179] In one optional embodiment, when responding to a user's question and determining the user's intent, the relevant data objects, and candidate knowledge based on the context of the current conversation, the knowledge filtering module 81 includes:
[0180] The dialogue context acquisition unit is used to obtain the dialogue context information of the current session in response to receiving a question from the user.
[0181] The intent recognition unit is used to recognize the user's intent in the context of the dialogue, obtain the user's intent, and determine the data objects and attribute information of the data objects involved in the context of the dialogue.
[0182] The knowledge filtering unit is used to query the knowledge base and obtain candidate knowledge based on user intent and the attribute information of data objects.
[0183] In an optional embodiment, when performing intent recognition on the user's question in the context of the dialogue to obtain the user's intent, the intent recognition unit is further configured to:
[0184] Intent recognition is performed on user questions in at least one round of dialogue in the context of the dialogue to obtain the user intent for each round of dialogue in at least one round.
[0185] In one optional embodiment, when querying the knowledge base based on user intent and attribute information of data objects to obtain candidate knowledge, the knowledge filtering unit is further configured to:
[0186] The knowledge base is queried based on user intent to obtain candidate knowledge associated with the user intent; based on the attribute information of the data object, the popular user intents corresponding to the data object are determined, and the knowledge base is queried to obtain candidate knowledge associated with the popular user intents. The data object includes at least one of the following: product, merchant, order, conversation.
[0187] In an optional embodiment, when determining the aggregation weights of neighboring nodes of a target node based on the user's user information and / or the graph structure information of the knowledge graph, the graph learning module 82 is further configured to:
[0188] Based on the user's user information and / or the graph structure information of the knowledge graph, determine at least one of the following weights for the target node's neighboring nodes: user information weight, edge information weight, and Laplace weight. The user information weight is determined based on the user's feature vector and the feature vectors of the neighboring nodes, and the edge information weight is determined based on the node triplet relationship information of the neighboring nodes. Based on at least one weight, determine the aggregation weight of the neighboring nodes.
[0189] In an optional embodiment, when determining the aggregation weights of the neighboring nodes of the target node based on the user's user information and the graph structure information of the knowledge graph, and aggregating the feature vectors of the neighboring nodes with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node, the graph learning module 82 is further configured to:
[0190] For each target node, construct an n-hop ego graph of the target node, where n is a positive integer. Based on the n-hop ego graph of the target node, aggregate the feature vectors of the outer nodes to the inner nodes according to the distance between the neighbor nodes and the target node, until the feature vectors of the 1-hop neighbor nodes of the target node are aggregated to the feature vector of the target node, and obtain the aggregated feature vector of the target node.
[0191] Specifically, when aggregating the feature vectors of outer nodes onto any inner node, the aggregation weight of the outer node is determined based on the user's information and the graph structure information of the knowledge graph. Based on the aggregation weight of the outer node, the feature vectors of the outer node are aggregated with the feature vectors of the inner node to obtain the aggregated feature vector of the inner node.
[0192] In an optional embodiment, when constructing an n-hop ego graph of each target node, the graph learning module 82 is further configured to:
[0193] When obtaining the 1-hop neighbor nodes of any internal node in the ego graph, if the number of 1-hop neighbor nodes of the internal node is greater than or equal to a preset number, then the 1-hop neighbor nodes of the internal node are downsampled.
[0194] The device provided in this embodiment can be used to execute the solution provided in any of the above method embodiments. The specific functions and technical effects that can be achieved will not be described in detail here.
[0195] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an example embodiment of this application. Figure 9As shown, the electronic device 90 includes a processor 901 and a memory 902 communicatively connected to the processor 901, the memory 902 storing computer-executed instructions.
[0196] The processor executes computer execution instructions stored in the memory to implement the solution provided in any of the above method embodiments. The specific functions and technical effects that can be achieved will not be elaborated here.
[0197] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the solution provided in any of the above method embodiments. The specific functions and technical effects to be achieved are not described here.
[0198] This application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium. The at least one processor executes the computer program to cause the electronic device to perform the solution provided in any of the above method embodiments. The specific functions and technical effects that can be achieved are not described here.
[0199] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The sequence numbers are merely used to distinguish different operations, and the sequence number itself does not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types. "Multiple" means two or more, unless otherwise explicitly specified.
[0200] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0201] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A knowledge recommendation method based on knowledge graphs, characterized in that, include: In response to receiving a user's question, determine the user's intent, the data objects involved, and candidate knowledge based on the context of the current conversation; Based on the user intent, the data objects involved, and the candidate knowledge, determine the corresponding target node in the knowledge graph; The aggregation weights of the neighboring nodes of the target node are determined based on the user information of the user and / or the graph structure information of the knowledge graph. The feature vectors of the neighboring nodes are aggregated with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node. Based on the feature vectors aggregated from the target nodes, the candidate knowledge is sorted, and knowledge is recommended based on the sorting results; Determining the aggregation weights of the neighboring nodes of the target node based on the user's user information and / or the graph structure information of the knowledge graph includes: Based on the user information of the user and / or the graph structure information of the knowledge graph, determine at least one of the following weights for the target node: user information weight, edge information weight, and Laplace weight. The user information weight is determined based on the feature vector of the user and the feature vector of the neighboring node, and the edge information weight is determined based on the node triplet relationship information of the neighboring node. The aggregation weight of the neighboring nodes is determined based on the at least one weight.
2. The method according to claim 1, characterized in that, The response to receiving a user's question determines the user's intent, the relevant data objects, and candidate knowledge based on the context of the current conversation, including: In response to receiving a question from the user, retrieve the context information of the current conversation; The user's intent is identified by performing intent recognition on the user's question in the context of the dialogue, and the data objects involved in the context of the dialogue and the attribute information of the data objects are determined. Based on the user intent and the attribute information of the data object, the knowledge base is queried to obtain candidate knowledge.
3. The method according to claim 2, characterized in that, The step of identifying the user's intent from the context of the dialogue to obtain the user's intent includes: Intent recognition is performed on the user questions in at least one round of dialogue in the above dialogue information to obtain the user intent of each round of dialogue in the at least one round of dialogue.
4. The method according to claim 2, characterized in that, The step of querying the knowledge base to obtain candidate knowledge based on the user intent and the attribute information of the data object includes: The knowledge base is queried based on the user intent to obtain candidate knowledge associated with the user intent; Based on the attribute information of the data object, the popular user intent corresponding to the data object is determined, and the knowledge base is queried to obtain candidate knowledge associated with the popular user intent. The data object includes at least one of the following: product, merchant, order, and conversation.
5. The method according to any one of claims 1-4, characterized in that, The step of determining the aggregation weights of the neighboring nodes of the target node based on the user's user information and the graph structure information of the knowledge graph, and aggregating the feature vectors of the neighboring nodes with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node includes: For each target node, construct an n-hop ego graph of the target node, where n is a positive integer; Based on the n-hop ego graph of the target node, and according to the distance between the neighboring nodes and the target node, the feature vectors of the outer nodes are aggregated onto the inner nodes in sequence until the feature vectors of the one-hop neighboring nodes of the target node are aggregated onto the feature vector of the target node, thus obtaining the aggregated feature vector of the target node. Specifically, when aggregating the feature vector of an outer node to any inner node, the aggregation weight of the outer node is determined based on the user's user information and the graph structure information of the knowledge graph. Based on the aggregation weight of the outer node, the feature vector of the outer node is aggregated with the feature vector of the inner node to obtain the aggregated feature vector of the inner node.
6. The method according to claim 4, characterized in that, When constructing an n-hop ego graph for each target node, the process includes: When obtaining the 1-hop neighbor node of any internal node in the ego graph, if the number of 1-hop neighbor nodes of the internal node is greater than or equal to a preset number, then the 1-hop neighbor nodes of the internal node are downsampled.
7. A knowledge recommendation device based on a knowledge graph, characterized in that, include: The knowledge filtering module is used to respond to the user's question and determine the user's intent, the data objects involved, and candidate knowledge based on the context of the conversation. The graph learning module is used to determine the corresponding target node in the knowledge graph based on the user intent, the data objects involved, and candidate knowledge. The aggregation weights of the neighboring nodes of the target node are determined based on the user information of the user and / or the graph structure information of the knowledge graph. The feature vectors of the neighboring nodes are aggregated with the feature vectors of the target node based on the aggregation weights of the neighboring nodes to obtain the aggregated feature vector of the target node. The recommendation ranking module is used to rank the candidate knowledge according to the feature vector aggregated from the target node, and to recommend knowledge based on the ranking result. The graph learning module is used to determine at least one of the following weights of the target node's neighbor nodes: user information weight, edge information weight, and Laplace weight, based on the user information of the user and / or the graph structure information of the knowledge graph: wherein the user information weight is determined based on the feature vector of the user and the feature vector of the neighbor nodes, and the edge information weight is determined based on the node triplet relationship information of the neighbor nodes. The aggregation weight of the neighboring nodes is determined based on the at least one weight.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Data processing method and device based on knowledge graph, medium and electronic equipment
CN111552880A
KR20220019461A