CN115391489A - Topic recommendation method based on knowledge graph - Google Patents
Topic recommendation method based on knowledge graph Download PDFInfo
- Publication number
- CN115391489A CN115391489A CN202211042686.1A CN202211042686A CN115391489A CN 115391489 A CN115391489 A CN 115391489A CN 202211042686 A CN202211042686 A CN 202211042686A CN 115391489 A CN115391489 A CN 115391489A
- Authority
- CN
- China
- Prior art keywords
- topic
- graph
- knowledge graph
- user
- nodes
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06F16/337—Profile generation, learning or modification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- Molecular Biology (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Animal Behavior & Ethology (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The specification provides a topic recommendation method based on a knowledge graph, which is characterized in that a pre-constructed knowledge graph for topic recommendation is maintained in an artificial question-answering system, and topics input by a user are acquired; determining a target topic node corresponding to the topic input by the user in the knowledge graph; calculating semantic similarity between the target topic node and the topic nodes in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node; and selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user.
Description
Technical Field
One or more embodiments of the present specification relate to the field of computer technologies, and in particular, to a topic recommendation method and apparatus based on a knowledge graph.
Background
With the development of computer technology and network technology, the scenes of human-computer interaction become more and more extensive. The man-machine question-answering system is an important subject in the field of man-machine interaction, and can automatically select or generate corresponding replies according to questions input by a user.
In a man-machine question-answer system, the mainstream technology is to perform end-to-end neural network training based on question-answer pairs, and to freely generate answers to questions by using a large number of question-answer pairs, and by this way, the contents of conversation are relatively divergent, and topic recommendation cannot be performed in combination with historical information input by a user.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method and an apparatus for topic recommendation based on a knowledge graph, so as to solve the problems in the related art.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, a knowledge graph-based topic recommendation method is provided, which is applied to a human-computer question-and-answer system that maintains a knowledge graph for topic recommendation, wherein the knowledge graph includes topic nodes having several relationships; the man-machine question-answering system also maintains historical question-answering information of the user, and the method comprises the following steps:
obtaining topics input by the user;
determining a target topic node corresponding to the topic input by the user in the knowledge graph;
calculating semantic similarity between the target topic node and the topic nodes in the knowledge graph; the semantic similarity is used for indicating the degree of association between the topic node in the knowledge graph and the target topic node;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user.
Optionally, the knowledge graph comprises a real-time information knowledge graph constructed based on real-time information; the real-time information comprises information obtained in real time based on the geographic position of the user.
Optionally, the human-computer question-and-answer system maintains a user information knowledge graph constructed based on user information and historical question-and-answer information of the user, wherein the user information knowledge graph comprises a plurality of topic nodes recommended to the user; wherein the topic node has a time feature value indicating the time when the topic node was last recommended by the human question and answer system;
selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user, wherein the topic nodes comprise:
determining time characteristic values of topic nodes in the knowledge graph based on the user information knowledge graph;
calculating a time weight of a topic node in the knowledge graph based on the time characteristic value; the time weight is used for indicating the recommended importance degree of topic nodes in the knowledge graph within a preset time period;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the time weight, and recommending topics to the user.
Optionally, calculating semantic similarity between the target topic node and the topic nodes in the knowledge graph includes:
and inputting the knowledge graph into a pre-trained graph neural network for semantic similarity calculation, and determining semantic similarity between the target topic node and other topic nodes in the knowledge graph.
Optionally, the method further includes:
the following training process is repeatedly executed to carry out supervised training on the graph neural network:
selecting a plurality of knowledge graphs from a preset knowledge graph library as training samples, and extracting graph nodes and relations among the graph nodes from the training samples;
respectively coding the graph nodes to obtain graph node codes, and respectively coding the relations among the graph nodes to obtain relation codes;
and combining the graph node codes and the relation codes, inputting the graph node codes and the relation codes into the graph neural network, and adjusting parameters of the graph neural network.
Optionally, inputting the knowledge graph into a pre-trained graph neural network to perform semantic similarity calculation, and determining semantic similarity between the target topic node and other topic nodes in the knowledge graph, including:
inputting the knowledge graph into a pre-trained graph neural network to obtain the codes of all topic nodes in the knowledge graph;
and taking the distance between the code of the target topic node and the codes of other topic nodes in the knowledge graph as the semantic similarity between the target topic node and other topic nodes in the knowledge graph.
Optionally, based on the semantic similarity and the time weight, selecting a topic node from the knowledge graph, and recommending topics to the user, including:
and performing weighted calculation on the semantic similarity and the time weight, selecting a topic node with the highest semantic similarity value from the knowledge graph, and recommending topics to the user.
According to a second aspect of one or more embodiments of the present specification, a knowledge-graph-based topic recommendation apparatus is provided, which is applied to a human-computer question-and-answer system that maintains a knowledge graph for topic recommendation, wherein the knowledge graph includes topic nodes having several relationships; the man-machine question-answering system also maintains historical question-answering information of the user, and the device comprises:
the topic acquisition unit is used for acquiring the topic input by the user;
the node determining unit is used for determining a target topic node corresponding to the topic input by the user in the knowledge graph;
the similarity calculation unit is used for calculating semantic similarity between the target topic node and the topic node in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node;
and the topic recommendation unit is used for selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user and recommending topics to the user.
According to a third aspect of one or more embodiments of the present specification, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of the first aspect by executing the executable instructions.
According to a fourth aspect of one or more embodiments of the present description, a computer-readable storage medium is presented, having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to the first aspect.
The beneficial effect of this application:
the method comprises the steps of pre-constructing a knowledge graph for topic recommendation, determining a target topic node of a topic input by a user in the knowledge graph, and calculating semantic similarity between the target topic node and the topic node in the knowledge graph; and selecting topic nodes from the real knowledge graph spectrum by combining historical question and answer information input by the user, and recommending topics to the user. The knowledge graph is used for topic recommendation, the continuity and the accuracy of the topic recommendation can be improved, and repeated topics can be prevented from being recommended by combining historical question and answer information input by a user.
Drawings
FIG. 1 is a diagram of a real-time information knowledge-graph provided by an exemplary embodiment.
FIG. 2 is a flowchart of a knowledge-graph based topic recommendation method provided by an exemplary embodiment.
FIG. 3 is a schematic diagram of a graph neural network model training provided by an exemplary embodiment.
FIG. 4 is a diagram of a user information knowledge-graph provided by an exemplary embodiment.
Fig. 5 is a schematic block diagram of an electronic device according to an exemplary embodiment.
FIG. 6 is a block diagram of a knowledge-graph based topic recommendation device provided in an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims that follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The man-machine question and answer system can be applied to various fields, such as customer service of an e-commerce platform, central control display carried by an intelligent automobile, an artificial intelligent voice interaction engine carried by an intelligent sound box and the like, and can be used as a man-machine question and answer system. The existing man-machine question-answering system generally puts forward a question by a user, identifies the question input by the user by the man-machine question-answering system, and selects an answer of the question from a preset question-answering library; or the human-computer question-answering system identifies related entities in the questions input by the user, then finds other entities related to the entities from a preset knowledge graph, and organizes the entities into answers of the questions based on a natural language processing technology.
In the prior art, end-to-end neural network training is usually performed based on question-answer pairs, answers to questions are generated by using a large number of question-answer pairs, and multiple rounds of topics are recommended by using generalization of the neural network. In this way, because the neural network has generalization uncontrollable property, the contents of the man-machine conversation are relatively dispersed, and the context is not consistent during the conversation.
The knowledge graph can well mine semantic relevance among topic nodes, so that the topic recommendation method based on the knowledge graph can well generate answers of questions from the semantic perspective and further recommend topics, but the topic recommendation method based on the knowledge graph only considers the topic nodes in the knowledge graph and does not combine historical question and answer information of users, so that the same topics can be mentioned for many times due to high semantic similarity.
In view of this, the present specification provides a topic recommendation method based on a knowledge graph, which is a technical scheme of performing topic recommendation by calculating semantic similarity of topic nodes in the knowledge graph and combining historical input content of a user.
When the method is implemented, the topics input by the user can be obtained; determining a target topic node corresponding to the topic input by the user in the knowledge graph; calculating semantic similarity between the target topic and topic nodes in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node and the topic in the knowledge graph; and selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user.
The topic recommendation method based on the knowledge graph in the present specification is described in detail below with reference to the accompanying drawings.
In this specification, the human-machine question-answering system may maintain a pre-constructed knowledge graph for topic recommendation, where the knowledge graph may include a plurality of topic nodes, and a relationship exists between each topic node. The man-machine question-answering system can recommend topics based on topics corresponding to topic nodes in the knowledge graph. In this specification, the specific manner of constructing the knowledge graph is not specifically limited, for example, a structured data source may be acquired through various channels, and a knowledge graph for topic recommendation is constructed; or data can be collected from encyclopedic websites or data centers by technical means, a knowledge base is constructed, and then a knowledge graph for topic recommendation is further constructed.
In one embodiment, the knowledge graph may include a real-time information knowledge graph constructed based on real-time information; the real-time information comprises the current geographical position information of the user. Specifically, the real-time information may include information about a supermarket, a food, and an entertainment item near the current geographic location information of the user, hot news of a city in which the current geographic location information of the user is located, weather conditions of the city in which the current geographic location information of the user is located, and the like. The man-machine question-answering system can automatically acquire the geographical position information of the user through a self-contained GPS positioning module or a GPS positioning module added by other systems, acquire real-time information through a map or the Internet according to the geographical position information of the user, and construct a real-time information knowledge map based on the real-time information.
FIG. 1 is a schematic diagram of a real-time information knowledge-graph provided by an exemplary embodiment. As shown in fig. 1, the knowledge graph may include information obtained from the current geographic location of the user, such as food nodes and entertainment nodes in the graph, where the food nodes may further include classification nodes of the chuan cuisine, the xiangcuisine and other food, and further be specific to a certain shop, such as the chuan cuisine a node and the chuan cuisine B node.
The man-machine question-answering system can recommend topics aiming at the topics input by the user based on the real-time information knowledge graph shown in fig. 1.
FIG. 2 is a flowchart of a knowledge-graph based topic recommendation method provided by an exemplary embodiment. As shown in fig. 2, the method may include the steps of:
In this specification, the human-machine question-answering system may acquire topics input by a user based on contents input by the user; wherein the user may enter content in text form, content in audio form, and the like. Aiming at the content in the text form, the man-machine question-answering system can extract topics input by a user from the content in the text form based on the technologies such as semantic analysis and the like; aiming at the content in the form of audio, the man-machine question-answering system can firstly convert the audio into a text and then extract the topics input by the user from the content in the form of the text. The man-machine question-answering system can also analyze the semantics represented by the user input content and determine the topics input by the user through semantic association and the like.
For example, when the user inputs "what food is near", the above-mentioned human-machine question-and-answer system may determine the topic input by the user as "food" based on a semantic analysis or other techniques. As another example, when the user inputs "what is eaten today at noon? The man-machine question-answering system can determine the topic input by the user as 'food' based on the semantic meaning of 'eating' input by the user.
after the topic input by the user is obtained, a target topic node corresponding to the topic in the knowledge graph can be determined. All topic nodes in the knowledge graph can be traversed, and the topic nodes which are the same as the topics input by the user are matched. In one case, topic nodes that are exactly the same as the topic input by the user may not be matched, and thus, topic nodes that are semantically similar to the topic input by the user may be matched based on semantic analysis techniques in natural language processing.
For example, when the user inputs "what food is near," the above-mentioned human-machine question-and-answer system may determine the topic input by the user as "food" based on a semantic analysis or other techniques, and thus may determine that the target topic node is "food" as shown in fig. 1.
after the target topic is determined, semantic similarity between the target topic node and other topic nodes in the knowledge graph can be calculated. The specific way of calculating the semantic similarity between the target topic node and other nodes in the knowledge graph is not specifically limited in the specification. For example, the similarity between the text vectors can be calculated by converting the text corresponding to the target topic node and the text corresponding to other nodes in the instruction map into text vectors respectively, so as to serve as the semantic similarity between the target topic node and the topic node in the knowledge map. For another example, the knowledge graph may be input into a graph neural network model trained in advance, and semantic similarity between the target topic node and the topic node in the knowledge graph may be calculated by the graph neural network model.
The semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node; the larger the value of the semantic similarity is, the higher the association degree between the topic node in the knowledge graph and the target topic node is.
In an embodiment, the present application further provides a training method of a graph neural network, and fig. 3 is a flowchart of training of a graph neural network provided by an exemplary embodiment. As shown in fig. 3, the method may include the steps of:
in this specification, a knowledge graph library may be constructed in advance, where knowledge graphs in the knowledge graph library may be knowledge graphs created by real-time information of each user included in a human-computer question-and-answer system, may also be knowledge graphs created artificially for model training, and may also obtain related knowledge graphs from the internet, which is not limited in this specification.
After the knowledge map library is constructed, a plurality of indication maps can be selected from the knowledge map library to serve as training samples of the neural network. The selection method is not specifically limited in this specification, and for example, several knowledge maps may be randomly selected from a knowledge map library, or a knowledge map serving as a training sample may be artificially screened from the knowledge map library.
After the training samples are selected, the graph nodes in the knowledge-graph and the relationships between the graph nodes can be extracted from each training sample respectively. The graph nodes may be data corresponding to one entity in the knowledge graph, and the relationship between the graph nodes may be data corresponding to the relationship between two entities having a relationship in the knowledge graph.
for a knowledge graph training sample, graph nodes in the knowledge graph can be respectively encoded, and relationships between the graph nodes can be respectively encoded. The encoding method is not limited in this specification. For example, a weighted combination of a set of basis vectors may be used to represent data for graph nodes, as well as data for relationships between graph nodes.
And 306, combining the graph node codes and the relation codes, inputting the graph node codes and the relation codes into the graph neural network, and adjusting parameters of the graph neural network.
In this specification, the core formula of the neural network model of the graph to be trained is:
wherein u represents a graph node, r represents a relationship,represents an encoding of the node relationships of the graph,which represents the encoding of the nodes of the graph,represent andthe coding of the graph nodes having a relationship,the mapping weights, i.e. the parameters obtained by the neural network training, are obtained.The combination mode of the relationship coding between the graph nodes and the coding of the graph nodes is shown, wherein the combination mode of the relationship coding between the graph nodes and the coding of the graph nodes is as follows:
the different combination modes of the codes correspond to different training modes of the criterion function, and the training modes can be selected by a user in a self-defined way.
After the training samples are input into the neural network of the graph, the code of the relationship needs to be updated every iteration, wherein the updating formula is as follows:
after multiple times of iterative training, the mapping weight W is adjusted, and the training of the graph neural network can be completed.
In one embodiment, a knowledge graph constructed by a human-computer conversation system may be input to the pre-trained neural network, codes of each topic node in the knowledge graph may be obtained, and after the codes are obtained, a distance between the code of the target topic node and codes of other topic nodes in the knowledge graph may be used as a semantic similarity between the target topic node and other topic nodes in the knowledge graph.
And 208, selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user.
After the semantic similarity between the target topic adding point and other topic nodes is calculated, the topic nodes with higher association degree with the target topic nodes can be selected from the knowledge graph based on the semantic similarity value.
Meanwhile, the man-machine question-answering system can also record historical question-answering information of the user, wherein the historical question-answering information can comprise topics which have been recommended to the user by the man-machine question-answering system within a preset time period. When topic recommendation is carried out, a man-machine question-answering system can match historical question-answering information aiming at topic nodes with high semantic similarity, whether the topic nodes are recommended or not is determined, and if the topic nodes are recommended in a preset time period, the topic nodes with high semantic similarity can be selected again.
For example, when the user inputs "I want to eat Chuan dishes". And then, the man-machine question-answering system determines that the target topic node is a Chuan vegetable restaurant. Based on semantic similarity calculation, the semantic similarity between the "Chuanchuan restaurant A" node and the "Chuanchuan restaurant B" node and the target topic node can be determined to be high. Because the man-machine question-answering system stores the historical question-answering information of the user and recommends the Tokyo A to the user in one month, the topic node can be reselected and the Tokyo B is recommended to the user.
In one embodiment, the man-machine question-answering system maintains a user information knowledge graph constructed based on user information and historical question-answering information of a user, wherein the user information knowledge graph comprises a plurality of topic nodes recommended to the user; wherein the topic node has a time feature value indicating the time when the topic node was last recommended by the human question and answer system;
for example, FIG. 4 is a schematic diagram of an exemplary provided user information knowledge-graph. As shown in fig. 4, topic nodes that have been recommended to the user, such as "chinese cabbage a" and "xiang cabbage B" shown in fig. 4, may be included in the knowledge-graph, and a time feature value is recorded for each topic node, which indicates the time when the human question-answering system last recommended the topic node.
It should be noted that, after a preset time, for the topic nodes already recommended in the user information knowledge graph, when the human-machine question-answering system does not recommend the topic nodes again, the human-machine question-answering system may delete the topic nodes already recommended in the user information knowledge graph.
When topic recommendation is carried out, the time characteristic value of a topic node in a knowledge graph used for topic recommendation can be determined based on a user information knowledge graph. It should be noted that, since there are topic nodes that have not been recommended in the knowledge graph for topic recommendation, the time feature values of these topic nodes may be set to 0 or null.
Because there are possibly more topic nodes in the knowledge graph for topic recommendation, semantic similarity between a target topic node and the topic nodes in the knowledge graph can be calculated, a part of topic nodes with higher similarity can be selected, and time characteristic values of the part of topic nodes are determined according to the part of topic nodes and based on the user information knowledge graph.
After determining the temporal feature values, temporal weights may be calculated based on the temporal feature values. The time weight is used for indicating the recommended importance degree of topic nodes in the knowledge graph in a preset time period; wherein, the higher the time weight, the lower the probability that the corresponding topic node is recommended. The formula for calculating the time weight is not limited in this specification, and for example, the user may use a value obtained by subtracting the time feature value from the current time as the time weight.
In this specification, there is also provided a calculation formula of time weight 1-e ^ (-t), where t = (current time-time characteristic value)/360. When the (current time-time characteristic value) > 360 (the current time-time characteristic value) is recorded as 360, based on the above time weight, the shorter the time that the topic node was last recommended in the year is, the smaller the corresponding weight is.
After the semantic similarity and the time weight are calculated, topic nodes can be selected from the knowledge graph by combining the semantic similarity and the time weight, and topic recommendation is carried out on the user. The topic nodes with higher semantic similarity can be selected from the knowledge graph, the semantic similarity and time weight are further subjected to weighted calculation, and the topic nodes with the highest semantic similarity value after weighted calculation are recommended to the user.
Fig. 5 is a schematic block diagram of an electronic device according to an exemplary embodiment. Referring to fig. 5, at the hardware level, the apparatus includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, although other hardware required for tasks may be included. One or more embodiments of the present description may be implemented in software, such as by processor 502 reading a corresponding computer program from non-volatile storage 510 into memory 508 and then running. Of course, besides the software implementation, the one or more embodiments of the present disclosure do not exclude other implementations, such as logic devices or combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 6, fig. 6 is a block diagram of a knowledge-graph-based topic recommendation apparatus according to an exemplary embodiment, the apparatus including:
a topic obtaining unit 602, configured to obtain a topic input by the user;
a node determining unit 604, configured to determine a target topic node corresponding to the topic input by the user in the knowledge graph;
a similarity calculation unit 606, configured to calculate semantic similarities between the target topic node and topic nodes in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node;
and the topic recommendation unit 606 is configured to select a topic node from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommend a topic to the user.
Optionally, the knowledge graph comprises a real-time information knowledge graph constructed based on real-time information; the real-time information comprises information obtained in real time based on the geographic position of the user.
Optionally, the human-computer question-and-answer system maintains a user information knowledge graph constructed based on user information and historical question-and-answer information of the user, wherein the user information knowledge graph comprises a plurality of topic nodes recommended to the user; wherein the topic node has a time feature value indicating the time when the topic node was last recommended by the human question and answer system;
the node determining unit 604 is further configured to determine a time feature value of a topic node in the knowledge graph based on the user information knowledge graph;
calculating a time weight of a topic node in the knowledge-graph based on the time characteristic value; the time weight is used for indicating the recommended importance degree of topic nodes in the knowledge graph in a preset time period;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the time weight, and recommending topics to the user.
Optionally, the similarity calculation unit 606 is further configured to input the knowledge graph into a pre-trained graph neural network to perform semantic similarity calculation, and determine semantic similarities between the target topic node and other topic nodes in the knowledge graph.
Optionally, the apparatus further comprises:
the model training unit is used for repeatedly executing the following training processes to perform supervised training on the graph neural network:
selecting a plurality of knowledge graphs from a preset knowledge graph library as training samples, and extracting graph nodes and relations among the graph nodes from the training samples;
respectively coding the graph nodes to obtain graph node codes, and respectively coding the relations among the graph nodes to obtain relation codes;
and combining the graph node codes and the relation codes, inputting the graph node codes and the relation codes into the graph neural network, and adjusting parameters of the graph neural network.
Optionally, the similarity calculating unit 606 is further configured to input the knowledge graph into a graph neural network trained in advance, so as to obtain codes of each topic node in the knowledge graph;
and taking the distance between the code of the target topic node and the codes of other topic nodes in the knowledge graph as the semantic similarity between the target topic node and other topic nodes in the knowledge graph.
Optionally, the similarity calculation unit 606 is further configured to perform weighted calculation on the semantic similarity and the time weight, select a topic node with a highest semantic similarity value from the knowledge graph, and recommend a topic to the user.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.
Claims (12)
1. A topic recommendation method based on a knowledge graph is applied to a man-machine question-answering system, the man-machine question-answering system maintains the knowledge graph for topic recommendation, wherein the knowledge graph comprises topic nodes with a plurality of relations; the man-machine question-answering system also maintains historical question-answering information of the user, and the method comprises the following steps:
obtaining topics input by the user;
determining a target topic node corresponding to the topic input by the user in the knowledge graph;
calculating semantic similarity between the target topic node and topic nodes in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user.
2. The method of claim 1, the knowledge-graph comprising a real-time information knowledge-graph constructed based on real-time information; the real-time information comprises information obtained in real time based on the geographic position of the user.
3. The method of claim 1, wherein the human-machine question-answering system maintains a user information knowledge graph constructed based on user information and historical question-answering information of the user, the user information knowledge graph comprising a plurality of topic nodes that have been recommended to the user; wherein the topic node has a time feature value indicating the time when the topic node was last recommended by the human question and answer system;
selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user, and recommending topics to the user, wherein the topic nodes comprise:
determining a time characteristic value of a topic node in the knowledge graph based on the user information knowledge graph;
calculating a time weight of a topic node in the knowledge graph based on the time characteristic value; the time weight is used for indicating the recommended importance degree of topic nodes in the knowledge graph within a preset time period;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the time weight, and recommending topics to the user.
4. The method of claim 1, calculating semantic similarities between the target topic node and topic nodes in the knowledge-graph, comprising:
and inputting the knowledge graph into a pre-trained graph neural network for semantic similarity calculation, and determining semantic similarity between the target topic node and other topic nodes in the knowledge graph.
5. The method of claim 4, further comprising:
the following training process is repeatedly executed to carry out supervised training on the graph neural network:
selecting a plurality of knowledge graphs from a preset knowledge graph library as training samples, and extracting graph nodes and relations among the graph nodes from the training samples;
respectively coding the graph nodes to obtain graph node codes, and respectively coding the relations among the graph nodes to obtain relation codes;
and combining the graph node codes and the relation codes, inputting the graph node codes and the relation codes into the graph neural network, and adjusting parameters of the graph neural network.
6. The method of claim 5, inputting the knowledge graph into a pre-trained graph neural network for semantic similarity calculation, determining semantic similarity between the target topic node and other topic nodes in the knowledge graph, comprising:
inputting the knowledge graph into a pre-trained graph neural network to obtain the codes of all topic nodes in the knowledge graph;
and taking the distance between the code of the target topic node and the codes of other topic nodes in the knowledge graph as the semantic similarity between the target topic node and other topic nodes in the knowledge graph.
7. The method of claim 3, selecting topic nodes from the knowledge graph based on the semantic similarity and the temporal weight, and making topic recommendations to the user, comprising:
and performing weighted calculation on the semantic similarity and the time weight, selecting a topic node with the highest semantic similarity value from the knowledge graph, and recommending topics to the user.
8. A topic recommendation device based on a knowledge graph is applied to a man-machine question-answering system, the man-machine question-answering system maintains the knowledge graph for topic recommendation, wherein the knowledge graph comprises topic nodes with a plurality of relations; the man-machine question-answering system also maintains historical question-answering information of the user, and the device comprises:
the topic acquisition unit is used for acquiring the topic input by the user;
the node determining unit is used for determining a target topic node corresponding to the topic input by the user in the knowledge graph;
the similarity calculation unit is used for calculating semantic similarity between the target topic node and the topic node in the knowledge graph; the semantic similarity is used for indicating the association degree between the topic node in the knowledge graph and the target topic node;
and the topic recommendation unit is used for selecting topic nodes from the knowledge graph based on the semantic similarity and the historical question and answer information of the user and recommending topics to the user.
9. The apparatus of claim 8, wherein the human-machine question answering system maintains a user information knowledge graph constructed based on user information and historical question answering information of the user, the user information knowledge graph comprising a plurality of topic nodes that have been recommended to the user; wherein the topic node has a time feature value indicating the time when the topic node was last recommended by the human question and answer system;
the node determination unit is further used for determining a time characteristic value of a topic node in the knowledge graph based on the user information knowledge graph;
calculating a time weight of a topic node in the knowledge-graph based on the time characteristic value; the time weight is used for indicating the recommended importance degree of topic nodes in the knowledge graph in a preset time period;
and selecting topic nodes from the knowledge graph based on the semantic similarity and the time weight, and recommending topics to the user.
10. The apparatus of claim 8, the apparatus further comprising:
the model training unit is used for repeatedly executing the following training processes to carry out supervised training on the graph neural network:
selecting a plurality of knowledge graphs from a preset knowledge graph library as training samples, and extracting graph nodes and relations among the graph nodes from the training samples;
respectively coding the graph nodes to obtain graph node codes, and respectively coding the relations among the graph nodes to obtain relation codes;
and combining the graph node codes and the relation codes, inputting the graph node codes and the relation codes into the graph neural network, and adjusting parameters of the graph neural network.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-7 by executing the executable instructions.
12. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211042686.1A CN115391489A (en) | 2022-08-29 | 2022-08-29 | Topic recommendation method based on knowledge graph |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211042686.1A CN115391489A (en) | 2022-08-29 | 2022-08-29 | Topic recommendation method based on knowledge graph |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115391489A true CN115391489A (en) | 2022-11-25 |
Family
ID=84123501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211042686.1A Pending CN115391489A (en) | 2022-08-29 | 2022-08-29 | Topic recommendation method based on knowledge graph |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115391489A (en) |
-
2022
- 2022-08-29 CN CN202211042686.1A patent/CN115391489A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9348898B2 (en) | Recommendation system with dual collaborative filter usage matrix | |
CN111061946B (en) | Method, device, electronic equipment and storage medium for recommending scenerized content | |
CN116821308B (en) | Generation method, training method and device of model and storage medium | |
CN110532479A (en) | A kind of information recommendation method, device and equipment | |
US20140229476A1 (en) | System for Information Discovery & Organization | |
CN112182230B (en) | Text data classification method and device based on deep learning | |
JP2015511039A (en) | Disclosure of product information | |
CN110020144B (en) | Recommendation model building method and equipment, storage medium and server thereof | |
CN112528010B (en) | Knowledge recommendation method and device, computer equipment and readable storage medium | |
CN111199157B (en) | Text data processing method and device | |
CN110795613B (en) | Commodity searching method, device and system and electronic equipment | |
KR20150032147A (en) | Mobile device based on inference of user intent and content recommending method using the same | |
CN116089567A (en) | Recommendation method, device, equipment and storage medium for search keywords | |
CN112733024A (en) | Information recommendation method and device | |
CN110110218A (en) | A kind of Identity Association method and terminal | |
US9760933B1 (en) | Interactive shopping advisor for refinancing product queries | |
CN117290481A (en) | Question and answer method and device based on deep learning, storage medium and electronic equipment | |
CN115422346A (en) | Knowledge graph-based multi-turn topic recommendation method | |
CN115391489A (en) | Topic recommendation method based on knowledge graph | |
CN115186750A (en) | Model training method, device, equipment and storage medium | |
CN114117028A (en) | Information recommendation method and device, storage medium and electronic equipment | |
CN113987360B (en) | Object recommendation method and device, electronic equipment and storage medium | |
CN112214664A (en) | Knowledge base construction method and device, electronic equipment and storage medium | |
CN114139041B (en) | Category relevance prediction network training and category relevance prediction method and device | |
CN116610869B (en) | Recommended content management method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |