Question-answering knowledge retrieval method, device and equipment based on graph embedding

By using a question-and-answer knowledge retrieval method based on graph embedding in the question-and-answer system, the element entities of the question-and-answer sentence are extracted and semantic vectors are constructed, and the search is combined with the graph embedding and similarity matching model, the low accuracy of information matching in the existing technology is solved. Questions, achieving more efficient matching of Q&A information.

CN113947084BActive Publication Date: 2025-02-14SHENGJING INTELLIGENT TECH (JIAXING) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111121605.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-02-14
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

When the existing question and answer systems handle user diversified expressions, the information matching accuracy is low, making it difficult to cover various expression forms of users, and there are difficulties in processing synonyms.

Method used

Using a question-answer knowledge retrieval method based on graph embedding, the element entities of the problem query statement are extracted through the named entity recognition model, the semantic vector is constructed, and the target problem knowledge sub-graph collection is recalled in the question-answer knowledge graph, and combined with the graph embedding and similarity matching model Search.

Benefits of technology

It effectively improves the accuracy of matching questions and answers, solves the problem of inaccurate matching caused by synonyms, and combines the graph and text to search knowledge, enhancing the system's semantic understanding ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113947084B_ABST
    Figure CN113947084B_ABST
Patent Text Reader

Abstract

The present invention provides a question-answering knowledge retrieval method, device and equipment based on graph embedding. The method receives a question query statement; extracts element entities of the question query statement based on a named entity recognition model, and constructs a first semantic vector of the element entity and a second semantic vector of the question query statement; constructs a question query subgraph according to the element entity, and embeds the corresponding first semantic vector into the question query subgraph; recalls a target question knowledge point subgraph set in a question-answering knowledge graph according to the element entity and the second semantic vector; inputs the question query subgraph and the target question knowledge point subgraph set into a graph embedding and similarity matching model, and outputs a retrieval answer corresponding to the question query statement. The inaccurate matching problem caused by synonyms can be effectively solved by adding entity semantic vectors. At the same time, the graph embedding and similarity matching model are used to combine graphs and texts for knowledge retrieval, effectively improving the accuracy of question-answering information matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of question-answering systems, and in particular to a question-answering knowledge retrieval method, device and equipment based on graph embedding. Background Art

[0002] In question-answering systems, in order to achieve smarter and more professional questions and answers, it is necessary to integrate professional knowledge, which is generally achieved by building a question-answering system based on a knowledge graph or knowledge base (KBQA). Currently, most question-answering systems based on knowledge graphs mainly identify entities and relationships in user questions through semantic analysis, and then use dependency syntax analysis or rule template methods to build corresponding query statements to query in the knowledge graph or knowledge base to obtain a set of candidate questions and answers, and then sort them according to certain rules to return the user's answer. However, this method has certain defects when dealing with diverse user expressions, and it is difficult for query statements or rule templates to cover various user expressions. Most solutions are optimized by replacing synonym dictionaries, but polysemy and dictionary maintenance are also very troublesome.

[0003] Therefore, how to improve the information matching accuracy of question-answering systems in professional fields has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] The present invention provides a question-and-answer knowledge retrieval method, device and equipment based on graph embedding, which are used to solve the defect of low professional field information matching accuracy in the question-and-answer system in the prior art, and effectively improve the matching accuracy of information questions and answers.

[0005] The present invention provides a question-answering knowledge retrieval method based on graph embedding, comprising:

[0006] Receive a question query statement;

[0007] Based on a named entity recognition model, extracting element entities of the question query sentence, and constructing a first semantic vector of the element entity and a second semantic vector of the question query sentence;

[0008] Constructing a question query subgraph according to the element entity, and embedding the corresponding first semantic vector into the question query subgraph;

[0009] Recalling a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector;

[0010] The question query subgraph and the target question knowledge point subgraph set are input into the graph embedding and similarity matching model, and the retrieval answer corresponding to the question query statement is output.

[0011] According to a graph embedding-based question-answer knowledge retrieval method provided by the present invention, before receiving the question query statement, the method further includes:

[0012] Collect corpus information in a professional field and build a word vector model based on the corpus information;

[0013] Traverse the entities and relationships in the question-answering knowledge graph, determine the semantic vector of each entity in the question-answering knowledge graph through the word vector model, and add the semantic vector to the corresponding node of the question-answering knowledge graph.

