Knowledge graph question answering system, method and device

Through natural language technology and syntactic dependency analysis, combined with knowledge graph data to analyze user questions, the problems of limited question types and design limitations in the knowledge graph question and answer system are solved, achieving more flexible and accurate question and answer effects.

CN113157875BActive Publication Date: 2024-11-26BEIJING ZHITONG YUNLIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110270515.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-12
Publication Date
2024-11-26
Estimated Expiration
2041-03-12

AI Technical Summary

Technical Problem

There are limited types of questions that can be answered in the existing knowledge graph question and answer system, which are limited by knowledge graph design, and have failed to make full use of the reasoning ability of knowledge graphs.

Method used

Natural language technology is used to perform word-level and sentence-level semantic analysis, combine knowledge graph data, and parse objects and query paths corresponding to nodes in the knowledge graph from user questions, and output word lists and node objects through dictionary and syntactic dependency analysis. , query the instance graph to obtain the final result.

Benefits of technology

Maximize the intention of question sentences, solve the problems of limited problem types and limited design, and improve the flexibility and accuracy of the question-and-answer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157875B_ABST
    Figure CN113157875B_ABST
Patent Text Reader

Abstract

The present invention discloses a knowledge graph question answering system, method and device, the system comprising: a data layer, used to store concept graphs and instance graphs; a model layer, used to store dictionaries required for semantic analysis of user questions; a processing layer, used to perform word segmentation and syntactic dependency analysis on user questions to obtain a dependency tree, classify and prune the nodes of the dependency tree to obtain a pruned and type-marked dependency tree, output the corresponding relationship between a word list and a node object and a node object constraint path based on the dictionary and the knowledge graph, obtain a target node based on the corresponding relationship, and query the instance graph according to the target node and the node object constraint path to obtain the instance point of the target node; an application layer, used to receive a user question input by a user and display the returned instance point to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a knowledge graph question-answering system, method and device. Background Art

[0002] In the current wave of intelligence, Internet+ has become an important strategic direction for the intelligent transformation and upgrading of many fields. Among them, the intelligent question-and-answer system is one of the most urgent needs in the transformation to optimize service processes and improve service efficiency.

[0003] Knowledge graphs have the characteristics of strong expressiveness, good scalability, and flexible operation. In vertical fields, knowledge graphs are constructed and integrated into question-answering systems to jointly improve the effectiveness of question-answering systems. Question-answering systems based on knowledge graphs at home and abroad are generally task-based, with artificially defined types of tasks that can be answered, slots to be filled under each task type, and search graph database logic to obtain the final answer; or based on the architecture of retrieval-based question-answering systems, triple information of entities and relationships in knowledge graphs is integrated to achieve more accurate responses.

[0004] The limitations of the above two methods include:

[0005] (1) The types of questions that can be answered are limited; task-based question-answering systems require human definition, and retrieval-based question-answering systems are limited by the types of questions in the question database.

[0006] (2) Limited by the design of the concept graph of the knowledge graph in the vertical field; in the task-based question-answering system, the search logic of the same question type in different concept graph designs is different, so the structure of the concept graph needs to be clear in advance.

[0007] (3) In the search-based question-answering system, the knowledge graph is integrated only to improve the accuracy of the similarity calculation between user questions and questions in the question-answering database, and the reasoning ability of the knowledge graph is not fully utilized. Summary of the invention

[0008] The purpose of the present invention is to provide a knowledge graph question answering system, method and device, aiming to solve the above-mentioned problems in the prior art.

[0009] The present invention provides a knowledge graph question answering system, comprising:

[0010] The data layer is used to store concept maps and instance maps. The concept map is used to describe the types of concept nodes, the attribute information of each type of concept node, and the relationship between different types of concept nodes. The instance map is used to store the instance information corresponding to the concept map.

[0011] The model layer is used to store the dictionary required for semantic analysis of user questions;

[0012] The processing layer is used to perform word segmentation and syntactic dependency analysis on the user's question to obtain a dependency tree, classify and prune the nodes of the dependency tree to obtain a pruned and type-marked dependency tree, and output the correspondence between the word list and the node object and the node object constraint path based on the dictionary and knowledge graph for the pruned and type-marked dependency tree, obtain the target node based on the correspondence, and query the instance graph according to the target node and the node object constraint path to obtain the instance point of the target node;

[0013] The application layer is used to receive user questions input by the user and display the returned instance points to the user.

[0014] The present invention provides a knowledge graph question answering method, comprising:

[0015] Pre-save the concept map and instance map, where the concept map is used to describe the type of concept nodes, the attribute information of each type of concept nodes, and the relationship between different types of concept nodes, and the instance map is used to save the instance information corresponding to the concept map;

[0016] Pre-save the dictionary needed for semantic analysis of user questions;

[0017] Receive user questions input by the user, perform word segmentation and syntactic dependency parsing on the user questions to obtain a dependency tree, perform node classification and pruning on the dependency tree to obtain a pruned and type-labeled dependency tree, and output the correspondence between the word list and the node object and the node object constraint path based on the concept graph for the pruned and type-labeled dependency tree, obtain the target node based on the correspondence, query the instance graph according to the target node and the node object constraint path, obtain the instance point of the target node, and display the returned instance point to the user.

[0018] An embodiment of the present invention also provides a knowledge graph question and answer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, which implements the steps of the above-mentioned knowledge graph question and answer method when the computer program is executed by the processor.

[0019] An embodiment of the present invention also provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by a processor, the steps of the above-mentioned knowledge graph question and answer method are implemented.

[0020] By adopting the embodiment of the present invention, natural language technology is used to perform semantic analysis on the user's questions at the word level and sentence level, and the results of the two analyses are combined with the knowledge graph data, the objects and query paths corresponding to the nodes in the knowledge graph are parsed from the user's questions, which can solve the shortcomings of traditional graph-based question and answer systems that the types of questions that can be answered are limited and are restricted by the knowledge graph design.

