WO2024045964A1 - 基于知识图谱的多轮话题推荐方法 - Google Patents
基于知识图谱的多轮话题推荐方法 Download PDFInfo
- Publication number
- WO2024045964A1 WO2024045964A1 PCT/CN2023/109627 CN2023109627W WO2024045964A1 WO 2024045964 A1 WO2024045964 A1 WO 2024045964A1 CN 2023109627 W CN2023109627 W CN 2023109627W WO 2024045964 A1 WO2024045964 A1 WO 2024045964A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- topic
- target
- subgraph
- user
- target subgraph
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
Definitions
- the present disclosure relates to the field of computer technology, and in particular, to a multi-round topic recommendation method and device based on a knowledge graph.
- the human-computer question answering system is an important topic in the field of human-computer interaction.
- the human-computer question answering system can automatically select or generate corresponding responses based on the questions input by the user.
- the user In human-machine Q&A systems, the user usually inputs questions and the system answers the questions.
- how the human-machine Q&A system advances the topic based on the content input by the user and guides the user to conduct multiple rounds of dialogue with the human-machine Q&A system is an urgent need to be solved in this field. The problem.
- one or more embodiments of the present disclosure provide a multi-round topic recommendation method and device based on a knowledge graph to solve problems existing in related technologies.
- a multi-round topic recommendation method based on a knowledge graph is proposed, which is applied to a human-machine question and answer system.
- the human-machine question and answer system includes a pre-built topic recommendation method.
- a knowledge graph the knowledge graph includes several subgraphs respectively corresponding to different topic types; any one of the several subgraphs includes several interrelated topic nodes of the same topic type, and the method includes:
- Topic recommendations Recommend topics corresponding to topic nodes contained in the first target subgraph to the user, and After the topics corresponding to the topic nodes in the first target subgraph are recommended, the topics corresponding to the topic nodes contained in the adjacent subgraph with the highest similarity to the first target subgraph are recommended to the user. Topic recommendations.
- a multi-round topic recommendation device based on a knowledge graph is proposed, which is applied to a human-machine question and answer system.
- the human-machine question and answer system includes a pre-built topic recommendation device.
- a knowledge graph the knowledge graph includes several subgraphs respectively corresponding to different topic types; any one of the several subgraphs includes a number of interrelated topic nodes, and the device includes:
- the topic acquisition unit obtains the topic input by the user
- a sub-picture determining unit that determines a first target sub-picture corresponding to the topic type of the topic input by the user from the plurality of sub-pictures;
- the topic recommendation unit recommends topics corresponding to the topic nodes included in the first target subgraph to the user, and after the topics corresponding to the topic nodes in the first target subgraph are recommended, Topics corresponding to topic nodes included in the adjacent subgraph with the highest similarity to the first target subgraph are recommended to the user.
- an electronic device including:
- Memory used to store instructions executable by the processor
- the processor implements the method described in the first aspect by running the executable instructions.
- a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
- This application divides the knowledge graph into several sub-graphs, first recommends topics from the sub-graph corresponding to the topic type of the topic input by the user, and then recommends topics from other sub-graphs with the highest correlation, which can be combined with the rich content in the knowledge graph.
- Data information makes the topics people and machines talk about more in-depth, and also enables the richness and diversity of recommended topics.
- Figure 1 is a schematic diagram of a subgraph of a knowledge graph used for topic recommendation provided by an exemplary embodiment.
- Figure 2 is a flow chart of a multi-round topic recommendation method based on knowledge graphs provided by an exemplary embodiment.
- Figure 3 is a schematic diagram showing the relationship between various subgraphs in the knowledge graph provided by an exemplary embodiment.
- FIG. 4 is a schematic structural diagram of an electronic device provided by an exemplary embodiment.
- Figure 5 is a block diagram of a multi-round topic recommendation device based on a knowledge graph provided by an exemplary embodiment.
- the steps of the corresponding methods are not necessarily performed in the order shown and described in this disclosure. In some other embodiments, methods may include more or fewer steps than described in this disclosure. In addition, a single step described in this disclosure may be broken down into multiple steps for description in other embodiments; and multiple steps described in this disclosure may also be combined into a single step in other embodiments. describe.
- the human-machine question and answer system can be used in many fields, such as customer service on e-commerce platforms, central control displays in smart cars, artificial intelligence voice interaction engines on smart speakers, etc. It can all be used as a human-machine question and answer system.
- Existing human-machine Q&A systems usually ask questions from the user, and the human-machine Q&A system recognizes the questions entered by the user, and then selects the answer to the question from a preset Q&A library; or the human-machine Q&A system recognizes the questions entered by the user. related entities in the system, and then find other entities that have relationships with the entity from the preset knowledge graph, and organize other entities that have relationships with the entity into answers to the question based on natural language processing technology.
- the human-machine Q&A system in the existing technology usually asks questions by the user, and then the human-machine Q&A system gives the answer to the question, and cannot recommend topics. Or after the human-machine Q&A system gives the answer to a question, it can only ask questions based on the questions in the preset question bank. After multiple rounds of dialogue, the questions asked again by the human-machine Q&A system are often repeated questions, and It cannot make the conversation between humans and machines go deeper.
- the present disclosure proposes a multi-round dialogue method based on the knowledge graph.
- topic recommendations are first made from the sub-graph corresponding to the topic type of the topic input by the user. Then use the technical solution to recommend topics from other subgraphs with the highest correlation.
- the topic input by the user can be obtained; the relationship with the topic input by the user is determined from the several sub-graphs.
- the first target subgraph corresponding to the topic type recommend the topic corresponding to the topic node contained in the first target subgraph to the user, and select the topic corresponding to the topic node in the first target subgraph
- the topic corresponding to the topic node contained in the adjacent subgraph with the highest similarity to the first target subgraph is recommended to the user.
- the human-machine question answering system can maintain a pre-built knowledge graph for topic recommendation, where the knowledge graph can include several topic nodes, and each topic node is related to each other.
- the human-machine question and answer system can recommend topics based on topics corresponding to topic nodes in the knowledge graph.
- there is no limit to the specific method of constructing the knowledge graph For example, structured data sources can be obtained through multiple channels to construct a knowledge graph for topic recommendation; technical means can also be used to obtain the knowledge graph from encyclopedia websites or The data center collects data, builds a knowledge base, and further builds a knowledge graph for topic recommendation, etc.
- the above-mentioned knowledge graph may also include several subgraphs respectively corresponding to different topic types, and any one of the several subgraphs includes interrelated topic nodes of the same topic type.
- nodes related to the settings of the air conditioner of the smart car can be divided into the same topic type, so the topic type can be "air conditioning”.
- nodes related to the parameters of product A can be divided into the same topic type, so the topic type can be "product A”.
- Figure 1 is a schematic diagram of a subgraph of a knowledge graph for topic recommendation provided by an exemplary embodiment.
- the subgraph may include several topic nodes of settings related to air conditioning, so the topic type of the subgraph may be "air conditioning".
- the human-machine question answering system can make topic recommendations for the input topics based on the topic nodes in the subgraph.
- the pre-built knowledge graph maintained by the human-machine question answering system for topic recommendation can be divided into several sub-graphs based on the random walk segmentation algorithm.
- the specific implementation method of the random walk segmentation algorithm will not be described again in this disclosure.
- the user can specify several topic nodes in the knowledge graph as marked nodes. Based on the relationship between the marked node and the unmarked adjacent node adjacent to the marked node, the probability of transferring from the marked node to the adjacent node is calculated. According to the probability, unlabeled nodes are divided to obtain the final segmentation result, so as to segment the pre-constructed knowledge graph used for topic recommendation into several subgraphs.
- Figure 2 is a flow chart of a multi-round topic recommendation method based on knowledge graphs provided by an exemplary embodiment. As shown in Figure 2, the method may include the following steps 202 to 206.
- Step 202 Obtain the topic input by the user.
- the human-machine question and answer system can obtain the topic input by the user based on the content input by the user; wherein the user can input content in the form of text, content in the form of audio, etc.
- the human-machine Q&A system can extract the topics input by the user from the text-form content based on technologies such as semantic analysis;
- the human-machine Q&A system can first convert the audio into text, and then extract the topics from the text.
- the topic input by the user is extracted from the form content.
- the human-machine question and answer system can determine the current topic as “turn on” based on semantic analysis and other technologies. For another example, when the user inputs "What is the price of product A?”, the human-machine question and answer system can determine that the current topic is "price.”
- not only the content input by the user can be obtained, but also the historical input content of the user in the human-machine question and answer system can be obtained, and based on semantic analysis technology, the input content of the user and the location of the user can be obtained.
- the historical input content in the above question and answer system is semantically analyzed to determine the topic corresponding to the user's input content.
- the human-machine question and answer system can determine that the current topic is air conditioning based on the user's current input and the user's historical input. "closure”. For another example, when the user enters "What is the price of product A?” and then enters "Are there any other discounts?", the human-machine question and answer system can determine that the current topic is A based on the user's current input and the user's historical input. "Discounts" on merchandise.
- Step 204 Determine the first target subgraph corresponding to the topic type of the topic input by the user from the several subgraphs.
- the topic type corresponding to the topic can be determined, and the first target subgraph can be determined based on the topic type of the topic.
- the target subgraph refers to the subgraph corresponding to the topic type.
- the subgraph shown in Figure 1 has the topic type "air conditioner".
- Step 206 Recommend topics corresponding to topic nodes contained in the first target subgraph to the user, and after all topics corresponding to topic nodes in the first target subgraph are recommended, the The topic corresponding to the topic node contained in the adjacent subgraph with the highest similarity of the first target subgraph is recommended to the user.
- the topic corresponding to the topic node can be selected from the first target subgraph for recommendation.
- the specific selection method of topic nodes is not specifically limited in this disclosure.
- the relationship weight can be calculated based on the relationship between each topic node in the first target subgraph, and the topic can be recommended based on the relationship weight, or the first first target node can be randomly selected.
- the topics corresponding to the topic nodes in the target subgraph are recommended, and the user can also specify the recommendation order of each topic node during the subgraph segmentation process, etc.
- the human-machine question and answer system can organize the topics corresponding to the topic nodes into complete sentences for output and display to the user based on relevant technologies in the field of natural language processing.
- the target topic node corresponding to the topic input by the user in the first target subgraph may be determined.
- the target topic node may refer to a topic node directly corresponding to the topic type. Normally, after determining the topic input by the user, the corresponding topic node can be determined in the first target subgraph.
- the topic type is "air conditioner”
- the first target subgraph is a subgraph related to air conditioners
- the target node is the "air conditioner” node in the first target subgraph.
- the relationship weight of each topic node in the first target subgraph can be calculated based on the relationship between the target topic node and each topic node in the first target subgraph.
- the relationship weight is used to indicate the degree of association between the target topic node and each topic node in the first target subgraph. Based on the relationship weight, a topic node in the first target subgraph is selected, and the topic corresponding to the topic node is used as a target topic to recommend to the user.
- the relationship between the target topic node and each topic node in the first target subgraph can be a triplet relationship obtained from the knowledge graph; the triplet structure can be input into a pre-trained neural network model to obtain The weight value corresponding to each triplet structure is used to calculate the relationship weight of each topic node in the first target subgraph.
- the neural network model can use Word2vec and other models, and this disclosure does not limit this.
- the relationship weight is used to indicate the degree of association between the target topic node and each topic node in the first target subgraph. The greater the relationship weight, the higher the degree of association between the target topic node and the topic node in the first target subgraph.
- the triplet "air conditioning” control "temperature” can be used as the relationship between the target topic node “air conditioning” and the topic node “temperature” in the first target subgraph,
- This triplet relationship can be Input the pre-trained neural network model to obtain the weight value corresponding to the triplet structure, which is used as the relationship weight of the topic node "temperature”.
- "Perfume No. 9” has no direct relationship with the target topic node "temperature”, but an indirect relationship. Therefore, the triplet "air conditioner” can control "perfume”.
- the topic node in the first target subgraph can be selected based on the relationship weight, and the topics corresponding to the topic nodes can be recommended. Specifically, topic nodes for topic recommendation can be directly selected based on the calculated relationship weight.
- the relationship weight of the "Open/Close” node is 0.9
- the relationship weight of the "Fragrance Capsule” node is 0.8
- the relationship weight of the "Temperature” node is 0.75
- the relationship weight of the "No. 9” node The relationship weight of the "perfume” node is 0.72.
- topic recommendations can be made to the user based on the order of "open/close”, “fragrance capsule” and "temperature”.
- the question and answer system can also store topic nodes that have been recommended and store the relationship weight corresponding to the topic node. After recommending a topic node based on the relationship weight, it is also necessary to determine whether other topic nodes have a relationship with the recommended topic node. If there is a relationship between a certain topic node and the recommended topic node, the topic node needs to be The relationship weight is divided by the relationship weight of the recommended topic node to obtain a new relationship weight, and the relationship weight of the node is updated. At the same time, if the multiplication factor is preset, it also needs to be divided by the multiplication factor and update the relationship weight of the node.
- the relationship weight of the "Open/Close” node is 0.9
- the relationship weight of the "Fragrance Capsule” node is 0.8
- the relationship weight of the "Temperature” node is 0.75
- the relationship weight of the "No. 9” node The relationship weight of the "perfume” node is 0.72.
- topic recommendations can be made to the user based on the order of "open/close”, “fragrance capsule” and "temperature”.
- the relationship weight of "Perfume No. 9" needs to be divided by the relationship weight of "Fragrance Capsule”. A new relationship weight of 0.9 is obtained.
- topic recommendations can be made to users based on the order of "Perfume No. 9" and "Temperature”.
- the neighboring subgraph with the highest similarity to the first target subgraph can be found, and the topic used for topic recommendation can be determined from the neighboring subgraph. topic node.
- neighboring subgraphs adjacent to the first target subgraph can be traversed to calculate the first target subgraph.
- the similarity between the subgraph and the adjacent subgraph is determined, and the topic corresponding to the topic node contained in the adjacent subgraph with the highest similarity of the first target subgraph is recommended to the user. It should be noted that when traversing adjacent subgraphs, based on the distance of the path between subgraphs, the distance between the adjacent subgraph and the first target subgraph that is shorter than the path between the first target subgraph can be calculated first. Similarity is further calculated between adjacent subgraphs with a longer path distance from the first target subgraph and the first target subgraph.
- the specific method for calculating the similarity between the first target subgraph and the adjacent subgraph is not limited in this disclosure.
- the similarity can be based on calculating the similarity between the first target subgraph and each node in the adjacent subgraph.
- the similarity comprehensively calculates the similarity between the first target subgraph and the adjacent subgraph, and can also generate a vector corresponding to the first target subgraph and a vector corresponding to the adjacent subgraph based on the graph structure of the first target subgraph and the adjacent subgraph. , and calculate the similarity between vectors as the similarity between the first target subgraph and adjacent subgraphs.
- Figure 3 is a schematic diagram showing the relationship between various subgraphs in the knowledge graph provided by an exemplary embodiment.
- the distance between the paths between the first neighboring subgraph, the third neighboring subgraph, the fourth neighboring subgraph and the first target subgraph is 1, and the distance between the second neighboring subgraph and the first target subgraph
- the distance between paths between graphs is 2. Therefore, the similarity between the first target subgraph and the first neighboring subgraph, the third neighboring subgraph, and the fourth neighboring subgraph can be calculated respectively, and then the first target subgraph can be calculated.
- the similarity between the graph and the second neighboring subgraph since the distance between the paths between the first neighboring subgraph, the third neighboring subgraph, the fourth neighboring subgraph and the first target subgraph is 1, and the distance between the second neighboring subgraph and the first target subgraph. Therefore, the similarity between the first target subgraph and the first neighboring subgraph, the third neighboring subgraph, and the fourth neighboring subgraph can be calculated respectively, and then the first target subgraph can be calculated.
- the Laplacian matrix of the first target subgraph and the Laplacian matrix of each adjacent subgraph can be calculated, wherein the Laplacian matrix of the first target subgraph and the Laplacian matrix of each neighboring subgraph can be obtained by calculating the degree matrix and adjacency matrix of the first target subgraph and each neighboring subgraph respectively, that is, subtracting the adjacency matrix from the degree matrix can obtain the Laplacian matrix Lars matrix.
- the matrix vector corresponding to the first target subgraph and the matrix vector corresponding to each adjacent subgraph can be calculated; where, the specific values of the matrix vector
- the calculation method can refer to the content related to linear algebra and will not be described again in this disclosure.
- the similarity between the matrix vectors can be calculated, and the similarity between the matrix vectors can be used as the similarity between the first target subgraph and each adjacent subgraph. Similarity between.
- the distance between matrix vectors can be calculated as the similarity between matrix vectors.
- the Manhattan distance between matrix vectors can be calculated as the similarity between matrix vectors, or the cosine distance between matrix vectors can be calculated as the matrix vector. similarity between vectors.
- the threshold of similarity between the first target subgraph and the neighboring subgraph may be preset.
- the similarity between the above-mentioned neighboring sub-pictures and the first target sub-picture is higher than the preset similarity threshold and the neighboring sub-picture with the highest similarity is determined as the second target sub-picture; and from the second target sub-picture Select topic nodes to recommend topics to users. It should be noted that neighboring subgraphs and adjacent subgraphs with shorter path distances from the first target subgraph can be calculated first.
- the similarity between the first target subgraph when the similarity between all adjacent subgraphs with shorter path distances and the first target subgraph is less than the preset similarity threshold, then calculate the similarity between the first target subgraph and the first target subgraph.
- the similarity between the target topic node and each topic node in the second target subgraph may be calculated.
- the calculation method of the similarity between the target topic node and each topic node in the second target subgraph is not specifically limited in this disclosure. For example, it can be used to calculate the similarity between each topic node through pre-training.
- the degree of graph neural network can also directly obtain the semantics represented by the topic nodes, calculate the semantic similarity between the topic nodes as the similarity between the target topic node and each topic node in the second target subgraph, etc. .
- the present disclosure also provides a graph neural network training method for calculating the similarity between each topic node.
- any knowledge graph can be obtained as a training sample for the graph neural network, and the training is carried out based on the following formula:
- N r (v i ) is used as a knowledge graph sample, Represents the set of all relationships contained in any graph node in the knowledge graph as well as Expressed with All relationship sets contained in other nodes that are related to each other. Adjust parameters based on the relationship set in the knowledge graph sample. as well as
- the second knowledge graph can be selected as a training sample and further trained based on the following formula:
- a threshold can be set according to the following formula, based on as well as Adjustment parameters Nodes above the threshold are retained, and nodes below the threshold are discarded.
- the graph neural network model can be trained, and based on the trained graph neural network model, the similarity between the target topic node and each topic node in the second target subgraph is calculated.
- the similarity weight of each topic node in the second target subgraph may be determined based on the similarity;
- the similarity weight is used to indicate the degree of association between the target topic node and each topic node in the second target subgraph.
- the numerical value of the similarity between the target topic node and each topic node in the second target subgraph can be directly used as the similarity weight of each topic node.
- the greater the similarity weight the greater the similarity weight of the target topic node.
- An additional multiplication factor can also be set to calculate the similarity between the target topic node and each topic node in the second target subgraph with the preset multiplication factor, so that the obtained similarity weight is more accurate.
- the topic node in the second target subgraph can be selected based on the similarity weight, and the topics corresponding to the topic nodes can be recommended. Specifically, based on the calculated similarity weight, the topic node with the largest similarity weight can be directly selected for topic recommendation.
- the above target topic node is changed to a topic node that directly corresponds to the topic type of the second target subgraph, and the relationship weight between the target topic node and each topic node in the second target subgraph can be further calculated from the second target subgraph. Select topic nodes for recommendation, which will not be described here.
- the third adjacent subgraph can be determined to be the second target subgraph through the similarity between the above-mentioned first target subgraph and the adjacent subgraph; and then the relationship between the target topic node "air conditioner" and each of the third adjacent subgraph can be calculated.
- the similarity weight between each topic node is calculated based on the target topic node and each topic node in the third adjacent subgraph, and the topic corresponding to the topic node with the largest similarity weight is recommended to the user.
- the first target subgraph and the second target subgraph can be input into pre-training
- the graph neural network model performs similarity calculation to respectively calculate the similarity between the target topic node and each topic node in the second target subgraph.
- the graph neural network model can be a graph neural network model such as GCN model, compGCN model, etc. After the first target subgraph and the second target subgraph are input into the graph neural network model, the similarity between the target topic node and each topic node in the second target subgraph can be directly calculated.
- FIG. 4 is a schematic structural diagram of an electronic device provided by an exemplary embodiment. Please refer to Figure 4.
- the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408 and a non-volatile memory 410.
- the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it.
- the execution subject of the following processing flow is not limited to Each logical unit can also be hardware or logic devices.
- FIG. 5 is a block diagram of a multi-round topic recommendation based on a knowledge graph provided by an exemplary embodiment.
- the topic acquisition unit 502 is used to obtain the topic input by the user;
- the sub-picture determining unit 504 is configured to determine the first target sub-picture corresponding to the topic type of the topic input by the user from the plurality of sub-pictures;
- Topic recommendation unit 506 is configured to recommend topics corresponding to topic nodes contained in the first target subgraph to the user, and recommend all topics corresponding to topic nodes in the first target subgraph. Afterwards, topic recommendations are made to the user for topics corresponding to topic nodes included in the adjacent subgraph with the highest similarity of the first target subgraph.
- the topic recommendation unit 506 is specifically configured to determine the target topic node corresponding to the topic input by the user in the first target subgraph;
- the relationship weight of each topic node in the first target subgraph is calculated; the relationship weight is used to indicate the target topic The degree of association between the node and each topic node in the first target subgraph;
- a topic node in the first target subgraph is selected, and the topic corresponding to the topic node is used as a target topic to recommend to the user.
- the topic recommendation unit 506 is specifically configured to traverse neighboring subgraphs adjacent to the first target subgraph, and calculate the similarity between the first target subgraph and the neighboring subgraph;
- Topics corresponding to topic nodes included in the adjacent subgraph with the highest similarity of the first target subgraph are recommended to the user.
- the topic recommendation unit 506 is specifically configured to calculate the Laplacian matrix of each of the first target subgraphs and the Laplacian matrix of the adjacent subgraphs;
- the topic recommendation unit 506 is specifically configured to: determine the adjacent sub-image whose similarity is higher than a preset similarity threshold and has the highest similarity as the second target sub-image;
- Recommend topics corresponding to topic nodes included in the second target subgraph to the user are Recommend topics corresponding to topic nodes included in the second target subgraph to the user.
- the topic recommendation unit 506 is specifically configured to calculate the similarity between the target topic node and each topic node in the second target subgraph;
- the similarity weight of each topic node in the second target subgraph is determined based on the similarity; the similarity weight is used to indicate the degree of association between the target topic node and each topic node in the second target subgraph.
- a topic node in the second target subgraph is selected, and the topic corresponding to the topic node is used as a target topic to recommend to the user.
- the topic recommendation unit 506 is specifically configured to input the first target sub-image and the second target sub-image into a pre-trained graph neural network model for similarity calculation, so as to calculate the target respectively.
- the device further includes a subgraph segmentation unit, configured to segment the knowledge graph into several subgraphs based on a random walk segmentation algorithm.
- a subgraph segmentation unit configured to segment the knowledge graph into several subgraphs based on a random walk segmentation algorithm.
- the topic acquisition unit 502 is specifically configured to obtain the user's input content and the user's historical input content in the question and answer system;
- semantic analysis is performed on the user's input content and the user's historical input content in the question and answer system to determine the topic corresponding to the user's input content.
- a typical implementation device is a computer.
- the specific implementation of the computer This may take the form of a personal computer, laptop, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any of these devices any combination of equipment.
- a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
- RAM random access memory
- ROM read-only memory
- flash RAM flash random access memory
- Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
- Information may be computer-readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- read-only memory read-only memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- flash memory or other memory technology
- compact disc read-only memory CD-ROM
- DVD digital versatile disc
- Magnetic tape cartridges magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by computing devices.
- computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
- first, second, third, etc. may be used to describe various information in one or more embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
- first information may also be called second information, and similarly, the second information may also be called first information.
- word “if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开提供一种基于知识图谱的多轮话题推荐方法、装置、电子设备及可读存储介质,通过在人工问答系统维护了预先构建的用于进行话题推荐的知识图谱,所述知识图谱包括分别对应不同的话题类型的若干子图;所述若干子图中的任一子图包含若干存在关系的同一话题类型的话题节点;并可以由人工问答系统获取用户输入的话题;从所述若干子图中确定与用户输入的话题的话题类型对应的第一目标子图;将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
Description
相关申请的交叉引用
本申请要求于2022年08月29日提交的、申请号为202211065167.7的中国专利申请的优先权,该申请以引用的方式并入本文中。
本公开涉及计算机技术领域,尤其涉及一种基于知识图谱的多轮话题推荐方法及装置。
随着计算机技术和网络技术的发展,人机交互的场景越来越广泛。人机问答系统是人机交互领域的重要课题,人机问答系统可以根据用户输入的问题,自动的选择或者生成相应的回复。在人机问答系统中,通常是由用户输入问题,系统回答问题,而如何由人机问答系统基于用户输入的内容推进话题,引导用户与人机问答系统进行多轮对话,是本领域亟待解决的问题。
发明内容
有鉴于此,本公开一个或多个实施例提供一种基于知识图谱的多轮话题推荐方法及装置,以解决相关技术中存在的问题。
为实现上述目的,本公开一个或多个实施例提供技术方案如下:
根据本公开一个或多个实施例的第一方面,提出了一种基于知识图谱的多轮话题推荐方法,应用于人机问答系统,所述人机问答系统包括预先构建的用于进行话题推荐的知识图谱,所述知识图谱包括分别对应不同的话题类型的若干子图;所述若干子图中的任一子图包含同一话题类型的、相互关联的若干话题节点,所述方法包括:
获取用户输入的话题;
从所述若干子图中确定与用户输入的话题的话题类型对应的第一目标子图;
将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在
所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
根据本公开一个或多个实施例的第二方面,提出了一种基于知识图谱的多轮话题推荐装置,应用于人机问答系统,所述人机问答系统包括预先构建的用于进行话题推荐的知识图谱,将所述知识图谱包括分别对应不同的话题类型的若干子图;所述若干子图中的任一子图包含相互关联的若干话题节点,所述装置包括:
话题获取单元,获取用户输入的话题;
子图确定单元,从所述若干子图中确定与用户输入的话题的话题类型对应的第一目标子图;
话题推荐单元,将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
根据本公开一个或多个实施例的第三方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本公开一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
本申请的有益效果:
本申请通过将知识图谱分割若干子图,先从与用户输入话题的话题类型对应的子图中进行话题推荐,再从其他相关度最高的子图中进行话题推荐,可以结合知识图谱中丰富的数据信息,使得人与机器谈论的话题更加深入,同时也可以实现了推荐的话题的丰富性和多样性。
图1是一示例性实施例提供的一种用于进行话题推荐的知识图谱的子图的示意图。
图2是一示例性实施例提供的一种基于知识图谱的多轮话题推荐方法的流程图。
图3是一示例性实施例提供的一种展示知识图谱中各个子图之间关系的示意图。
图4是一示例性实施例提供的一种电子设备的示意结构图。
图5是一示例性实施例提供的一种基于知识图谱的多轮话题推荐装置的框图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本公开示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本公开所描述的更多或更少。此外,本公开中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本公开中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
人机问答系统,可以应用于诸多领域,例如电商平台的客服服务,智能汽车搭载的中控显示,智能音箱搭载的人工智能语音交互引擎等等,均可以作为一种人机问答系统。现有的人机问答系统通常是由用户提出问题,由人机问答系统识别用户输入的问题,再从预设的问答库中选择问题的答案;或是由人机问答系统识别用户输入的问题中的相关实体,再从预设的知识图谱中找到与实体具有关系的其他实体,并基于自然语言处理技术将与该实体具有关系的其他实体组织为问题的答案。
而现有技术中的人机问答系统通常是由用户提出问题,再由人机问答系统给出问题的答案,不能进行话题推荐。或是人机问答系统在给出问题的答案后,只能基于预设的问题库中的问题进行提问,在进行多轮对话后,人机问答系统再次提出的问题往往是重复的问题,并不能使人与机器谈论的话题更加深入。
有鉴于此,本公开提出一种基于知识图谱的多轮对话方法,通过将知识图谱切割为具有若干话题类型的子图,先从与用户输入话题的话题类型对应的子图中进行话题推荐,再从其他相关度最高的子图中进行话题推荐的技术方案。
在实现时,可以获取用户输入的话题;从所述若干子图中确定与用户输入的话题的
话题类型对应的第一目标子图;将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
下面结合附图对本公开的基于知识图谱的多轮话题推荐方法进行详细说明。
在本公开中,人机问答系统可以维护预先构建的用于进行话题推荐的知识图谱,其中知识图谱可以包括若干个话题节点,每个话题节点之间相互关联。人机问答系统可以基于知识图谱中的话题节点对应的话题进行话题推荐。在本公开中,对构建知识图谱的具体方式不做限定,例如,可以通过多种渠道获取结构化数据源,构建用于进行话题推荐的知识图谱;也可以通过技术手段,从百科类网站或数据中心采集数据,构建知识库,再进一步构建进行话题推荐的知识图谱等等。
其中,上述知识图谱还可以包括分别对应不同话题类型的若干子图,所述若干子图中的任一子图包含同一话题类型的相互关联的话题节点。以应用在智能汽车搭载的中控显示的人机问答系统为例,可以将与智能汽车的空调的设置相关的的节点划分为同一话题类型,因此该话题类型可以是“空调”。以应用在电商平台的客服服务的人机问答系统为例,可以将与A商品的参数相关的节点划分为同一话题类型,因此该话题类型可以是“A商品”。
图1是一示例性实施例提供的一种用于进行话题推荐知识图谱的子图的示意图。如图1所示,该子图可以包括与空调相关的设置的若干话题节点,因此该子图的话题类型可以是“空调”。人机问答系统可以基于该子图中的话题节点,针对所输入的话题进行话题推荐。
在一种实施方式中,可以基于随机游走分割算法,将人机问答系统维护的预先构建的用于进行话题推荐的知识图谱分割为若干子图。其中,随机游走分割算法的具体实现方式,在本公开中不再赘述。具体的,可以由用户指定知识图谱中的若干话题节点,作为标记节点,基于标记节点和与标记节点相邻的未标记的邻接节点之间的关系,计算从标记节点转移到邻接节点的概率,根据概率大小,划分未标记节点,得到最终分割结果,以将预先构建的用于进行话题推荐的知识图谱分割为若干子图。图2是一示例性实施例提供的一种基于知识图谱的多轮话题推荐方法的流程图。如图2所示,该方法可以包括以下步骤202至206。
步骤202,获取用户输入的话题。
在本公开中,人机问答系统可以基于用户输入的内容,获取用户输入的话题;其中,用户可以输入文本形式的内容、音频形式的内容等等。针对文本形式的内容,人机问答系统可以基于语义分析等技术,从文本形式内容中提取出用户输入的话题;针对音频形式的内容,人机问答系统可以先将音频转化为文本,再从文本形式内容中提取出用户输入的话题。
例如,当用户输入“请打开空调。”,人机问答系统可以基于语义分析等技术,确定当前话题为“打开”。又例如,当用户输入“A商品的价格是多少?”,人机问答系统可以确定当前话题为“价格”。
在一种实施方式中,不仅可以获取用户输入的内容,还可以获取用户在人机问答系统中的历史输入内容,并基于语义分析技术,对所述用户的输入内容,以及所述用户在所述问答系统中的历史输入内容进行语义分析,以确定用户的输入内容对应的话题。
例如,当用户输入“请打开空调。”后,经过一段时间后,用户再次输入“关闭。”,人机问答系统可以结合用户当前输入的内容以及用户历史输入的内容,确定当前话题为空调的“关闭”。又例如,当用户输入“A商品的价格是多少?”后,再次输入“是否具有其他优惠?”,人机问答系统可以结合用户当前输入的内容以及用户历史输入的内容,确定当前话题为A商品的“优惠”。
步骤204,从所述若干子图中确定与用户输入的话题的话题类型对应的第一目标子图。
在获取到用户输入的话题后,可以确定该话题对应的话题类型,并根据该话题的话题类型确定第一目标子图。在本公开中,目标子图是指与话题类型对应的子图,例如图1示出的子图,其话题类型为“空调”。
例如,当用户输入“请打开空调。”后,再次输入“调整温度为26度。”,此时可以确定当前话题为空调的“温度”,由于与“温度”相关的话题节点,属于与空调相关的子图,因此可以确定当前话题类型为“空调”,可以通过话题类型进一步确定与“空调”对应的第一目标子图。又例如,当用户输入“A商品的价格是多少?”后,再次输入“A商品的材质是?”,此时可以确定当前话题为A商品的“材质”,由于与“材质”相关的话题节点,属于与A商品相关的子图,因此可以确定当前话题类型为“A商品”,可以通过话题类型进一步确定与“A商品”对应的第一目标子图。
步骤206,将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
在获取到用户输入的话题,确定该话题对应的第一目标子图后,可以从第一目标子图中选择话题节点对应的话题进行推荐。其中,话题节点的具体选择方式在本公开不做具体限定,例如,可以基于第一目标子图中各个话题节点之间的关系计算关系权重,基于关系权重来推荐话题,也可以随机选择第一目标子图内的话题节点对应的话题进行推荐,还可以在子图分割过程中由用户指定各个话题节点的推荐顺序等等。
在本公开中,确定用于进行话题推荐的话题节点后,人机问答系统可以基于自然语言处理领域的相关技术,将话题节点对应的话题组织为完整的语句向用户进行输出展示。
在一种实施方式中,可以确定所述用户输入的话题在所述第一目标子图中对应的目标话题节点。在本公开中,目标话题节点可以指与话题类型之直接对应的话题节点。通常情况下,在确定用户输入的话题后,可以在第一目标子图中确定对应的话题节点。
例如,当用户输入“请打开空调。”可以确定话题类型为“空调”,因此第一目标子图为与空调相关的子图,目标节点即为第一目标子图中的“空调”节点。
当确定目标话题节点后,可以基于所述目标话题节点与所述第一目标子图中各个话题节点之间的关系,计算第一目标子图中各个话题节点的关系权重。所述关系权重用于指示所述目标话题节点与所述第一目标子图中各个话题节点的关联程度。基于所述关系权重,选择所述第一目标子图中的话题节点,并将所述话题节点对应的话题作为目标话题对所述用户进行推荐。
其中,目标话题节点与所述第一目标子图中各个话题节点之间的关系可以为知识图谱中获取的三元组关系;可以将所述三元组结构输入预先训练的神经网络模型,得到每个三元组结构对应的权重值,作为计算第一目标子图中各个话题节点的关系权重。其中,神经网络模型可以使用Word2vec等模型,本公开对此不作限定。关系权重用于指示所述目标话题节点与所述第一目标子图中各个话题节点的关联程度,关系权重越大,目标话题节点与第一目标子图中的话题节点的关联程度越高。
例如,以图1示出的子图为例,可以将三元组“空调”控制“温度”作为目标话题节点“空调”与第一目标子图中的话题节点“温度”之间的关系,可以将该三元组关系
输入预先训练的神经网络模型,得到三元组结构对应的权重值,作为话题节点“温度”的关系权重。需要说明的是,以图1示出的子图为例,“9号香水”与目标话题节点“温度”并没有直接关系,而存在间接关系,因此可以将三元组“空调”控制“香氛胶囊”和“香氛胶囊”的味道是“9号香水”两组三元组结构均输入神经网络模型,分别得到两组三元组结构对应的两个权重值,可以计算两个权重值的乘积,作为“9号香水”对应的权重值。同时,计算存在间接关系的话题节点的关系权重时,还可以为话题节点间路径的距离,额外设置乘法因子,以使得到的关系权重更加准确。
在确定第一目标子图中各个话题节点的关系权重后,可以基于关系权重选择第一目标子图中的话题节点,并将话题节点对应的话题进行推荐。具体的,可以基于计算出的关系权重的大小,直接选择用于话题推荐的话题节点。
例如,以图1示出的子图为例,“打开/关闭”节点的关系权重为0.9,“香氛胶囊”节点的关系权重为0.8,“温度”节点的关系权重为0.75,“9号香水”节点的关系权重为0.72,当目标话题节点为“空调”时,可以基于“打开/关闭”,“香氛胶囊”,“温度”的顺序向用户进行话题推荐。
需要说明的是,问答系统还可以存储已经推荐过的话题节点,并存储该话题节点对应的关系权重。当基于关系权重推荐某一话题节点后,还需要判断其他话题节点与该被推荐过的话题节点是否存在关系,如果某一话题节点与被推荐过的话题节点存在关系则需要将该话题节点的关系权重与推荐过的话题节点的关系权重进行除法运算得到新的关系权重,并更新该节点的关系权重。同时,如果预先设置乘法因子,也需要与乘法因子进行除法运算,并更新该节点的关系权重。
例如,以图1示出的子图为例,“打开/关闭”节点的关系权重为0.9,“香氛胶囊”节点的关系权重为0.8,“温度”节点的关系权重为0.75,“9号香水”节点的关系权重为0.72,当目标话题节点为“空调”时,可以基于“打开/关闭”,“香氛胶囊”,“温度”的顺序向用户进行话题推荐。当向用户推荐了“香氛胶囊”后,由于“9号香水”与“香氛胶囊”相互关联,因此需要将“9号香水”的关系权重与“香氛胶囊”的关系权重进行除法运算得到新的关系权重0.9,此时可以基于“9号香水”,“温度”的顺序向用户进行话题推荐。
当第一目标子图中包含的话题节点对应的话题均向用户进行推荐后,可以找到与第一目标子图相似度最高的邻近子图,并从邻近子图中确定用于进行话题推荐的话题节点。
在一种实施方式中,可以遍历与所述第一目标子图相邻的邻近子图,计算第一目标
子图与邻近子图之间的相似度,并将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。需要说明的是,在遍历邻近子图时,可以基于子图之间路径的距离,优先计算与第一目标子图之间路径的距离较短的邻近子图与第一目标子图之间的相似度,再进一步计算与第一目标子图之间路径的距离较长的邻近子图与第一目标子图之间的相似度。其中,计算第一目标子图与邻近子图之间的相似度的具体方式,在本公开中不做限定,例如,可以基于计算第一目标子图与邻近子图中各个节点的之间的相似度综合计算第一目标子图与邻近子图之间的相似度,也可以基于第一目标子图与邻近子图的图结构生成第一目标子图对应的向量和邻近子图对应的向量,并计算向量之间的相似度以作为第一目标子图与邻近子图之间的相似度。
图3是一示例性实施例提供的一种展示知识图谱中各个子图之间关系的示意图。如图3所示,由于第一邻近子图、第三邻近子图、第四邻近子图与第一目标子图之间的路径的距离为1,而第二邻近子图与第一目标子图之间的路径的距离为2,因此,可以分别计算第一目标子图与第一邻近子图、第三邻近子图、第四邻近子图之间的相似度,再计算第一目标子图与第二邻近子图之间的相似度。
在一种实施方式中,可以计算所述第一目标子图的拉普拉斯矩阵和每个邻近子图的拉普拉斯矩阵,其中,所述第一目标子图的拉普拉斯矩阵和每个邻近子图的拉普拉斯矩阵可以通过分别计算第一目标子图和每个邻近子图的度矩阵以及邻接矩阵来获得,即,将度矩阵减去邻接矩阵即可得到拉普拉斯矩阵。
在计算出第一目标子图和每个邻近子图的拉普拉斯矩阵后,可以计算第一目标子图对应的矩阵向量和每个邻近子图对应的矩阵向量;其中,矩阵向量的具体计算方式可以参考线性代数相关内容,在本公开中不再赘述。
计算所述第一目标子图和每个邻近子图的矩阵向量后,可以计算矩阵向量之间的相似度,将矩阵向量之间的相似度作为第一目标子图和每个邻近子图之间的相似度。其中,可以计算矩阵向量之间的距离作为矩阵向量之间的相似度,例如,可以计算矩阵向量之间的曼哈顿距离作为矩阵向量之间的相似度,或者计算矩阵向量之间的余弦距离作为矩阵向量之间的相似度。
在一种实施方式中,可以预先设定第一目标子图和邻近子图之间的相似度的阈值。将上述邻近子图中与第一目标子图之间的相似度高于预设的相似度阈值,且相似度最高的邻近子图确定为第二目标子图;并从第二目标子图中选择话题节点,向用户进行话题推荐。需要说明的是,可以优先计算与第一目标子图之间路径的距离较短的邻近子图与
第一目标子图之间的相似度,当所有路径的距离较短的邻近子图与第一目标子图之间的相似度均小于预设的相似度阈值时,再计算与第一目标子图之间路径的距离更大的邻近子图与第一目标子图之间的相似度。
例如,以图3为例,由于第一邻近子图、第三邻近子图、第四邻近子图与第一目标子图之间的路径的距离为1,而第二邻近子图与第一目标子图之间的路径的距离为2,因此,可以优先计算第一目标子图与第一邻近子图、第三邻近子图、第四邻近子图之间的相似度,当上述相似度均低于阈值时,再计算第一目标子图与第二邻近子图之间的相似度。
在一种实施方式中,在确定第二目标子图后,需要从第二目标子图中确定用于进行话题推荐的话题节点。在本公开中,可以计算所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度。其中,目标话题节点与所述第二目标子图中各个话题节点之间的相似度的计算方式,在本公开中不做具体限定,例如,可以通过预先训练用于计算各个话题节点之间相似度的图神经网络,还可以直接获取话题节点所代表的语义,计算话题节点之间的语义的相似度作为目标话题节点与所述第二目标子图中各个话题节点之间的相似度等等。
在一种实施方式中,本公开还提供一种图神经网络的训练方法,用于计算各个话题节点之间相似度。
其中,可以获取任意知识图谱作为图神经网络的训练样本,基于以下公式进行训练:
其中Nr(vi)作为一个知识图谱样本,表示知识图谱中任一图节点包含的所有关系集合以及表示与所在节点相互关联的其他节点包含的所有关系集合,基于知识图谱样本中的关系集合,调整参数以及
然后可以选择第二个知识图谱作为训练样本,基于以下公式进一步进行训练:
其中,表示第二个知识图谱样本中全部节点之间的关系集合,基于第一个知识图谱中全部节点之间的关系集合,以及第二个知识图谱样本中全部节点之间的关系集
合,调整参数
进一步的,可以设定阈值根据以下公式,基于以及调整参数高于阈值的节点保留,低于阈值的节点丢弃。
最后,根据以下公式,对知识图谱样本中的节点之间的关系集合进行更新。
通过以上图神经网络的训练方法,可以训练图神经网络模型,并基于训练好的图神经网络模型,计算目标话题节点与所述第二目标子图中各个话题节点之间的相似度。
在计算出目标话题节点与所述第二目标子图中各个话题节点之间的相似度之后,可以基于所述相似度确定所述第二目标子图中各个话题节点的相似度权重;所述相似度权重用于指示目标话题节点与所述第二目标子图中各个话题节点的关联程度。其中,可以将目标话题节点与所述第二目标子图中各个话题节点之间的相似度的数值大小,直接作为各个话题节点的相似度权重,所述相似度权重越大,说明目标话题节点与第二目标子图中的话题节点的关联程度越高。还可以额外设置乘法因子,将目标话题节点与所述第二目标子图中各个话题节点之间的相似度与预设的乘法因子进行计算,以使得到的相似度权重更加准确。
在确定第二目标子图中各个话题节点的相似度权重后,可以基于相似度权重选择第二目标子图中的话题节点,并将话题节点对应的话题进行推荐。具体的,可以基于计算出的相似度权重的大小,直接选择相似度权重最大的话题节点,进行话题推荐。
需要说明的是,从第二目标子图选择出话题节点后,再次进行话题推荐时需要进一步从第二目标子图中选择话题节点。因此,上述目标话题节点变更为与第二目标子图的话题类型直接对应的话题节点,可以通过计算目标话题节点与第二目标子图中各个话题节点的关系权重,进一步从第二目标子图中选择话题节点进行推荐,在此处不再赘述。
例如,可以通过上述第一目标子图和邻近子图之间的相似度,确定第三邻接子图为第二目标子图;然后可以计算目标话题节点“空调”与第三邻接子图中各个话题节点之间的相似度,基于目标话题节点与第三邻接子图中各个话题节点计算每个话题节点之间的相似度权重,将相似度权重最大的话题节点对应的话题向用户进行推荐。
在一种实施方式中,可以将将所述第一目标子图和所述第二目标子图输入预先训练
的图神经网络模型进行相似度计算,以分别计算出所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度。其中,图神经网络模型可以是GCN模型,compGCN模型等图神经网络模型。将所述第一目标子图和所述第二目标子图输入图神经网络模型后,可以直接计算目标话题节点与所述第二目标子图中各个话题节点之间的相似度。
图4是一示例性实施例提供的一种电子设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他任务所需要的硬件。本公开一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本公开一个或多个实施例并不排除其他实现方式,比如逻辑器件亦或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图5,图5是一示例性实施例提供的一种基于知识图谱的多轮话题推荐的框图。
话题获取单元502,用于获取用户输入的话题;
子图确定单元504,用于从所述若干子图中确定与用户输入的话题的话题类型对应的第一目标子图;
话题推荐单元506,用于将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
可选的,所述话题推荐单元506,具体用于确定所述用户输入的话题在所述第一目标子图中对应的目标话题节点;
基于所述目标话题节点与所述第一目标子图中各个话题节点之间的关系,计算所述第一目标子图中各个话题节点的关系权重;所述关系权重用于指示所述目标话题节点与所述第一目标子图中各个话题节点的关联程度;
基于所述关系权重,选择所述第一目标子图中的话题节点,并将所述话题节点对应的话题作为目标话题对所述用户进行推荐。
可选的,所述话题推荐单元506,具体用于遍历与所述第一目标子图相邻的邻近子图,计算所述第一目标子图和所述邻近子图之间的相似度;
将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
可选的,所述话题推荐单元506,具体用于计算所述第一目标子图中每个的拉普拉斯矩阵和所述邻近子图的拉普拉斯矩阵;
分别基于所述第一目标子图的拉普拉斯矩阵和所述邻近子图中每个的拉普拉斯矩阵,计算第一目标子图对应的矩阵向量和所述邻近子图中每个对应的矩阵向量;
计算所述第一目标子图的矩阵向量和所述邻近子图中每个的矩阵向量之间的相似度,作为所述第一目标子图和所述邻近子图中每个之间的相似度。
可选的,所述话题推荐单元506,具体用于:将所述相似度高于预设的相似度阈值,且相似度最高的所述邻近子图确定为第二目标子图;
将所述第二目标子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
可选的,所述话题推荐单元506,具体用于计算所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度;
基于所述相似度确定所述第二目标子图中各个话题节点的相似度权重;所述相似度权重用于指示目标话题节点与所述第二目标子图中各个话题节点的关联程度。
基于所述相似度权重,选择所述第二目标子图中的话题节点,并将所述话题节点对应的话题作为目标话题对所述用户进行推荐。
可选的,所述话题推荐单元506,具体用于将所述第一目标子图和所述第二目标子图输入预先训练的图神经网络模型进行相似度计算,以分别计算出所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度。
可选的,所述装置还包括子图分割单元,用于基于随机游走分割算法,将所述知识图谱分割为若干子图。
可选的,话题获取单元502具体用于获取用户的输入内容,以及所述用户在所述问答系统中的历史输入内容;
基于语义分析技术,对所述用户的输入内容,以及所述用户在所述问答系统中的历史输入内容进行语义分析,以确定用户的输入内容对应的话题。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体
形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本公开特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本公开一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开一个或多个实施例。在本公开一个或多个实施例和所附权利要求书中
所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本公开一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本公开一个或多个实施例的较佳实施例而已,并不用以限制本公开一个或多个实施例,凡在本公开一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开一个或多个实施例保护的范围之内。
Claims (12)
- 一种基于知识图谱的多轮话题推荐方法,应用于人机问答系统,所述人机问答系统包括预先构建的用于进行话题推荐的知识图谱,所述知识图谱包括分别对应不同的话题类型的若干子图;所述若干子图中的任一子图包含同一话题类型的、相互关联的若干话题节点,所述方法包括:获取用户输入的话题;从所述若干子图中确定与所述用户输入的所述话题的话题类型对应的第一目标子图;将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
- 根据权利要求1所述的方法,将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,包括:确定所述用户输入的所述话题在所述第一目标子图中对应的目标话题节点;基于所述目标话题节点与所述第一目标子图中各个话题节点之间的关系,计算所述第一目标子图中各个话题节点的关系权重;所述关系权重用于指示所述目标话题节点与所述第一目标子图中各个话题节点的关联程度;基于所述关系权重,选择所述第一目标子图中的话题节点,并将所述话题节点对应的话题作为目标话题对所述用户进行推荐。
- 根据权利要求1所述的方法,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐,包括:遍历与所述第一目标子图相邻的邻近子图,计算所述第一目标子图和所述邻近子图中每个之间的相似度;将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
- 根据权利要求3所述的方法,计算所述第一目标子图和所述邻近子图中每个之间的相似度,包括:计算所述第一目标子图的拉普拉斯矩阵和所述邻近子图中每个的拉普拉斯矩阵;分别基于所述第一目标子图的拉普拉斯矩阵和所述邻近子图中每个的拉普拉斯矩阵,计算第一目标子图对应的矩阵向量和所述邻近子图中每个对应的矩阵向量;计算所述第一目标子图的矩阵向量和所述邻近子图中每个的矩阵向量之间的相似 度,作为所述第一目标子图和所述邻近子图中每个之间的相似度。
- 根据权利要求3所述的方法,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐,包括:将所述相似度高于预设的相似度阈值,且相似度最高的所述邻近子图确定为第二目标子图;将所述第二目标子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
- 根据权利要求5所述的方法,将所述第二目标子图中包含的话题节点对应的话题,向所述用户进行话题推荐,包括:计算所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度;基于所述相似度确定所述第二目标子图中各个话题节点的相似度权重;其中,所述相似度权重用于指示所述目标话题节点与所述第二目标子图中各个话题节点的关联程度;基于所述相似度权重,选择所述第二目标子图中的话题节点,并将所述话题节点对应的话题作为目标话题对所述用户进行推荐。
- 根据权利要求6所述的方法,计算所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度,包括:将所述第一目标子图和所述第二目标子图输入预先训练的图神经网络模型进行相似度计算,以分别计算出所述目标话题节点与所述第二目标子图中各个话题节点之间的相似度。
- 根据权利要求1所述的方法,所述方法还包括:基于随机游走分割算法,将所述知识图谱分割为若干子图。
- 根据权利要求1所述的方法,所述获取用户输入的话题,包括:获取用户的输入内容,以及所述用户在所述问答系统中的历史输入内容;基于语义分析技术,对所述用户的输入内容,以及所述用户在所述问答系统中的历史输入内容进行语义分析,以确定用户的输入内容对应的话题。
- 一种基于知识图谱的多轮话题推荐装置,应用于人机问答系统,所述人机问答系统包括预先构建的用于进行话题推荐的知识图谱,将所述知识图谱包括分别对应不同的话题类型的若干子图;所述若干子图中的任一子图包含相互关联的若干话题节点,所述装置包括:话题获取单元,用于获取用户输入的话题;子图确定单元,用于从所述若干子图中确定与所述用户输入的话题的话题类型对应 的第一目标子图;话题推荐单元,用于将所述第一目标子图中包含的话题节点对应的话题向所述用户进行话题推荐,并在所述第一目标子图中的话题节点对应的话题均推荐完成之后,将与所述第一目标子图的相似度最高的邻近子图中包含的话题节点对应的话题,向所述用户进行话题推荐。
- 一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如权利要求1-9中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-9中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211065167.7 | 2022-08-29 | ||
| CN202211065167.7A CN115422346A (zh) | 2022-08-29 | 2022-08-29 | 基于知识图谱的多轮话题推荐方法 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024045964A1 true WO2024045964A1 (zh) | 2024-03-07 |
Family
ID=84202491
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/109627 Ceased WO2024045964A1 (zh) | 2022-08-29 | 2023-07-27 | 基于知识图谱的多轮话题推荐方法 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115422346A (zh) |
| WO (1) | WO2024045964A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118863044A (zh) * | 2024-08-21 | 2024-10-29 | 成都融郁行科技合伙企业(有限合伙) | 多尺度的课程知识图谱构建方法和智能课程教学方法 |
| CN120596633A (zh) * | 2025-06-05 | 2025-09-05 | 中国中医科学院 | 基于知识图谱的信息获取方法、装置、设备和存储介质 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115422346A (zh) * | 2022-08-29 | 2022-12-02 | 浙江极氪智能科技有限公司 | 基于知识图谱的多轮话题推荐方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111639169A (zh) * | 2020-05-29 | 2020-09-08 | 京东方科技集团股份有限公司 | 人机交互方法及装置、计算机可读存储介质及电子设备 |
| CN112765322A (zh) * | 2021-01-25 | 2021-05-07 | 河海大学 | 基于水利领域知识图谱的遥感影像搜索推荐方法 |
| CN113297369A (zh) * | 2021-07-26 | 2021-08-24 | 中国科学院自动化研究所 | 基于知识图谱子图检索的智能问答系统 |
| CN114550705A (zh) * | 2022-02-18 | 2022-05-27 | 北京百度网讯科技有限公司 | 对话推荐方法、模型的训练方法、装置、设备及介质 |
| CN115422346A (zh) * | 2022-08-29 | 2022-12-02 | 浙江极氪智能科技有限公司 | 基于知识图谱的多轮话题推荐方法 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104217038A (zh) * | 2014-09-30 | 2014-12-17 | 中国科学技术大学 | 一种针对财经新闻的知识网络构建方法 |
| CN108415932B (zh) * | 2018-01-23 | 2023-12-22 | 思必驰科技股份有限公司 | 人机对话方法及电子设备 |
| CN109597856B (zh) * | 2018-12-05 | 2020-12-25 | 北京知道创宇信息技术股份有限公司 | 一种数据处理方法、装置、电子设备及存储介质 |
| CN111460120A (zh) * | 2020-03-31 | 2020-07-28 | 河北省讯飞人工智能研究院 | 一种对话管理方法、装置、设备及存储介质 |
| US12242975B2 (en) * | 2020-10-01 | 2025-03-04 | International Business Machines Corporation | Querying knowledge graphs with sub-graph matching networks |
-
2022
- 2022-08-29 CN CN202211065167.7A patent/CN115422346A/zh active Pending
-
2023
- 2023-07-27 WO PCT/CN2023/109627 patent/WO2024045964A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111639169A (zh) * | 2020-05-29 | 2020-09-08 | 京东方科技集团股份有限公司 | 人机交互方法及装置、计算机可读存储介质及电子设备 |
| CN112765322A (zh) * | 2021-01-25 | 2021-05-07 | 河海大学 | 基于水利领域知识图谱的遥感影像搜索推荐方法 |
| CN113297369A (zh) * | 2021-07-26 | 2021-08-24 | 中国科学院自动化研究所 | 基于知识图谱子图检索的智能问答系统 |
| CN114550705A (zh) * | 2022-02-18 | 2022-05-27 | 北京百度网讯科技有限公司 | 对话推荐方法、模型的训练方法、装置、设备及介质 |
| CN115422346A (zh) * | 2022-08-29 | 2022-12-02 | 浙江极氪智能科技有限公司 | 基于知识图谱的多轮话题推荐方法 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118863044A (zh) * | 2024-08-21 | 2024-10-29 | 成都融郁行科技合伙企业(有限合伙) | 多尺度的课程知识图谱构建方法和智能课程教学方法 |
| CN120596633A (zh) * | 2025-06-05 | 2025-09-05 | 中国中医科学院 | 基于知识图谱的信息获取方法、装置、设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115422346A (zh) | 2022-12-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2024045964A1 (zh) | 基于知识图谱的多轮话题推荐方法 | |
| CN108829808B (zh) | 一种页面个性化排序方法、装置及电子设备 | |
| WO2022041979A1 (zh) | 一种信息推荐模型的训练方法和相关装置 | |
| CN111061946A (zh) | 场景化内容推荐方法、装置、电子设备及存储介质 | |
| CN116010574A (zh) | 智能对话处理的方法、云服务器及可读存储介质 | |
| US12259895B1 (en) | Behavior-driven query similarity prediction based on language model for database search | |
| JP7488871B2 (ja) | 対話推薦方法、装置、電子機器、記憶媒体ならびにコンピュータプログラム | |
| CN114330704B (zh) | 语句生成模型更新方法、装置、计算机设备和存储介质 | |
| CN108021691A (zh) | 答案查找方法、客服机器人以及计算机可读存储介质 | |
| CN115391489A (zh) | 基于知识图谱的话题推荐方法 | |
| US20250165529A1 (en) | Interactive real-time video search based on knowledge graph | |
| CN118210893A (zh) | 答案生成方法、装置、设备、存储介质及产品 | |
| CN116304332A (zh) | 一种知识图谱混合推荐方法 | |
| CN118964585A (zh) | 基于大语言模型的连续问答方法、装置及电子设备 | |
| CN119557462A (zh) | 信息检索方法、装置、设备、可读存储介质和程序产品 | |
| CN115186177A (zh) | 一种社交信息推荐方法、装置、计算机设备及存储介质 | |
| US10878339B2 (en) | Leveraging machine learning to predict user generated content | |
| CN111611409B (zh) | 一种融入场景知识的事例分析方法及相关设备 | |
| CN111161706A (zh) | 交互方法、装置、设备和系统 | |
| CN106096653B (zh) | 基于跨平台用户社交多媒体行为的人口属性推断方法 | |
| CN119961393A (zh) | 模型训练方法、装置、计算机设备及计算机可读存储介质 | |
| CN115130000B (zh) | 一种信息推荐的方法、装置、存储介质及电子设备 | |
| Zheng et al. | Personality-aware recommendations: An empirical study in education | |
| CN114005014B (zh) | 一种模型训练、社交互动策略优化方法 | |
| CN106776529B (zh) | 业务情感分析方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23858999 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23858999 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.08.2025) |