[0014] According to a question-answering knowledge retrieval method based on graph embedding provided by the present invention, the step of recalling a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector includes:

[0015] Based on the question-answer knowledge graph and the element entities of the question query sentence, a first knowledge point subgraph set is obtained;

[0016] Based on the question-answer knowledge graph and the second semantic vector, a second knowledge point subgraph set is obtained;

[0017] The first knowledge point subgraph set and the second knowledge point subgraph set are merged and deduplicated to obtain a target question knowledge point subgraph set.

[0018] According to a question-answer knowledge retrieval method based on graph embedding provided by the present invention, the first knowledge point subgraph set is obtained based on the question-answer knowledge graph and the element entity of the question query sentence, including:

[0019] In the question-answer knowledge graph, retrieve the element entity of the question query sentence and the element entity corresponding to the sentence that is a synonym of the question query sentence to obtain the first knowledge point entity;

[0020] An association query is performed on the first knowledge point entity to obtain a first knowledge point subgraph set.

[0021] According to a question-answer knowledge retrieval method based on graph embedding provided by the present invention, the second knowledge point subgraph set is obtained based on the question-answer knowledge graph and the second semantic vector, including:

[0022] Traversing similar entity nodes of the same type as the element entity in the question-answer knowledge graph;

[0023] Calculating the cosine similarity between the first semantic vector and the second semantic vector of the similar entity node;

[0024] The entity nodes whose cosine similarity is greater than a preset threshold are selected as second knowledge point entities, and an association query is performed on the second knowledge point entities to obtain a second knowledge point subgraph set.

[0025] According to a question-answering knowledge retrieval method based on graph embedding provided by the present invention, the step of inputting the question query subgraph and the target question knowledge point subgraph set into a graph embedding and similarity matching model, and outputting a retrieval answer corresponding to the question query statement comprises:

[0026] Traversing the similarity between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set, and sorting them according to the similarity;

[0027] According to the graph embedding and similarity matching model, obtaining a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set;

[0028] According to the ranking result and the matching similarity score, a search answer corresponding to the question query statement is output.

[0029] According to a question-answering knowledge retrieval method based on graph embedding provided by the present invention, the graph embedding and similarity matching model includes: a graph embedding matching sub-model and a text similarity sub-model;

[0030] Correspondingly, obtaining the matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set according to the graph embedding and similarity matching model includes:

[0031] Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the graph embedding matching submodel to obtain a graph similarity score;

[0032] Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the text similarity submodel to obtain a text similarity score;

[0033] The graph similarity score and the text similarity score are added to obtain a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set.

[0034] According to a question-answering knowledge retrieval method based on graph embedding provided by the present invention, the graph embedding matching sub-model is obtained after training based on question query sub-graph samples and predetermined question knowledge point sub-graph labels;

[0035] The text similarity sub-model is obtained after training based on question query text samples and predetermined question knowledge point text labels.

[0036] The present invention also provides a question-answering knowledge retrieval device based on graph embedding, comprising:

[0037] A receiving module, used for receiving a question query statement;

[0038] An extraction module, used for extracting element entities of the question query sentence based on a named entity recognition model, and constructing a first semantic vector of the element entity and a second semantic vector of the question query sentence;

[0039] A construction module, used to construct a question query subgraph according to the element entity, and embed the corresponding first semantic vector into the question query subgraph;

[0040] A recall module, used to recall a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector;

[0041] The retrieval module is used to input the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and output the retrieval answer corresponding to the question query statement. The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned question-answering knowledge retrieval methods based on graph embedding are implemented.

[0042] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described question-and-answer knowledge retrieval methods based on graph embedding.

[0043] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned question-and-answer knowledge retrieval methods based on graph embedding.

[0044] The present invention provides a question-answering knowledge retrieval method, apparatus and device based on graph embedding. The method receives a question query statement; extracts element entities of the question query statement based on a named entity recognition model, and constructs a first semantic vector of the element entity and a second semantic vector of the question query statement; constructs a question query subgraph according to the element entity, and embeds the corresponding first semantic vector into the question query subgraph; recalls a target question knowledge point subgraph set in a question-answering knowledge graph according to the element entity and the second semantic vector; inputs the question query subgraph and the target question knowledge point subgraph set into a graph embedding and similarity matching model, and outputs a retrieval answer corresponding to the question query statement. The inaccurate matching problem caused by synonyms can be effectively solved by adding entity semantic vectors. At the same time, the graph embedding and similarity matching model are used to combine graphs and texts for knowledge retrieval, effectively improving the accuracy of question-answering information matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 It is a flowchart of the question-answering knowledge retrieval method based on graph embedding provided by the present invention;