[0021] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 is a schematic diagram of a knowledge graph question answering system according to an embodiment of the present invention;

[0024] Figure 2 is a detailed schematic diagram of the knowledge graph question answering system of an embodiment of the present invention;

[0025] Figure 3a-3d is a schematic diagram of a question processing process according to an embodiment of the present invention;

[0026] Figure 4 is a flow chart of the knowledge graph question answering method according to an embodiment of the present invention;

[0027] Figure 5 It is a schematic diagram of a knowledge graph question-answering device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to solve the above problems in the prior art, the embodiment of the present invention provides a knowledge graph question answering method and system based on dictionary and syntactic dependency analysis: using natural language technology to perform semantic analysis of user questions at the word level and sentence level, combining the results of the two analyses and the knowledge graph data, parsing the objects and query paths corresponding to the nodes in the knowledge graph from the user questions. The specific operation is to use dictionary matching to perform semantic analysis at the word level for the user questions, extract key word information such as concepts, entities, attributes, and then use syntactic dependency analysis to determine the syntactic structure in the questions, and obtain the dependency logical relationship between the key words in the sentence; combine the triple information in the knowledge graph to encapsulate the key words describing a node information in the graph into a node object, that is, to parse the user question semantics into one or more node objects, and obtain the constraint path and target node between the node objects according to the result of the dependency analysis, and finally query the instance graph to obtain the final result and return it. By integrating the semantic information at the word level and sentence level in the sentence through the above operations, the intention of the question can be analyzed to the greatest extent; and when the keywords are encapsulated into node objects, they can be flexibly configured according to the real data of the knowledge graph, without the need to determine the manual changes of the knowledge graph in advance.

[0029] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than 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.

[0030] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0031] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. In addition, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0032] System Example

[0033] According to an embodiment of the present invention, a knowledge graph question answering system is provided. Figure 1 is a schematic diagram of a knowledge graph question answering system according to an embodiment of the present invention. Figure 1 As shown, the knowledge graph question answering system according to an embodiment of the present invention specifically includes:

[0034] Data layer 10, used to store concept maps and instance maps, wherein the concept map is used to describe the types of concept nodes, attribute information of each type of concept nodes, and the relationship between different types of concept nodes, and the instance map is used to store instance information corresponding to the concept map;

[0035] Model layer 12, used to store the dictionary required for semantic analysis of user questions;

[0036] The processing layer 14 is used to perform word segmentation and syntactic dependency analysis on the user's question to obtain a dependency tree, classify and prune the nodes of the dependency tree to obtain a pruned and type-marked dependency tree, and output the correspondence between the word list and the node object and the node object constraint path based on the dictionary and the knowledge graph for the pruned and type-marked dependency tree, obtain the target node based on the correspondence, and query the instance graph according to the target node and the node object constraint path to obtain the instance point of the target node;

[0037] The application layer 16 is used to receive a user question input by a user and display the returned instance points to the user.

[0038] The above modules of the embodiment of the present invention are described in detail below in conjunction with the accompanying drawings.

[0039] like Figure 2As shown in the figure, the knowledge graph question answering system based on dictionary and syntactic dependency analysis is divided into four layers, including: data layer 10, model layer 12, processing layer 14 and application layer 16. Among them, the data layer 10 is used to manage the knowledge graph data; the model layer 12 is responsible for managing the dictionary required for semantic analysis of user questions; the processing layer 14 is responsible for processing user questions; and the application layer 16 is responsible for receiving user questions and displaying the final results. The data layer 10, model layer 12, and processing layer 14 in the system will be introduced in detail below.

[0040] The data layer 10 includes a concept graph and an instance graph, which can also be called a model layer and an instance layer. The concept graph describes the types of nodes, the attribute information of each type of node, and the relationship between different types of concept nodes. The instance graph stores real instance information and is an instantiation of the concept graph.

[0041] The model layer 12 includes six dictionaries, namely, concept synonym dictionary, attribute synonym dictionary, instance synonym dictionary, attribute-concept dictionary, instance-concept dictionary, and preposition dictionary. The concept synonym dictionary maintains all possible descriptions of each concept in the concept graph. The details are shown in Table 1:

[0042] Table 1

[0043] Concept Spoken Words Concept standard word shaft shaft well shaft Oil and gas fields Oil and gas fields oilfield Oil and gas fields Block Block Production allocation plan Production allocation plan

[0044] The attribute synonym dictionary maintains all possible descriptions of the attributes in the concept graph, as shown in Table 2:

[0045] Table 2

[0046] Attribute colloquial words Attribute standard word Well Depth well deep well deep well deep Daily oil production capacity Daily oil production Daily oil production Daily oil production Water rise rate Water rise rate Water content rise rate Water rise rate Annual oil production Annual oil production Annual oil production Annual oil production Water injection intensity Water injection intensity Crude oil measurement system error Crude oil measurement system error Oil production speed Oil production speed

[0047] Instance synonyms maintain all possible descriptions of each instance in the instance graph, as shown in Table 3:

[0048] Table 3

[0049] Example spoken words Example Standard Word Tower A Tower A Block Tower A Block Tower A Block Tower A Tower A Block Tower B area Tower B Block Tower B Block Tower B Block Tower B Tower B Block TK001 Well TK001 shaft TK001 shaft TK001 shaft tk001 TK001 shaft

[0050] The attribute-concept dictionary maintains the concept corresponding to each standard attribute (i.e., the attribute existing in the graph), as shown in Table 4:

[0051] Table 4

[0052] Attribute standard word The concept of belonging Annual oil production Production allocation plan Daily oil production Production allocation plan Comprehensive water content of wells shaft Comprehensive water content Block Water rise rate Block Water content rise rate Block

[0053] The instance-concept dictionary maintains the concept to which each standard instance (i.e., the instance existing in the instance graph) belongs, as shown in Table 5:

[0054] Table 5

[0055] Example Standard Word The concept of belonging Tower A Block Block Tower B Block Block TK001 shaft shaft Zhongyuan Oilfield Oil and gas fields Northwest Oilfield Oil and gas fields District 8 Block

[0056] The preposition dictionary maintains colloquial words whose part of speech is preposition, as shown in Table 6:

[0057] Table 6

[0058] preposition What What How many

[0059] It should be noted that in the embodiment of the present invention, four dictionaries, namely, the concept synonym dictionary, the attribute synonym dictionary, the instance synonym dictionary, and the preposition dictionary, need to be manually maintained and added; the attribute-concept dictionary is automatically generated based on the concept graph data and does not require manual maintenance; the instance-concept dictionary is automatically generated based on the instance graph data and also does not require manual maintenance.

[0060] The processing layer 14 includes five modules, which are module 1 (corresponding to the first submodule), which is used for word segmentation and dependency analysis, module 2 (corresponding to the second submodule), which is used for dependency tree node classification and pruning, module 3 (corresponding to the third submodule), which is used for encapsulation of node objects and acquisition of node constraint paths, and the node objects are shown in Table 7, module 4 (corresponding to the fourth submodule), which is used for target node acquisition, and module 5 (corresponding to the fifth submodule), which is used for querying the graph database. The specific operations of the five modules are described in detail below.

[0061] Table 7

[0062] Key Value Type Concept standard word String Example Standard Word String Attribute standard word list List <string> < / string>

[0063] Module 1 is the word segmentation and dependency analysis module, which refers to the word segmentation and syntactic dependency analysis of user questions. The word segmentation method based on the dictionary is adopted, such as MMSEG. The dictionary entries include common words and professional vocabulary in vertical fields. The professional vocabulary includes four dictionary entries: concept synonyms, attribute synonyms, and instance synonyms. The question after word segmentation is subjected to dependency syntactic analysis, and the dependency logical relationship between each word in the sentence is output, that is, the dependency relationship tree. Figure 3a -d is a processing diagram of the question "What are the annual oil production plans for tower A zone and tower B zone?" in an embodiment of the present invention, wherein: Figure 3a is the dependency tree after question dependency analysis. Figure 3b is the dependency tree after pruning and marking types, Figure 3c This is the dependency tree after correction for “parallel”. Figure 3d is the node constraint path. Figure 3a As shown in the figure, each node of the relationship tree is a word. The words in the nodes are connected from left to right to form the user's question. The line segment with an arrow represents the relationship between the words in two nodes. The starting point is the parent node and the end point is the root node. The number of parent nodes of each node in the dependency tree is less than or equal to 1.

[0064] Module 2 is the classification and pruning of dependency tree nodes. Specifically, the nodes in the dependency tree output by module 1 are divided into six categories: instance words, concept words, attribute words, prepositional auxiliary words, other auxiliary words, and useless words. The nodes corresponding to useless words are removed, that is, the dependency tree is pruned of useless information, and the pruned dependency tree with each node type marked is output, such as Figure 3b As shown. The specific operation of classification in each node in the dependency tree is:

[0065] 2-1 First determine whether the word in the node is an entry in the concept synonym dictionary, attribute synonym dictionary, instance synonym dictionary, or preposition dictionary; if it is an entry in the concept synonym dictionary, the node type is a concept word; if it is an entry in the attribute synonym dictionary, the node type is an attribute word; if it is an entry in the instance synonym dictionary, the node type is an instance word; if it is an entry in the preposition dictionary, the node type is a preposition auxiliary word; if it does not belong to any of these five dictionaries, proceed to 2-2.

[0066] 2-2 Determine whether the node is a leaf node. If it is a leaf node, the node type is a useless word. If not, the node type is other auxiliary words.

[0067] Module 3 is the encapsulation of node objects and the acquisition of node constraint paths; for the pruned and type-labeled dependency tree output by module 2, combined with the triple information of the knowledge graph, the keywords describing a node in the graph are encapsulated into an object, and the corresponding relationship between the word list and the node object <word list, node object> and the node object constraint path (node ​​object 1). (node ​​object 2)... (node ​​object z) are output. The specific operations of node object encapsulation are:

[0068] 3-1 The purpose of modifying the dependency tree is to modify the parent node of the node pointed to by the "parallel" edge, such as Figure 3c As shown. For the pruned and type-marked dependency tree output by module 2, traverse each node in turn. If the relationship between the current node and the parent node n0 is "parallel", the parent node n1 of the parent node and the relationship e1 between the two are obtained, the relationship between the current node and the parent node n0 is deleted, and the parent node of the current node is changed to node n1, and the relationship between the two becomes e1.

[0069] 3-2 Obtaining the initial word constraint path, output multiple <word constraint paths, direction type> for each question, and continue with operation 3-3.

[0070] 3-2-1 For the modified dependency tree output by module 3-1, starting from each leaf node, name the leaf node as the current node, and the constraint path is the current node information (word and node type): word 1 / type 1. Set the direction type of the constraint path to -1. Continue with 3-2-2 for each <constraint path, direction type>.

[0071] 3-2-2 Get the last node of the current constraint path as the current node (current node information: word 1 and node type 1) and the direction type of the constraint path as the current direction type, and find the parent node of the current node along the relationship line segment with an arrow. If there is no parent node, directly output the current constraint path; if the parent node word has a subscript greater than the subscript of the current node word in the question, set the direction type a to 0; if the parent node word has a subscript less than the subscript of the current node word in the question, set the direction type a to 1; if the current direction type is -1 or the same as a, the parent node information (word 2 and node type 2) is spliced ​​to the end of the current constraint path: current constraint path. (word 2 / type 2) and the corresponding direction type is set to a, and the new constraint path is obtained to continue the 3-2-2 operation; if the current direction type is not -1 and is not the same as a, then output the current constraint path, and set the new constraint path to: word 2 / type 2, and the corresponding direction type is set to -1, and continue the 3-2-2 operation.