[0047] Figure 2 yes Figure 1 Schematic diagram of the structural principle of the graph embedding and similarity matching model in;

[0048] Figure 3 yes Figure 1 The collection of subgraphs of problem knowledge points in ;

[0049] Figure 4 It is a structural schematic diagram of a question-answering knowledge retrieval device based on graph embedding provided by the present invention;

[0050] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Combine the following Figures 1 to 5 The present invention describes a question-answering knowledge retrieval method, apparatus and device based on graph embedding.

[0053] Figure 1 It is a flowchart of the question-answering knowledge retrieval method based on graph embedding provided by the present invention; Figure 2 yes Figure 1 Schematic diagram of the structural principle of the graph embedding and similarity matching model in; Figure 3 yes Figure 1 A collection of subgraphs of question knowledge points in .

[0054] like Figure 1 As shown, a question-answering knowledge retrieval method based on graph embedding provided by an embodiment of the present invention is illustrated by taking equipment failure maintenance as an example, and mainly includes the following steps:

[0055] 101. Receive a question query statement.

[0056] Usually, before this process runs, semantic embedding is first performed in the question-answer knowledge graph. The specific process can be: collect corpus information in professional fields, such as the field of operating machinery maintenance technology, and build a word vector model based on the corpus information, such as word2vec or glove word vector model; traverse the entities and relationships in the question-answer knowledge graph, and determine the semantic vector of each entity in the question-answer knowledge graph through the word vector model, and add the semantic vector to the corresponding node of the question-answer knowledge graph. For the case where the above entity node contains multiple words, take the weighted average of the vector of each word as the semantic vector of the entity. In this way, the semantic vector is embedded for each element entity in the knowledge graph.

[0057] Specifically, the received problem query statement is input by the user, and the input method is not specifically limited. It can be various input methods such as text, voice, and picture, as long as the user's problem can be accurately obtained. Taking maintenance as an example, it is to receive the fault problem query statement input by the user, that is, what kind of fault has occurred and what kind of maintenance strategy is needed.

[0058] 102. Based on the named entity recognition model, extract the element entity of the question query sentence, and construct a first semantic vector of the element entity and a second semantic vector of the question query sentence.

[0059] Specifically, a named entity recognition model in this field can be trained, which is mainly used to extract element entities in question query sentences. The entity extraction model is not limited to the use of model structures such as bilstm+crf, but also includes multi-modal matching based on professional dictionaries, and then constructing the first semantic vector and the second semantic vector.

[0060] 103. Construct a question query subgraph according to the element entity, and embed the corresponding first semantic vector into the question query subgraph.

[0061] Specifically, a question query subgraph is constructed with the question query statement input by the user as the core node, and then the corresponding first semantic vector is embedded into the question query subgraph, thereby obtaining a question query subgraph carrying element entities and semantic vectors corresponding to the element entities. In the maintenance field, this means constructing a fault maintenance subgraph.

[0062] 104. Recall the target question knowledge point subgraph set in the question-answering knowledge graph based on the element entity and the second semantic vector.

[0063] Specifically, based on the element entity and the second semantic vector, a target question knowledge point subgraph set is recalled in the question and answer knowledge graph, including: obtaining a first knowledge point subgraph set based on the element entity of the question and answer knowledge graph and the question query statement; obtaining a second knowledge point subgraph set based on the question and answer knowledge graph and the second semantic vector; merging the first knowledge point subgraph set and the second knowledge point subgraph set to remove duplications, and obtaining a target question knowledge point subgraph set.

[0064] Among them, based on the element entities of the question-answering knowledge graph and the question query sentence, a first knowledge point subgraph set is obtained, specifically: in the question-answering knowledge graph, the element entities of the question query sentence and the element entities corresponding to the sentences that are synonyms of the question query sentence are retrieved to obtain the first knowledge point entity; an associated query is performed on the first knowledge point entity to obtain the first knowledge point subgraph set, that is, the knowledge point subgraph set is recalled through the element entities.