[0072] 3-3 Obtain the word constraint path, traverse each of the multiple <word constraint paths, direction type> output in 3-2, if there is a word constraint path in the remaining <word constraint paths, direction type> whose last node is the same as the first node, and the direction types are 0, 1 or 1, 0 respectively, then the word constraint path with direction type 1 is spliced ​​in reverse order after the word constraint path with direction type 0 and output, otherwise the word constraint path is directly output.

[0073] 3-4 Standardization of word constraint paths. For each word constraint path (word 1 / type 1).(word 2 / type 2)…(word m / type m) (where m>=1) output by 3-3, traverse each word i / type i (where i>=1 and i<=m) from left to right. If type i is "other auxiliary words" or "prepositional auxiliary words", skip and continue; if it is a "concept word", search the concept standard word corresponding to word i based on the concept synonym dictionary, and let standard word i be the concept standard word, and concept i be the concept standard word; if it is an "instance word", search the instance standard word corresponding to word i based on the instance synonym dictionary, and search the concept standard word corresponding to the instance standard word based on the instance-concept dictionary, and let standard word i be the instance standard word, and concept i be the concept standard word; if it is an "attribute word", search the attribute standard word corresponding to word i based on the attribute synonym dictionary, and search the concept standard word corresponding to the attribute standard word based on the attribute-concept dictionary, and let standard word i be the attribute standard word, and concept i be the concept standard word. Output (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n) (where n<=m).

[0074] For example, for Figure 3c After operations 3-2 and 3-3, the modified dependency tree obtains two constraint paths, namely (Tower A area / instance word).(production allocation plan / concept word).(annual oil production / attribute word).(respectively / other auxiliary words).(is / other auxiliary words).(how much / preposition auxiliary word), (Tower B area / instance word).(production allocation plan / concept word).(annual oil production / attribute word).(respectively / other auxiliary words).(is / other auxiliary words).(how much / preposition auxiliary word); after operations 3-4, two standardized constraint paths are obtained, namely (Tower A area / Tower A area, instance word, block).(production allocation plan / production allocation plan, concept word, production allocation plan).(annual oil production / annual oil production, attribute word, production allocation plan), (Tower B area / Tower B area, instance word, block).(production allocation plan / production allocation plan, concept word, production allocation plan).(annual oil production / annual oil production, attribute word, production allocation plan).

[0075] 3-5 Initialization of node objects; for each standardized word constraint path output by 3-4 (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n), encapsulate the same concepts into node objects from left to right, output the correspondence between word list and node object <word list i, word list i / node object i> and node object constraint path (word list 1, node object 1).(word list 2, node object 2)…(word list z, node object z) (where z<=n), feed to 3-6 to continue the operation.

[0076] Improvement of 3-6 node objects;

[0077] 3-6-1 Improvement of node objects corresponding to word lists; for multiple input <word list i, word list i' / node object i'>, compare them two by two. If there is a word list i' corresponding to word list i that contains word list j' corresponding to word list j (condition 1), then the union of word list i' and list i' is named word list k', and the fields in node object i' corresponding to word list i and node object j' corresponding to word list j complement each other to become node k', and then <word list i, word list i' / node object i'> becomes <word list i, list k' / node object k'>, and <word list j, word list j' / node object j'> becomes <word list j, list k' / node object k'>, and continue to feed 3-6-1 for node object improvement, until both <word list i, word list i' / node object i'> do not meet condition 1, and proceed to 3-6-2.

[0078] 3-6-2 For the multiple node object constraint paths output in 3-5, modify the node object i to the new node i' corresponding to the word list i, and accordingly output multiple node object constraint paths after the node objects are improved (node ​​object 1').(node ​​object 2')...(node ​​object z'), where z'<=n, such as Figure 3d As shown, the correspondence between the word list and the node object is <word list i', node object i'>.

[0079] Module 4: Target node acquisition; for the dependency tree with the modified and pruned output of module 3-1 and each node type annotated, calculate the node with the node type of concept word, attribute word or instance word that is closest to the node type of preposition auxiliary word, obtain the word k corresponding to the node, and for the correspondence relationship <word list, node object> between one or more word lists and nodes output by module 3, if the word list contains word k, mark the node object corresponding to the word list as the target node output.

[0080] Module 5 queries the graph database; queries the instance graph for the multiple node constraint paths output by module 3 and the target node output by module 4 to obtain the instance point return of the target node.

[0081] In summary, with the help of the embodiments of the present invention, by utilizing natural language technology to perform semantic analysis of user questions at the word level and sentence level, and combining the results of the two analyses with the knowledge graph data, the objects and query paths corresponding to the nodes in the knowledge graph are parsed from the user questions, which can solve the shortcomings of traditional graph-based question and answer systems that are limited in the types of questions that can be answered and are restricted by the knowledge graph design.

[0082] Method Embodiment

[0083] According to an embodiment of the present invention, a knowledge graph question answering method is provided. Figure 4 is a flow chart of the knowledge graph question answering method according to an embodiment of the present invention. Figure 4 As shown, the knowledge graph question answering method according to an embodiment of the present invention specifically includes:

[0084] Step 401, pre-save the concept map and the instance map, wherein the concept map is used to describe the type of concept nodes, the attribute information of each type of concept nodes and the relationship between different types of concept nodes, and the instance map is used to save the instance information corresponding to the concept map;

[0085] Step 402, pre-save the dictionaries required for semantic analysis of user questions; the dictionaries specifically include: a concept synonym dictionary, an attribute synonym dictionary, an instance synonym dictionary, an attribute-concept dictionary, an instance-concept dictionary, and a preposition dictionary, wherein the concept synonym dictionary is used to maintain all possible descriptions of each concept in the concept map, the attribute synonym dictionary is used to maintain all possible descriptions of the attributes in the concept map, the instance synonym dictionary is used to maintain all possible descriptions of each instance in the instance map, the attribute-concept dictionary is used to maintain the concept corresponding to each standard attribute, the instance-concept dictionary is used to maintain the concept to which each standard instance belongs, and the preposition dictionary is used to maintain colloquial words whose part of speech is preposition.

[0086] Step 403, receiving a user question input by a user, performing word segmentation and syntactic dependency parsing on the user question to obtain a dependency tree, performing node classification and pruning on the dependency tree to obtain a pruned and type-marked dependency tree, outputting a correspondence between a word list and a node object, and a node object constraint path based on a dictionary and a knowledge graph for the pruned and type-marked dependency tree, obtaining a target node based on the correspondence, querying an instance graph based on the target node and the node object constraint path, obtaining an instance point of the target node, and displaying the returned instance point to the user.

[0087] Step 403 specifically includes:

[0088] Use a dictionary-based word segmentation method to segment user questions, perform dependency syntactic analysis on the segmented questions, and output a dependency tree that represents the dependency logical relationship between each word in the sentence;

[0089] The nodes in the dependency tree are divided into six categories: instance words, concept words, attribute words, prepositional auxiliary words, other auxiliary words, and useless words. The nodes corresponding to the useless words in the dependency tree are removed, and the dependency tree with pruned branches and marked with each node type is output; specifically, the following processing is included: first, it is determined whether the words in the nodes in the dependency tree are entries in the concept synonym dictionary, the attribute synonym dictionary, the instance synonym dictionary, and the preposition dictionary; if they are entries in the concept synonym dictionary, the node type is determined to be a concept word; if they are entries in the attribute synonym dictionary, the node type is determined to be an attribute word; if they are entries in the instance synonym dictionary, the node type is determined to be an instance word; if they are entries in the preposition dictionary, the node type is determined to be a prepositional auxiliary word; if they do not belong to the entries in these five categories of dictionaries, it is further determined whether the node is a leaf node; if it is a leaf node, the node type is determined to be a useless word; if not, the node type is other auxiliary words;

[0090] The dependency tree that is pruned and annotated with each node type is corrected, and combined with the triple information of the knowledge graph, the keywords describing a node of the knowledge graph are encapsulated into a node object, and the corresponding relationship between the word list and the node object <word list, node object> and the constraint path of each node object are output; specifically, the following processing is included: for the dependency tree that is pruned and annotated with each node type, each node is traversed in turn. If the current node and the parent node n0 are in parallel, the parent node n1 of the parent node and the relationship e1 between the two are obtained, the relationship between the current node and the parent node n0 is deleted, and the parent node of the current node is changed to node n1, and the relationship between the two becomes e1, and the corrected dependency tree is output; for the corrected dependency tree, starting from each leaf node, the leaf node is named the current node, and the constraint path is the current node information: word 1 / type 1, and the direction type of the constraint path is set to -1; for each <constraint path, direction type>, the last node of the current constraint path is obtained as the current node and the direction type of the constraint path is the current direction type, and the parent node of the current node is found. If there is no parent node , then directly output the current constraint path; if the parent node word in the question has a greater subscript than the current node word, set the direction type a to 0; if the parent node word in the question has a less subscript than the current node word, set the direction type a to 1; if the current direction type is -1 or the same as a, concatenate the parent node information, i.e., word 2 and node type 2, to the end of the current constraint path, and set the corresponding direction type to a to obtain a new constraint path; if the current direction type is not -1 and is not the same as a, then output the current constraint path, and set the new constraint path to: word 2 / class Type 2, the corresponding direction type is set to -1, and multiple <word constraint paths, direction type> are output for each question; traverse each of the multiple <word constraint paths, direction type>, if there is a word constraint path in the remaining <word constraint paths, direction type> whose last node is the same as the first node of the path, and the direction types are 0, 1 or 1, 0 respectively, then the word constraint path with direction type 1 is reversely spliced ​​to the back of direction type 0 and output, otherwise the word constraint path is directly output; for each word constraint path (word 1 / type 1) output.(word 2 / type 2)…(word m / type m) where m>=1, traverse each word i / type i from left to right, where i>=1 and i<=m. If type i is "other auxiliary words" or "prepositional auxiliary words", skip and continue; if it is a "concept word", search for the concept standard word corresponding to word i based on the concept synonym dictionary, and let standard word i be the concept standard word, and concept i be the concept standard word; if it is an "instance word", search for the instance standard word corresponding to word i based on the instance synonym dictionary, and search for the instance standard word pair based on the instance-concept dictionary. The corresponding concept standard word is used, and standard word i is the instance standard word, and concept i is the concept standard word; if it is an "attribute word", the attribute standard word corresponding to word i is searched based on the attribute synonym dictionary, and the concept standard word corresponding to the attribute standard word is searched based on the attribute-concept dictionary, and standard word i is the attribute standard word, and concept i is the concept standard word, and the standardized word constraint path is output (word 1 / standard word 1, type 1, concept 1). (word 2 / standard word 2, type 2, concept 2)...(word n / standard word n, type n, concept n), where n<=m. For each standardized word constraint path (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n), encapsulate the same concepts into node objects from left to right, output the correspondence between word lists and node objects <word list i, word list i / node object i> and node object constraint path (word list 1, node object 1).(word list 2, node object 2)…(word list z, node object z), where z<=n; for multiple <word list i, word list i' / node object i'>, perform pairwise comparisons. If condition 1 exists, that is, word list i' corresponding to word list i contains word list j' corresponding to word list j, then the union of word list i' and list i' is named word list k', and node object i' corresponding to word list i and word list j The fields in the corresponding node object j' complement each other to become node k', and then <word list i, word list i' / node object i'> becomes <word list i, list k' / node object k'>, <word list j, word list j' / node object j'> becomes <word list j, list k' / node object k'>, and the node object improvement process continues until <word list i, word list i' / node object i'> do not meet condition 1. For multiple node object constraint paths, the node object i is modified to the new node i' corresponding to the word list i, and multiple node object constraint paths after node object improvement are output accordingly (node ​​object 1'). (node ​​object 2')... (node ​​object z'), where z'<=n, and the corresponding relationship between the word list and the node object <word list i', node object i'>;.