[0065] Among them, based on the question-answering knowledge graph and the second semantic vector, the second knowledge point subgraph set is obtained, specifically: traverse similar entity nodes (P) of the same type as the element entity (Q) in the question-answering knowledge graph; then calculate the cosine similarity between the first semantic vector of the similar entity node and the extracted second semantic vector, which can be obtained by the following formula: cos(Q,P) = Q•P / ||Q||•||P||; select the entity node with cosine similarity greater than the preset threshold as the second knowledge point entity, and then query the question knowledge point entity associated with the second knowledge point entity, and perform a first-degree association query through the question knowledge point entity to obtain the second knowledge point subgraph set. The use of semantic vector similarity to recall the knowledge point subgraph set is mainly to solve the problem of diversity in the expression of the same entity in language expression, and better ensure the matching accuracy.

[0066] After recalling the knowledge point subgraph set through element entities to obtain the first knowledge point subgraph set and recalling the knowledge point subgraph set through the second semantic vector to obtain the second knowledge point subgraph set, the first knowledge point subgraph set is combined with the second knowledge point subgraph to perform merging and deduplication to obtain the target problem knowledge point subgraph set, wherein the deduplication strategy is mainly completed based on the problem knowledge point entity nodes.

[0067] 105. Input the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and output the retrieval answer corresponding to the question query statement.

[0068] Specifically, the question query subgraph and the target question knowledge point subgraph set are input into the graph embedding and similarity matching model, and the retrieval answer corresponding to the question query statement is output, including: traversing the similarity between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set, and sorting them according to the similarity; obtaining the matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set according to the graph embedding and similarity matching model; outputting the retrieval answer corresponding to the question query statement according to the sorting result and the matching similarity score. The specific operating principle of the graph embedding and similarity matching model is as follows: Figure 2 As shown in the figure, taking maintenance as an example, the semantic vector is first embedded, and then the matching degree of the neural network model is calculated, and finally the similarity between the question query statement and each knowledge point subgraph in the set of recalled target question knowledge point subgraphs in the corresponding question and answer knowledge graph is obtained, so as to finally obtain the retrieval answer required by the user.

[0069] The graph embedding and similarity matching model includes: a graph embedding matching sub-model and a text similarity sub-model. According to the graph embedding and similarity matching model, the matching similarity score between the question query sub-graph and each question knowledge point sub-graph in the target question knowledge point sub-graph set is obtained, specifically: input the question query sub-graph and each question knowledge point sub-graph in the target question knowledge point sub-graph set to the graph embedding matching sub-model to obtain the graph similarity score score1; input the question query sub-graph and each question knowledge point sub-graph in the target question knowledge point sub-graph set to the text similarity sub-model to obtain the text similarity score score2; perform weighted summation of the graph similarity score and the text similarity score to obtain the matching similarity score score set between the question query sub-graph and each question knowledge point sub-graph in the target question knowledge point sub-graph set.

[0070] Among them, the graph embedding matching sub-model is obtained after training based on the question query sub-graph sample and the predetermined question knowledge point sub-graph label. Specifically, a training set and a test set are constructed, and the model training is performed until the model converges iteratively. The input of the graph embedding matching sub-model is the question query sub-graph and the question knowledge point sub-graph, and the output is the manually annotated label, 0 represents dissimilarity, and 1 represents similarity, so as to train the graph embedding matching sub-model. The graph embedding matching model structure mainly includes a graph embedding layer, a graph neural network layer, and a fully connected layer. The embedding layer is a matrix X of m*d dimensions (m is the maximum number of nodes in the sub-graph, and d is the vector dimension) concatenated by the initialized word vectors of each entity node in the current sub-graph. The dimension of the sub-graph entity node is constructed as m*m adjacency matrix Y. The entity node matrix X and the adjacency matrix Y are input into the graph neural network to obtain the feature vector T of each entity of the sub-graph, and the question query sub-graph and the question knowledge point sub-graph are processed respectively to obtain the feature vectors T1 and T2 of the entity respectively, which are input into the fully connected layer. Of course, the adjacency matrix Y can also be not constructed, and only the vectors of the entity nodes are concatenated to construct the feature matrix X.

[0071] The text similarity sub-model is obtained after training based on question query text samples and pre-determined question knowledge point text labels. Build a text similarity model, build a training set and a test set, and train the model until the model converges iteratively. The model input is the question query text and the question knowledge point text, and the output is the manually annotated label, 0 represents dissimilarity, and 1 represents similarity. The text similarity model structure is a twin network structure with BERT as the pre-trained model, including a BERT vector embedding layer and a fully connected layer. The twin network model structure of LSTM can also be used.