[0091] Based on the modified dependency tree, calculate the node whose node type is concept word, attribute word or instance word and the node whose node type is preposition auxiliary word is closest, obtain the word k corresponding to the node, and judge whether the word list in the corresponding relationship <word list, node object> between one or more word lists and nodes contains word k. If it is judged to be yes, mark the node object corresponding to the word list as the target node output;

[0092] According to the plurality of node constraint paths and the target node query instance map, the instance point of the target node is obtained and fed back.

[0093] The embodiment of the present invention is a method embodiment corresponding to the above-mentioned system embodiment. The specific operation of each step can be understood by referring to the description of the system embodiment, which will not be repeated here.

[0094] Device Example 1

[0095] The embodiment of the present invention provides a knowledge graph question answering device, such as Figure 5 As shown, it includes: a memory 50, a processor 52, and a computer program stored in the memory 50 and executable on the processor 52. When the computer program is executed by the processor 52, the steps described in the method embodiment are implemented.

[0096] Device Example 2

[0097] An embodiment of the present invention provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by the processor 52, the steps described in the method embodiment are implemented.

[0098] The computer-readable storage medium in this embodiment includes, but is not limited to, ROM, RAM, magnetic disk or optical disk, etc.

[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0100] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A knowledge graph question answering system, characterized in that: include: The data layer is used to store concept maps and instance maps. The concept map is used to describe the types of concept nodes, the attribute information of each type of concept node, and the relationship between different types of concept nodes. The instance map is used to store the instance information corresponding to the concept map. The model layer is used to store the dictionary required for semantic analysis of user questions; The processing layer is used to perform word segmentation and syntactic dependency analysis on the user's question to obtain a dependency tree, classify and prune the nodes of the dependency tree to obtain a pruned and type-marked dependency tree, and output the correspondence between the word list and the node object and the node object constraint path based on the dictionary and the knowledge graph for the pruned and type-marked dependency tree, obtain the target node based on the correspondence, and query the instance graph according to the target node and the node object constraint path to obtain the instance point of the target node; the processing layer specifically includes: The first submodule is used to segment the user's question sentence using a dictionary-based segmentation method, perform dependency syntactic analysis on the segmented question sentence, and output a dependency tree representing the dependency logical relationship between each word in the sentence; The second submodule is used to divide the nodes in the dependency tree into six categories: instance words, concept words, attribute words, prepositional auxiliary words, other auxiliary words, and useless words, remove the nodes corresponding to the useless words in the dependency tree, and output the pruned dependency tree with each node type marked; The third submodule is used to modify the dependency tree that has been pruned and annotated with each node type, and to encapsulate the keywords describing a node of the knowledge graph into a node object in combination with the triple information of the knowledge graph, and output the corresponding relationship between the word list and the node object <word list, node object> and the constraint path of each node object; the third submodule is specifically used to: For the dependency tree that is pruned and labeled with each node type, traverse each node in turn. If the current node is in parallel with its parent node n0, obtain the parent node n1 of the parent node and the relationship e1 between the two. Delete the relationship between the current node and the parent node n0, and change the parent node of the current node to node n1. The relationship between the two becomes e1. Output the revised dependency tree. For the modified dependency tree, starting from each leaf node, name the leaf node as the current node, and the constraint path is the current node information: word 1 / type 1, and the direction type of the constraint path is -1; For each <constraint path, direction type>, obtain the last node of the current constraint path as the current node and the direction type of the constraint path as the current direction type, find the parent node of the current node, if there is no parent node, directly output the current constraint path; if the parent node word has a subscript greater than the subscript of the current node word in the question, set the direction type a to 0, if the parent node word has a subscript less than the subscript of the current node word in the question, set the direction type a to 1, if the current direction type is -1 or the same as a, splice the parent node information, i.e. word 2 and node type 2, to the end of the current constraint path, and set the corresponding direction type to a to obtain a new constraint path; if the current direction type is not -1 and is not the same as a, output the current constraint path, and set the new constraint path to: word 2 / type 2, and the corresponding direction type is set to -1, and output multiple <word constraint paths, direction types> for each question; Traverse each of the multiple <word constraint paths, direction type>. If there is a word constraint path in the remaining <word constraint paths, direction type> whose last node is the same as the first node of the word constraint path, and whose direction types are 0, 1 or 1, 0 respectively, then the word constraint path with direction type 1 is concatenated in reverse order to the one with direction type 0 and output. Otherwise, directly output the word constraint path. For each word constraint path outputted (word 1 / type 1).(word 2 / type 2)…(word m / type m) where m>=1, traverse each word i / type i from left to right, where i>=1 and i<=m. If type i is "other auxiliary words" or "prepositional auxiliary words", skip and continue; if it is a "concept word", search for the concept standard word corresponding to word i based on the concept synonym dictionary, and let standard word i be the concept standard word, and concept i be the concept standard word; if it is an "instance word", search for the instance standard word corresponding to word i based on the instance synonym dictionary, based on the instance-concept The dictionary searches for the concept standard word corresponding to the instance standard word, and let standard word i be the instance standard word, and concept i be the concept standard word; if it is an "attribute word", the attribute standard word corresponding to word i is searched based on the attribute synonym dictionary, and the concept standard word corresponding to the attribute standard word is searched based on the attribute-concept dictionary, and let standard word i be the attribute standard word, and concept i be the concept standard word, and output the standardized word constraint path (word 1 / standard word 1, type 1, concept 1). (word 2 / standard word 2, type 2, concept 2)...(word n / standard word n, type n, concept n), where n<=m; For each standardized word constraint path (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n), encapsulate the same concepts into node objects from left to right, output the correspondence between word list and node object <word list i, word list i / node object i> and the node object constraint path (word list 1, node object 1).(word list 2, node object 2)…(word list z, node object z), where z<=n; For multiple <word list i, word list i' / node object i'>, compare them two by two. If condition 1 exists, that is, word list i' corresponding to word list i contains word list j' corresponding to word list j, then the union of word list i' and list i' is named word list k', and the fields in node object i' corresponding to word list i and node object j' corresponding to word list j complement each other to become node k', and then <word list i, word list i' / node object i'> becomes <word list i, list k' / node object k'>, <word list j, word list j' / node object j' >becomes <word list j, list k' / node object k'>, and continues to improve the node object until both <word list i, word list i' / node object i'> do not meet condition 1. For multiple node object constraint paths, modify the node object i to the new node i' corresponding to the word list i, and output multiple node object constraint paths after node object improvement (node ​​object 1').(node ​​object 2')...(node ​​object z'), where z'<=n, and the corresponding relationship between the word list and the node object <word list i', node object i'>; The fourth submodule is used to calculate the node closest to the node type of preposition auxiliary word among the concept words, attribute words or instance words based on the modified dependency tree, obtain the word k corresponding to the node, and determine whether the word list in the corresponding relationship <word list, node object> between one or more word lists and the node contains the word k. If it is determined to be yes, the node object corresponding to the word list is marked as the target node output; A fifth submodule is used to obtain the instance point of the target node according to the multiple node constraint paths and the target node query instance map, and feed it back to the application layer; The application layer is used to receive user questions input by the user and display the returned instance points to the user.

2. The system according to claim 1, characterized in that The dictionary specifically includes: a concept synonym dictionary, an attribute synonym dictionary, an instance synonym dictionary, an attribute-concept dictionary, an instance-concept dictionary, and a preposition dictionary, wherein the concept synonym dictionary is used to maintain all possible descriptions of each concept in the concept graph, the attribute synonym dictionary is used to maintain all possible descriptions of the attributes in the concept graph, the instance synonym dictionary is used to maintain all possible descriptions of each instance in the instance graph, the attribute-concept dictionary is used to maintain the concept corresponding to each standard attribute, the instance-concept dictionary is used to maintain the concept to which each standard instance belongs, and the preposition dictionary is used to maintain colloquial words whose part of speech is preposition.

3. The system according to claim 1, characterized in that The second submodule is specifically used for: First, determine whether the words in the nodes in the dependency tree are entries in the concept synonym dictionary, the attribute synonym dictionary, the instance synonym dictionary, and the preposition dictionary; if it is an entry in the concept synonym dictionary, determine that the node type is a concept word; if it is an entry in the attribute synonym dictionary, determine that the node type is an attribute word; if it is an entry in the instance synonym dictionary, determine that the node type is an instance word; if it is an entry in the preposition dictionary, determine that the node type is a preposition auxiliary word; if it does not belong to any of the five types of dictionaries, further determine whether the node is a leaf node; if it is a leaf node, determine that the node type is a useless word; if not, the node type is other auxiliary words.