[0072] Finally, based on the similarity sorting results and the matching similarity score set, the problem knowledge point set greater than a certain preset threshold is selected, which is the problem knowledge point that the user wants to retrieve, that is, the answer to the corresponding problem query statement. Figure 3As shown, the fault maintenance of operating machinery is taken as an example to illustrate that different faults correspond to different entities, phenomena and parts, so as to ensure that the matching degree between the retrieval results and the question query statement can be better achieved.

[0073] The present embodiment provides a question-answering knowledge retrieval method based on graph embedding, which receives a question query statement; extracts the element entity of the question query statement based on a named entity recognition model, and constructs a first semantic vector of the element entity and a second semantic vector of the question query statement; constructs a question query subgraph according to the element entity, and embeds the corresponding first semantic vector into the question query subgraph; recalls a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector; inputs the question query subgraph and the target question knowledge point subgraph set into a graph embedding and similarity matching model, and outputs a retrieval answer corresponding to the question query statement. By adding entity semantic vectors, the problem of inaccurate matching caused by synonyms can be effectively solved. At the same time, the graph embedding and similarity matching model combines graphs and texts for knowledge retrieval, which effectively improves the accuracy of question-answering information matching. The method of adding entity semantic vectors to calculate similarity for recalling question element entity nodes can solve the problem of incomplete fault knowledge points recalled due to incomplete synonyms. When calculating the similarity between the question query subgraph and the question knowledge point subgraph, not only the similarity of the associated graph structure is calculated, but also the similarity between the original question query sentence and the question knowledge point phrase is calculated through the deep learning network, which contains more semantic information and improves the accuracy of matching. The general KBQA question-answering system mainly searches and sorts graphs through rules or templates, which cannot be well applied to language expressions. The use of semantically embedded graphs can solve the problem that templates cannot fully apply to all natural language questions to a certain extent.

[0074] Based on the same general inventive concept, the present application also protects a question-and-answer knowledge retrieval device based on graph embedding. The question-and-answer knowledge retrieval device based on graph embedding provided by the present invention is described below. The question-and-answer knowledge retrieval device based on graph embedding described below and the question-and-answer knowledge retrieval method based on graph embedding described above can be referenced to each other.

[0075] Figure 4 It is a structural schematic diagram of the question-and-answer knowledge retrieval device based on graph embedding provided by the present invention.

[0076] like Figure 4 As shown, an embodiment of the present invention provides a question-answer knowledge retrieval device based on graph embedding, comprising:

[0077] A receiving module 41 is used to receive a question query statement;

[0078] An extraction module 42, configured to extract element entities of the question query sentence based on a named entity recognition model, and construct a first semantic vector of the element entity and a second semantic vector of the question query sentence;

[0079] A construction module 43, configured to construct a question query subgraph according to the element entity, and embed the corresponding first semantic vector into the question query subgraph;

[0080] A recall module 44, configured to recall a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector;

[0081] The retrieval module 45 is used to input the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and output the retrieval answer corresponding to the question query statement.

[0082] The present embodiment provides a question-answering knowledge retrieval device based on graph embedding, which receives a question query statement; extracts the element entity of the question query statement based on a named entity recognition model, and constructs a first semantic vector of the element entity and a second semantic vector of the question query statement; constructs a question query subgraph according to the element entity, and embeds the corresponding first semantic vector into the question query subgraph; recalls a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector; inputs the question query subgraph and the target question knowledge point subgraph set into a graph embedding and similarity matching model, and outputs a retrieval answer corresponding to the question query statement. The problem of inaccurate matching caused by synonyms can be effectively solved by adding entity semantic vectors. At the same time, the graph embedding and similarity matching model combines graphs and texts for knowledge retrieval, which effectively improves the accuracy of question-answering information matching. The method of adding entity semantic vectors to calculate similarity for recalling question element entity nodes can solve the problem of incomplete fault knowledge points recalled due to incomplete synonyms. When calculating the similarity between the question query subgraph and the question knowledge point subgraph, not only the similarity of the associated graph structure is calculated, but also the similarity between the original question query sentence and the question knowledge point phrase is calculated through the deep learning network, which contains more semantic information and improves the accuracy of matching. The general KBQA question-answering system mainly searches and sorts graphs through rules or templates, which cannot be well applied to language expressions. The use of semantically embedded graphs can solve the problem that templates cannot fully apply to all natural language questions to a certain extent.

[0083] Furthermore, this embodiment also includes a semantic embedding module, which is used to:

[0084] Collect corpus information in a professional field and build a word vector model based on the corpus information;

[0085] Traverse the entities and relationships in the question-answering knowledge graph, determine the semantic vector of each entity in the question-answering knowledge graph through the word vector model, and add the semantic vector to the corresponding node of the question-answering knowledge graph.

[0086] Furthermore, the recall module 44 in this embodiment is specifically used for:

[0087] Based on the question-answer knowledge graph and the element entities of the question query sentence, a first knowledge point subgraph set is obtained;

[0088] Based on the question-answer knowledge graph and the second semantic vector, a second knowledge point subgraph set is obtained;

[0089] The first knowledge point subgraph set and the second knowledge point subgraph set are merged and deduplicated to obtain a target question knowledge point subgraph set.

[0090] Furthermore, the recall module 44 in this embodiment is also specifically used for:

[0091] In the question-answer knowledge graph, retrieve the element entity of the question query sentence and the element entity corresponding to the sentence that is a synonym of the question query sentence to obtain the first knowledge point entity;

[0092] An association query is performed on the first knowledge point entity to obtain a first knowledge point subgraph set.

[0093] Furthermore, the recall module 44 in this embodiment is also specifically used for:

[0094] Traversing similar entity nodes of the same type as the element entity in the question-answer knowledge graph;

[0095] Calculating the cosine similarity between the first semantic vector and the second semantic vector of the similar entity node;

[0096] The entity nodes whose cosine similarity is greater than a preset threshold are selected as second knowledge point entities, and an association query is performed on the second knowledge point entities to obtain a second knowledge point subgraph set.

[0097] Furthermore, the search module 45 in this embodiment is specifically used for:

[0098] Traversing the similarity between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set, and sorting them according to the similarity;

[0099] According to the graph embedding and similarity matching model, obtaining a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set;

[0100] According to the ranking result and the matching similarity score, a search answer corresponding to the question query statement is output.

[0101] Furthermore, the graph embedding and similarity matching model in this embodiment includes: a graph embedding matching sub-model and a text similarity sub-model;

[0102] Correspondingly, the search module 45 in this embodiment is specifically used for:

[0103] Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the graph embedding matching submodel to obtain a graph similarity score;

[0104] Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the text similarity submodel to obtain a text similarity score;

[0105] The graph similarity score and the text similarity score are added to obtain a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set.

[0106] Furthermore, the graph embedding matching sub-model in this embodiment is obtained after training based on the question query sub-graph samples and the predetermined question knowledge point sub-graph labels;

[0107] The text similarity sub-model is obtained after training based on question query text samples and predetermined question knowledge point text labels.

[0108] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention.

[0109] like Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the question-answering knowledge retrieval method based on graph embedding, the method comprising: receiving a question query statement; extracting the element entity of the question query statement based on a named entity recognition model, and constructing a first semantic vector of the element entity and a second semantic vector of the question query statement; constructing a question query subgraph according to the element entity, and embedding the corresponding first semantic vector into the question query subgraph; recalling a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector; inputting the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and outputting the retrieval answer corresponding to the question query statement.

[0110] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0111] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the question-answering knowledge retrieval method based on graph embedding provided by the above-mentioned methods, and the method includes: receiving a question query statement; based on a named entity recognition model, extracting element entities of the question query statement, and constructing a first semantic vector of the element entity and a second semantic vector of the question query statement; constructing a question query subgraph according to the element entity, and embedding the corresponding first semantic vector into the question query subgraph; based on the element entity and the second semantic vector, recalling a target question knowledge point subgraph set in the question-answering knowledge graph; inputting the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and outputting the retrieval answer corresponding to the question query statement.

[0112] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned graph embedding-based question-answering knowledge retrieval method, the method comprising: receiving a question query statement; extracting element entities of the question query statement based on a named entity recognition model, and constructing a first semantic vector of the element entity and a second semantic vector of the question query statement; constructing a question query subgraph based on the element entity, and embedding the corresponding first semantic vector into the question query subgraph; recalling a target question knowledge point subgraph set in the question-answering knowledge graph based on the element entity and the second semantic vector; inputting the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and outputting a retrieval answer corresponding to the question query statement.