4. A knowledge graph question answering method, characterized in that: include: Pre-save the concept map and instance map, where the concept map is used to describe the type of concept nodes, the attribute information of each type of concept nodes, and the relationship between different types of concept nodes, and the instance map is used to save the instance information corresponding to the concept map; Pre-save the dictionary needed for semantic analysis of user questions; Receive a user question input by a user, perform word segmentation and syntactic dependency analysis on the user question to obtain a dependency tree, perform node classification and pruning on the dependency tree to obtain a pruned and type-marked dependency tree, output the correspondence between a word list and a node object and a node object constraint path based on a concept graph for the pruned and type-marked dependency tree, obtain a target node based on the correspondence, query an instance graph based on the target node and the node object constraint path, obtain an instance point of the target node, and display the returned instance point to the user, specifically including: Use a dictionary-based word segmentation method to segment user questions, perform dependency syntactic analysis on the segmented questions, and output a dependency tree that represents the dependency logical relationship between each word in the sentence; The nodes in the dependency tree are divided into six categories: instance words, concept words, attribute words, prepositional auxiliary words, other auxiliary words, and useless words. The nodes corresponding to the useless words in the dependency tree are removed, and the dependency tree with pruned branches and marked with each node type is output; specifically, the following processing is included: First, determine whether the word in the node in the dependency tree is an entry in a concept synonym dictionary, an attribute synonym dictionary, an instance synonym dictionary, and a preposition dictionary; if it is an entry in a concept synonym dictionary, determine that the node type is a concept word; if it is an entry in an attribute synonym dictionary, determine that the node type is an attribute word; if it is an entry in an instance synonym dictionary, determine that the node type is an instance word; if it is an entry in a preposition dictionary, determine that the node type is a preposition auxiliary word; if it does not belong to any of the five types of dictionaries, further determine whether the node is a leaf node; if it is a leaf node, determine that the node type is a useless word; if not, determine that the node type is other auxiliary words; The dependency tree that has been pruned and annotated with each node type is modified, and combined with the triple information of the knowledge graph, the keywords describing a node of the knowledge graph are encapsulated into a node object, and the corresponding relationship between the word list and the node object <word list, node object> and the constraint path of each node object are output, which specifically includes the following processing: For the dependency tree that has been pruned and labeled with each node type, traverse each node in turn. If the current node is in parallel with the parent node n0, obtain the parent node n1 of the parent node and the relationship between the two e1, delete the relationship between the current node and the parent node n0, and change the parent node of the current node to node n1, the relationship between the two becomes e1, and output the revised dependency tree; for the revised dependency tree, starting from each leaf node, name the leaf node as the current node, and the constraint path is the current node information: word 1 / type 1, and set the direction type of the constraint path to -1; for each <constraint path, direction type>, obtain the last node of the current constraint path as the current node and the direction type of the constraint path is Current direction type, find the parent node of the current node. If there is no parent node, directly output the current constraint path; if the parent node word has a greater subscript than the current node word in the question, set the direction type a to 0; if the parent node word has a less subscript than the current node word in the question, set the direction type a to 1; if the current direction type is -1 or the same as a, add the parent node information, i.e. word 2 and node type 2, to the end of the current constraint path, and set the corresponding direction type to a to obtain a new constraint path; if the current direction type is not -1 and is not the same as a, output the current constraint path, and set the new constraint path to: word 2 / type 2, and set the corresponding direction type to -1. Output multiple <word constraint paths for each question. Path, direction type>; traverse each of the multiple <word constraint paths, direction type>, if there is a word constraint path in the remaining <word constraint paths, direction type> whose last node is the same as the first node, and the direction types are 0, 1 or 1, 0 respectively, then the word constraint path with direction type 1 is reversely spliced ​​to the back of direction type 0 and output, otherwise the word constraint path is directly output; for each word constraint path output (word 1 / type 1).(word 2 / type 2)…(word m / type m) where m>=1, traverse each word i / type i from left to right, where i>=1 and i<=m, if type i is "other auxiliary words" or "prepositional auxiliary words", skip and continue; if it is " If it is a "concept word", the concept standard word corresponding to word i is searched based on the concept synonym dictionary, and standard word i is set as the concept standard word and concept i is set as the concept standard word; if it is an "instance word", the instance standard word corresponding to word i is searched based on the instance synonym dictionary, and the concept standard word corresponding to the instance standard word is searched based on the instance-concept dictionary, and standard word i is set as the instance standard word and concept i is set as the concept standard word; if it is an "attribute word", the attribute standard word corresponding to word i is searched based on the attribute synonym dictionary, and the concept standard word corresponding to the attribute standard word is searched based on the attribute-concept dictionary, and standard word i is set as the attribute standard word and concept i is set as the concept standard word, and the standardized word constraint path is output (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n), where n<=m; for each standardized word constraint path (word 1 / standard word 1, type 1, concept 1).(word 2 / standard word 2, type 2, concept 2)…(word n / standard word n, type n, concept n), encapsulate the same concepts into node objects from left to right, output the correspondence between word lists and node objects <word list i, word list i / node object i> and node object constraint path (word list 1, node object 1).(word list 2, node object 2)…(word list z, node object z), where z<=n; for multiple <word list i, word list i' / node object i'>, perform pairwise comparisons. If condition 1 exists, that is, word list i' corresponding to word list i contains word list j' corresponding to word list j, then the union of word list i' and list i' is named word list k', the fields in the node object i' corresponding to word list i and the node object j' corresponding to word list j complement each other to become node k', and then <word list i, word list i' / node object i'> becomes <word list i, list k' / node object k'>, <word list j, word list j' / node object j'> becomes <word list j, list k' / node object k'>, and the node object improvement process continues until <word list i, word list i' / node object i'> does not meet condition 1 in pairs. For multiple node object constraint paths, the node object i is modified to the new node i' corresponding to word list i, and multiple node object constraint paths after node object improvement are output accordingly (node ​​object 1'). (node ​​object 2')... (node ​​object z'), where z'<=n, and the corresponding relationship between word list and node object <word list i', node object i'>;. The dependency tree that is pruned and annotated with each node type is modified, and combined with the triple information of the knowledge graph, the keywords describing a node of the knowledge graph are encapsulated into a node object, and the corresponding relationship between the word list and the node object <word list, node object> and the constraint path of each node object are output; Based on the modified dependency tree, calculate the node whose node type is concept word, attribute word or instance word and the node whose node type is preposition auxiliary word is closest, obtain the word k corresponding to the node, and judge whether the word list in the corresponding relationship <word list, node object> between one or more word lists and nodes contains word k. If it is judged to be yes, mark the node object corresponding to the word list as the target node output; According to the plurality of node constraint paths and the target node query instance map, the instance point of the target node is obtained and fed back.

5. The method according to claim 4, characterized in that The dictionary specifically includes: a concept synonym dictionary, an attribute synonym dictionary, an instance synonym dictionary, an attribute-concept dictionary, an instance-concept dictionary, and a preposition dictionary, wherein the concept synonym dictionary is used to maintain all possible descriptions of each concept in the concept graph, the attribute synonym dictionary is used to maintain all possible descriptions of the attributes in the concept graph, the instance synonym dictionary is used to maintain all possible descriptions of each instance in the instance graph, the attribute-concept dictionary is used to maintain the concept corresponding to each standard attribute, the instance-concept dictionary is used to maintain the concept to which each standard instance belongs, and the preposition dictionary is used to maintain colloquial words whose part of speech is preposition.

6. A knowledge graph question-answering device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the knowledge graph question-answering method as described in any one of claims 4 to 5.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an implementation program for information transmission, and when the program is executed by the processor, the steps of the knowledge graph question-answering method as described in any one of claims 4 to 5 are implemented.