[0113] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A question-answering knowledge retrieval method based on graph embedding, characterized in that: include: Receive a question query statement; Based on a named entity recognition model, extracting element entities of the question query sentence, and constructing a first semantic vector of the element entity and a second semantic vector of the question query sentence; Constructing a question query subgraph according to the element entity, and embedding the corresponding first semantic vector into the question query subgraph; Recalling a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector; The question query subgraph and the target question knowledge point subgraph set are input into the graph embedding and similarity matching model, and the retrieval answer corresponding to the question query statement is output.

2. The question-answering knowledge retrieval method based on graph embedding according to claim 1, characterized in that: Before receiving the question query statement, the method further includes: Collect corpus information in a professional field and build a word vector model based on the corpus information; Traverse the entities and relationships in the question-answering knowledge graph, determine the semantic vector of each entity in the question-answering knowledge graph through the word vector model, and add the semantic vector to the corresponding node of the question-answering knowledge graph.

3. The question-answering knowledge retrieval method based on graph embedding according to claim 1, characterized in that: The step of recalling a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector includes: Based on the question-answer knowledge graph and the element entities of the question query sentence, a first knowledge point subgraph set is obtained; Based on the question-answer knowledge graph and the second semantic vector, a second knowledge point subgraph set is obtained; The first knowledge point subgraph set and the second knowledge point subgraph set are merged and deduplicated to obtain a target question knowledge point subgraph set.

4. The question-answering knowledge retrieval method based on graph embedding according to claim 3, characterized in that: The first knowledge point subgraph set is obtained based on the question-answer knowledge graph and the element entity of the question query sentence, including: In the question-answer knowledge graph, retrieve the element entity of the question query sentence and the element entity corresponding to the sentence that is a synonym of the question query sentence to obtain the first knowledge point entity; An association query is performed on the first knowledge point entity to obtain a first knowledge point subgraph set.

5. The question-answering knowledge retrieval method based on graph embedding according to claim 3, characterized in that: The second knowledge point subgraph set is obtained based on the question-answer knowledge graph and the second semantic vector, including: Traversing similar entity nodes of the same type as the element entity in the question-answer knowledge graph; Calculating the cosine similarity between the first semantic vector and the second semantic vector of the similar entity node; The entity nodes whose cosine similarity is greater than a preset threshold are selected as second knowledge point entities, and an association query is performed on the second knowledge point entities to obtain a second knowledge point subgraph set.

6. The question-answering knowledge retrieval method based on graph embedding according to claim 1, characterized in that: The step of inputting the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model and outputting the retrieval answer corresponding to the question query statement includes: Traversing the similarity between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set, and sorting them according to the similarity; According to the graph embedding and similarity matching model, obtaining a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set; According to the ranking result and the matching similarity score, a search answer corresponding to the question query statement is output.

7. The method for question-answering knowledge retrieval based on graph embedding according to claim 6, characterized in that: The graph embedding and similarity matching model includes: a graph embedding matching sub-model and a text similarity sub-model; Correspondingly, obtaining the matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set according to the graph embedding and similarity matching model includes: Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the graph embedding matching submodel to obtain a graph similarity score; Inputting the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set into the text similarity submodel to obtain a text similarity score; The graph similarity score and the text similarity score are added to obtain a matching similarity score between the question query subgraph and each question knowledge point subgraph in the target question knowledge point subgraph set.

8. The graph embedding-based question-answering knowledge retrieval method according to claim 7, characterized in that: The graph embedding matching sub-model is obtained after training based on the question query sub-graph samples and the predetermined question knowledge point sub-graph labels; The text similarity sub-model is obtained after training based on question query text samples and predetermined question knowledge point text labels.

9. A question-answering knowledge retrieval device based on graph embedding, characterized in that: include: A receiving module, used for receiving a question query statement; An extraction module, used for extracting element entities of the question query sentence based on a named entity recognition model, and constructing a first semantic vector of the element entity and a second semantic vector of the question query sentence; A construction module, used to construct a question query subgraph according to the element entity, and embed the corresponding first semantic vector into the question query subgraph; A recall module, used to recall a target question knowledge point subgraph set in the question-answering knowledge graph according to the element entity and the second semantic vector; The retrieval module is used to input the question query subgraph and the target question knowledge point subgraph set into the graph embedding and similarity matching model, and output the retrieval answer corresponding to the question query statement.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the question-and-answer knowledge retrieval method based on graph embedding are implemented as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • System and method for generating natural language to SPARQL statement based on GCN and pointer network

    CN112632263A