CN113641813A - Knowledge graph-based question-answering system and method, electronic equipment and storage medium - Google Patents

Knowledge graph-based question-answering system and method, electronic equipment and storage medium Download PDF

Info

Publication number
CN113641813A
CN113641813A CN202111019634.8A CN202111019634A CN113641813A CN 113641813 A CN113641813 A CN 113641813A CN 202111019634 A CN202111019634 A CN 202111019634A CN 113641813 A CN113641813 A CN 113641813A
Authority
CN
China
Prior art keywords
question
answer
entity
path
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111019634.8A
Other languages
Chinese (zh)
Inventor
袁杰
于皓
张�杰
吴明辉
吴信东
邓礼志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Miaozhen Information Technology Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Minglue Artificial Intelligence Group Co Ltd filed Critical Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202111019634.8A priority Critical patent/CN113641813A/en
Publication of CN113641813A publication Critical patent/CN113641813A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a question-answering system, a method, electronic equipment and a storage medium based on a knowledge graph, wherein the question-answering system comprises: the question analysis module is used for identifying question intentions and core entities of the questions to be processed; the question-answer retrieval template generating module is used for generating a question-answer retrieval template according to the identified question and sentence intention and the core entity; the candidate path acquisition module is used for determining a target field to which the problem to be processed belongs according to the core entity and acquiring a plurality of question and answer candidate paths in the target field; the target path determining module is used for selecting a target question-answer path from a plurality of question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path; and the question answer determining module is used for generating a graph database query sentence according to the target question-answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence so as to obtain a question-answer result corresponding to the question-answer retrieval template.

Description

Knowledge graph-based question-answering system and method, electronic equipment and storage medium
Technical Field
The application relates to the technical field of natural language processing in artificial intelligence, in particular to a question-answering system and method based on a knowledge graph, electronic equipment and a storage medium.
Background
With the rapid development of deep learning technology, the technical capability in the fields of search and question answering is greatly improved. After the concept of the knowledge graph is proposed, the knowledge graph technology is widely applied to the direction of enhancing the searching and question-answering capability because the self-advancement of the knowledge graph can well represent the association relation between the objects in the nature.
In the prior art, the question-answering system based on the knowledge graph is still difficult to align by inherent knowledge in different fields, the knowledge concept deviation between the fields is large, and the knowledge concept deviation cannot be represented by a uniform graph.
Disclosure of Invention
In view of the above, an object of the present application is to provide a knowledge-graph-based question-answering system, a method, an electronic device and a storage medium.
In a first aspect, an embodiment of the present application provides a knowledge graph-based question-answering system, where the question-answering system includes:
the question analysis module is used for identifying question intentions and core entities of the questions to be processed;
the question-answer retrieval template generating module is used for generating a question-answer retrieval template according to the identified question and sentence intention and the core entity;
the candidate path acquisition module is used for determining a target field to which the to-be-processed question belongs according to the core entity and acquiring a plurality of question and answer candidate paths in the target field, wherein the plurality of question and answer candidate paths are query paths generated on the basis of a one-degree relationship in a domain map of the target field;
the target path determining module is used for selecting a target question-answer path from a plurality of question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path;
and the question answer determining module is used for generating a graph database query sentence according to the target question-answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence so as to obtain a question-answer result corresponding to the question-answer retrieval template.
Optionally, the question-answering system further comprises a candidate path generating module, configured to:
determining a domain map of a target domain to which a problem to be processed belongs according to a core entity, and identifying a first-degree relation based on the core entity in the domain map;
determining a multi-degree relation in the domain map from the domain map according to the first-degree relation;
establishing a plurality of query paths based on the core entity based on the one-degree relation and the multi-degree relation so as to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; the query path comprises a query relationship path or a query attribute path.
Optionally, the question-answering system further comprises:
the map definition module is used for determining a preset map structure of a target field to which the problem to be processed belongs according to the core entity and determining a field map containing an entity type, a relation type and/or an attribute type.
Optionally, the target path determining module includes:
the similarity calculation unit is used for calculating the text similarity and the character string editing distance between the question retrieval template and each question and answer candidate path, and determining the similarity between the question retrieval template and each question and answer candidate path by using a first preset weight corresponding to the text similarity and a second preset weight corresponding to the character string editing distance;
the sequencing unit is used for sequencing the determined similarity according to a descending order to obtain a similarity ranking;
and the path determining unit is used for determining the question-answer candidate path corresponding to the first bit in the similarity ranking as the target question-answer path.
Specifically, the question parsing module is further configured to determine an entity type of the core entity, where the question-sentence intent includes a query relationship type, and the question-answer retrieval template is as follows:
< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type >;
the relation type is determined by performing semantic recognition on the problem to be processed, and the query entity type is a question and answer result of the problem to be processed;
and/or, the question and answer intention comprises a query attribute type, and the question and answer retrieval template is as follows:
< core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >;
the attribute type is determined by performing semantic recognition on the problem to be processed, and the attribute value result is a question and answer result of the problem to be processed.
Optionally, the one-degree relationship is used to represent an entity relationship that the core entity has, or an entity attribute of the core entity; the multi-degree relationship is used for representing at least two entity relationships that the core entity has, or entity attributes of the core entity under the condition of having at least one entity relationship.
In a second aspect, an embodiment of the present application further provides a question-answering method based on a knowledge graph, where the question-answering method includes:
identifying a question intention and a core entity of a problem to be processed;
generating a question-answer retrieval template according to the identified question-sentence intentions and the core entity;
determining a target field to which a problem to be processed belongs according to a core entity, and acquiring a plurality of question and answer candidate paths in the target field, wherein the plurality of question and answer candidate paths are query paths generated based on a first-degree relation in a field map of the target field;
selecting a target question-answer path from a plurality of question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path;
and generating a graph database query sentence according to the target question and answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence to obtain a question and answer result corresponding to the question and answer retrieval template.
Optionally, the question answering method further includes:
determining a domain map of a target domain to which a problem to be processed belongs according to a core entity, and identifying a first-degree relation based on the core entity in the domain map;
determining a multi-degree relation in the domain map from the domain map according to the first-degree relation;
establishing a plurality of query paths based on the core entity based on the one-degree relation and the multi-degree relation so as to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; the query path comprises a query relationship path or a query attribute path.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the electronic device comprises a processor, a memory and a bus, wherein the memory stores machine readable instructions executable by the processor, the processor and the memory are communicated through the bus when the electronic device runs, and the machine readable instructions are executed by the processor to execute the steps of the question answering method.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the steps of the question answering method described above.
The embodiment of the application provides a question-answering system based on a knowledge graph, wherein the question-answering system comprises: the question analysis module is used for identifying question intentions and core entities of the questions to be processed; the question-answer retrieval template generating module is used for generating a question-answer retrieval template according to the identified question and sentence intention and the core entity; the candidate path acquisition module is used for determining a target field to which the to-be-processed question belongs according to the core entity and acquiring a plurality of question and answer candidate paths in the target field, wherein the plurality of question and answer candidate paths are query paths generated on the basis of a one-degree relationship in a domain map of the target field; the target path determining module is used for selecting a target question-answer path from a plurality of question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path; and the question answer determining module is used for generating a graph database query sentence according to the target question-answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence so as to obtain a question-answer result corresponding to the question-answer retrieval template. According to the method and the device, the question and sentence intentions and the core entities of the problems to be processed are identified, the target question and answer path with the largest similarity is determined, then the question and answer results of the corresponding problems to be processed are obtained by inquiring in the target graph database, the problem that how to enable the inherent knowledge in different fields to use the universal knowledge graph is solved, and the technical effect of improving the adaptability of the knowledge graph is achieved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a schematic structural diagram of a first knowledge-graph based question-answering system provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a second knowledge-graph based question-answering system provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a third knowledge-graph based question-answering system provided in the embodiments of the present application;
FIG. 4 is a flow chart of a knowledge-graph based question-answering method provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. Every other embodiment that can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present application falls within the protection scope of the present application.
In the prior art, the query and answer search of the knowledge graph is carried out in a triple (entity, predicate and value) mode, triple vocabularies contained in the field often do not meet the condition, and for a query and answer system of the knowledge graph, the problem that the knowledge concept deviation between the fields is large because inherent knowledge in different fields is difficult to align, and cannot be represented through a uniform graph still exists.
Based on this, the embodiment of the application provides a question-answering system, a method, an electronic device and a storage medium based on a knowledge graph, a question-answering path with the maximum similarity is determined by identifying question and sentence intentions and core entities of problems to be processed, and then a question-answering result of corresponding problems to be processed is obtained by querying in a target graph database, so that the problem that how to enable inherent knowledge in different fields to use a universal knowledge graph is solved, and the technical effect of improving the adaptability of the knowledge graph is achieved.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a first knowledge-graph-based question-answering system according to an embodiment of the present application. As shown in fig. 1, the question-answering system 100 includes:
the question parsing module 110 is used for identifying question intents and core entities of the questions to be processed.
Wherein, the question intention refers to the speaking intention involved in the problem to be processed, such as "who is wife of yao? "the question is intended to inquire about wife of Yao; the core entity refers to a main entity contained in the problem to be processed and an entity type corresponding to the main entity.
Specifically, different fields correspond to different entity types, and the entity types generally do not change; the entity type and the entity are decoupled, and the entity type can represent a certain type of entity. For example, the person domain may include entity types such as persons, professions, units, nationalities, and the like; the makeup art includes entity types such as product, brand, efficacy, category, ingredient, etc.
Illustratively, the pending question of the input is "who is a wife of a yao? "; the question sentence intentions identified by the question analysis module are: "query relationship or attribute: wife "; the core entities are: "character: yao chi ", wherein the entity type is a character.
And a question-answer retrieval template generating module 120, configured to generate a question-answer retrieval template according to the identified question-sentence intent and the core entity.
Specifically, the question-answer search template is < core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >.
Illustratively, based on the above-mentioned to-be-processed question, the question-answer retrieval template is "< core entity: yao Zhi > - < entity relationship: wife > - < query entity: character > ". The question-answer retrieval template is more standardized and can be directly used for subsequent similarity calculation.
Where "< >" in this notation is used to denote the beginning of an entity item, ">" is used to denote the end of an entity item, and "-" is used to denote a separator between adjacent entity items, i.e., "< >" and "< >". Here, the entity item includes any one of: core entity: an entity type; entity relationship: a relationship type; querying an entity: querying the entity type; entity attributes: an attribute type; attribute values: and (5) attribute value result.
The candidate path obtaining module 130 is configured to determine, according to the core entity, a target domain to which the to-be-processed question belongs, and obtain a plurality of question and answer candidate paths in the target domain, where the plurality of question and answer candidate paths are query paths generated based on a first-degree relationship in a domain graph of the target domain.
Wherein the target domain refers to the domain to which the core entity belongs, i.e. also to the domain to which the problem is to be handled.
Specifically, the first-degree relationship includes "< core entity: entity type > - < relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < attribute: attribute type > - < attribute value: attribute value result > ". For example, < core entity: character > - < relationship: birth address > - < query entity: city of province > or < core entity: person > - < attribute: date of birth > - < attribute value: a certain day of a certain month and a certain year >.
And a target path determining module 140, configured to select a target question-answer path from the question-answer candidate paths according to the similarity between the question-answer search template and each question-answer candidate path.
Specifically, the overall similarity ranking is performed on the current question-answer retrieval template and each question-answer candidate path through a text similarity calculation method, a character string editing distance and other similarity calculation methods to obtain an optimal path result, and the optimal path result is determined as a target question-answer path.
The question answer determining module 150 is configured to generate a graph database query statement according to the target question-answer path, and perform a query in a target graph database corresponding to the target field according to the generated graph database query statement to obtain a question-answer result corresponding to the question-answer retrieval template.
In particular, graph database query statements refer to Cypher's graph query language. The question answer determining module 150 performs query in the target map database of the corresponding target field according to the map data query statement, and generates a returned question answer result statement according to the current question answer retrieval template and the question answer result obtained by the query.
Illustratively, based on the above-mentioned to-be-processed question, the target question-and-answer path "< core entity: yao Zhi > - < relationship: wife > - < query entity: the graph query language for conversion to Cypher is "MATCH (n: { type: person }) - [ r: wife ] - (m) return m.name".
Please refer to fig. 2, fig. 2 is a schematic structural diagram of a second knowledge-graph-based question-answering system according to an embodiment of the present application. As shown in fig. 2, the question-answering system 200 includes a candidate path generating module 260 in addition to the question parsing module 210, the question-answering retrieval template generating module 220, the candidate path acquiring module 230, the target path determining module 240, and the question answer determining module 250;
the candidate path generation module 260 is configured to determine a domain map of a target domain to which the problem to be processed belongs according to the core entity, and identify a first-degree relationship based on the core entity in the domain map; determining a multi-degree relation in the domain map from the domain map according to the first-degree relation; establishing a plurality of query paths based on the core entity based on the one-degree relation and the multi-degree relation so as to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; the query path comprises a query relationship path or a query attribute path.
Specifically, the question-answer candidate path refers to a multi-degree query relationship path (query type path) such as a one-degree, two-degree, three-degree, or a query attribute path.
Specifically, the first-degree relationship includes "< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result > "; the second degree relationship includes "< core entity: entity type > - < entity relationship: relationship type > - < entity relationship: relationship type > - < query entity: query entity type > "or < core entity: entity type > - < entity relationship: relationship type > - < entity attribute: attribute type > - < attribute value: attribute value result >; the three degree relationship includes "< core entity: entity type > - < entity relationship: relationship type > - < entity relationship: relationship type > - < entity relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < entity relationship: relationship type > - < entity relationship: relationship type > < entity attribute: attribute type > - < attribute value: attribute value result > ".
In the embodiment of the present application, as a preferred embodiment, the question-answering system 200 further includes a map definition module 270;
the map definition module 270 is configured to determine a preset map structure of a target field to which a problem to be processed belongs according to the core entity, and determine a domain map including an entity type, a relationship type, and/or an attribute type.
That is, the schema structure (schema) corresponds to a data model in a domain, including concept types that are meaningful in the domain and attributes of those types. The map structure of any one domain is mainly expressed by type and property.
For example, the following steps are carried out: if a person relationship atlas question is being answered, the neighborhood atlas structure requires us to define attributes of the person, where the attributes of the person may include the relationship of the person, e.g., brother, couple, colleague, etc.
In this embodiment of the present application, the target path determining module 240 further includes:
the similarity calculation unit is used for calculating the text similarity and the character string editing distance between the question retrieval template and each question and answer candidate path, and determining the similarity between the question retrieval template and each question and answer candidate path by using a first preset weight corresponding to the text similarity and a second preset weight corresponding to the character string editing distance; the sequencing unit is used for sequencing the determined similarity according to a descending order to obtain a similarity ranking; and the path determining unit is used for determining the question-answer candidate path corresponding to the first bit in the similarity ranking as the target question-answer path.
Specifically, the text similarity calculation method refers to a method for performing distance measurement by converting characters into high-dimensional semantic vectors. For example, wu song is coded into an array of 0.2,0.3 and 0.5, wu dalang is coded into an array of 0.3,0.2 and 0.6, cosine similarity between the two arrays is calculated, and the two arrays are used for replacing an original word to calculate a vector, namely a distance measure. Representative methods for measuring according to the distance include Word2vec, BERT model, and the like.
Specifically, the string edit distance refers to the minimum number of times required to modify a single character (e.g., modify, insert, delete) from one string to another, the comparison object being a word or word. The typical methods of the string edit distance include TF-IDF, one-hot (one-hot) and the like. For example, the string edit distance of wusong modified to wudalang is 2.
That is to say, a first preset weight corresponding to the text similarity and a second preset weight corresponding to the character string editing distance are set, and the selection result of the weight values is determined according to the training set; the similarity between the question retrieval template and each question and answer candidate path may be calculated by summing the product of the first preset weight and the text similarity with the product of the second preset weight and the character string edit distance, and taking the result of the summation as the similarity between the question retrieval template and each question and answer candidate path.
The first preset weight and the second preset weight are changed, and the first preset weight and the second preset weight which are optimal can be obtained through training. For example, when the sample size is small, which may easily cause an error in the result of the optimal first preset weight and the second preset weight during training, the first preset weight and the second preset weight of the second best may be selected according to the sequence of the training results.
Specifically, the question parsing module 210 is further configured to determine an entity type of the core entity, where the question is intended to include a query relationship type, and the question-answer retrieval template is as follows:
< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type >;
the relation type is determined by performing semantic recognition on the problem to be processed, and the query entity type is a question and answer result of the problem to be processed;
and/or, the question-sentence intent includes query entity attributes, and the question-answer retrieval template is as follows:
< core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >;
the attribute type is determined by performing semantic recognition on the problem to be processed, and the attribute value result is a question and answer result of the problem to be processed.
Specifically, the first-degree relationship is used to represent a relationship type of the core entity, or an entity attribute directly corresponding to the core entity; the multi-degree relationship is used for representing at least two relationship types of the core entity or entity attributes under at least one relationship type of the core entity.
That is, the first degree relationship is "< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result > "; the multi-degree relationship is "< core entity: entity type > - < entity relationship: relationship type > - … - < entity relationship: relationship type > - < query entity: query entity type > "or" < core entity: entity type > - < entity relationship: relationship type > - … - < entity attribute: attribute type > - < attribute value: attribute value result > ".
For example, please refer to fig. 3, fig. 3 is a schematic structural diagram of a third knowledge-graph-based question-answering system according to an embodiment of the present application. As shown in fig. 3:
first, the problem analysis module 310 receives the pending problem "who is a wife of yao? ", the question parsing module 310 sends the question to the intent recognition module 311 and the entity recognition module 312, the intent recognition module 311 recognizes the question intent of the question to be processed: inquiring about the wife who yao, the entity identification module 312 identifies the core entity of the problem to be treated: yao Yi (some of Yao); the intention identifying module 311 and the entity identifying module 312 send the identified question and sentence intentions and core entities to the question parsing module 310, the question parsing module 310 sends the question and sentence intentions and core entities to the question and answer retrieval template generating module 320, and the question and answer retrieval template generating module 320 generates a corresponding question and answer retrieval template according to the embodiment: "< core entity: yao Zhi > - < entity relationship: wife > - < query entity: character > ".
Next, the domain map Schema definition module 330 determines, according to the domain to which the to-be-processed problem belongs, a Schema structure of the domain through the Schema structure, further defines the domain map Schema structure of the to-be-processed problem, and sends the domain map Schema to the domain map Schema analysis module 340. The domain map Schema analyzing module 340 analyzes and converts the map structure according to the well-defined domain map Schema structure to generate all the first-degree relations in the map, that is, < core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type > or < core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >.
Then, the domain map Schema analysis module 340 sends all the first-degree relations in the analyzed map structure to the question-answer candidate path generation module 350, and the question-answer candidate path generation module 350 constructs all possible question-answer candidate paths by taking the core entity as the center according to the analyzed map structure, and generates a first-degree, second-degree, third-degree and other multi-degree query relation path or query attribute value path. The question-answer candidate path generation module 350 generates a first degree relationship according to the embodiment, such as "who is wife of yao? "the corresponding one-degree relationship is < core entity: yao Zhi > - < entity relationship: wife > - < query entity: character >; "is the mom of a daughter who yao? The corresponding two-degree relation is as follows: "< core entity: yao Zhi > - < entity relationship: daughter > - < entity relationship: mother > - < query entity: character > "; who is the old and the public of the sister of the employee B of company A? "the corresponding three-degree relationship is: "< core entity: company a > - < entity relationship: b employee > - < entity relationship: sister > - < entity relationship: disclosure > - < query entity: character > ".
Next, the question-answer retrieval template and question-answer candidate path similarity calculation module 360 performs similarity calculation on the question retrieval template and all the question-answer candidate paths through a text similarity calculation method, a character string editing distance and other similarity calculation methods, sorts the similarity calculation results to obtain an optimal path result, takes the optimal path result as a target question-answer path, and sends the target question-answer path to the target question-answer path-to-graph query language conversion module 370.
Next, the target question-answering path-to-graph query language conversion module 370 generates a corresponding graph query language for the target question-answering path. That is, the target question-and-answer path "< core entity: yao Zhi > - < entity relationship: wife > - < query entity: the graph query language corresponding to the person > "converted into Cypher is" MATCH (n: { type: person }) - [ r: wife ] - (m) return m. name ", and the graph query language is sent to the graph query language query module 380.
Finally, the graph query language query module 380 queries in the graph database according to the graph query language, and sends the queried question and answer result to the question answer determination module 390, and the question answer determination module 390 generates a returned question and answer result sentence according to the question and answer retrieval template and the queried question and answer result: "the wife of Yao-a is leaf-a (i.e. question and answer result: leaf-a)".
The question-answering system based on the knowledge graph determines a target question-answering path with the maximum similarity by identifying question and sentence intentions and core entities of the problems to be processed, and then obtains the question-answering result of the corresponding problems to be processed by inquiring in a target graph database, so that the problem that how to enable inherent knowledge in different fields to use the universal knowledge graph is solved, and the technical effect of improving the adaptability of the knowledge graph is achieved.
Based on the same inventive concept, the embodiment of the application also provides a question-answering method corresponding to the question-answering system based on the knowledge graph, and as the question-answering principle of the question-answering method in the embodiment of the application is similar to that of the question-answering system in the embodiment of the application, the implementation of the method can be referred to the implementation of the system, and repeated parts are not repeated.
Referring to fig. 4, fig. 4 is a flowchart of a knowledge-graph-based question answering method according to an embodiment of the present application. As shown in fig. 4, the question answering method includes:
s410, identifying question intentions and core entities of the problems to be processed;
s420, generating a question and answer retrieval template according to the identified question and sentence intention and the core entity;
s430, determining a target field to which the to-be-processed question belongs according to the core entity, and acquiring a plurality of question and answer candidate paths in the target field, wherein the plurality of question and answer candidate paths are query paths generated based on a first-degree relation in a field map of the target field;
s440, selecting a target question and answer path from the question and answer candidate paths according to the similarity between the question and answer retrieval template and each question and answer candidate path;
s450, generating a graph database query sentence according to the target question and answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence to obtain a question and answer result corresponding to the question and answer retrieval template.
Optionally, the question answering method further includes:
step 431, determining a domain map of a target domain to which the problem to be processed belongs according to the core entity, and identifying a first-degree relation based on the core entity in the domain map;
step 432, determining a multi-degree relation in the domain map from the domain map according to the one-degree relation;
step 433, based on the one-degree relation and the multi-degree relation, creating a plurality of query paths based on the core entity to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; the query path comprises a query relationship path or a query attribute path.
Optionally, before step 431, the question answering method further includes:
and determining a preset map structure of a target field to which the problem to be processed belongs according to the core entity, and determining a field map containing an entity type, a relation type and/or an attribute type.
Optionally, step S440 specifically includes:
calculating text similarity and character string editing distance between the question retrieval template and each question and answer candidate path, and determining the similarity between the question retrieval template and each question and answer candidate path by using a first preset weight corresponding to the text similarity and a second preset weight corresponding to the character string editing distance;
the sequencing unit is used for sequencing the determined similarity according to a descending order to obtain a similarity ranking;
and the path determining unit is used for determining the question-answer candidate path corresponding to the first bit in the similarity ranking as the target question-answer path.
Optionally, step S410 further includes: determining an entity type of a core entity;
wherein, the question and answer intention comprises a query relation type, and the question and answer retrieval template is as follows:
< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type >;
the relation type is determined by performing semantic recognition on the problem to be processed, and the query entity type is a question and answer result of the problem to be processed;
and/or, the question and answer intention comprises a query attribute type, and the question and answer retrieval template is as follows:
< core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >;
the attribute type is determined by performing semantic recognition on the problem to be processed, and the attribute value result is a question and answer result of the problem to be processed.
According to the question-answering method based on the knowledge graph, the question-answering route with the maximum similarity is determined by identifying the question intention and the core entity of the problem to be processed, and then the question-answering result of the corresponding problem to be processed is obtained by inquiring in the target graph database, so that the problem that how to enable the inherent knowledge in different fields to use the universal knowledge graph is solved, and the technical effect of improving the adaptability of the knowledge graph is achieved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
The memory 520 stores machine-readable instructions executable by the processor 510, when the electronic device 500 runs, the processor 510 communicates with the memory 520 through the bus 530, and when the machine-readable instructions are executed by the processor 510, the steps of the knowledge-graph-based question answering method in the embodiment of the method shown in fig. 4 can be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the knowledge-graph-based question-answering method in the method embodiment shown in fig. 4 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of one logic function, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the technical solutions of the present application, and the scope of the present application is not limited thereto, although the present application is described in detail with reference to the foregoing examples, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A knowledge-graph-based question-answering system, comprising:
the question analysis module is used for identifying question intentions and core entities of the questions to be processed;
the question-answer retrieval template generating module is used for generating a question-answer retrieval template according to the identified question and sentence intention and the core entity;
a candidate path obtaining module, configured to determine, according to the core entity, a target field to which the to-be-processed question belongs, and obtain multiple question and answer candidate paths in the target field, where the multiple question and answer candidate paths are query paths generated based on a one-degree relationship in a domain graph of the target field;
the target path determining module is used for selecting a target question-answer path from the question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path;
and the question answer determining module is used for generating a graph database query sentence according to the target question-answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence so as to obtain a question-answer result corresponding to the question-answer retrieval template.
2. The question-answering system according to claim 1, characterized in that it further comprises a candidate path generation module for:
determining a domain map of a target domain to which the problem to be processed belongs according to the core entity, and identifying a first-degree relation based on the core entity in the domain map;
determining a multi-degree relation in the domain map from the domain map according to the one-degree relation;
establishing a plurality of query paths based on the core entity based on the first-degree relation and the multi-degree relation so as to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; wherein the query path comprises a query relationship path or a query attribute path.
3. The question-answering system according to claim 2, characterized in that the question-answering system further comprises:
and the map definition module is used for determining a preset map structure of a target field to which the problem to be processed belongs according to the core entity and determining a field map containing an entity type, a relation type and/or an attribute type.
4. The question-answering system according to claim 1, characterized in that the target path determination module comprises:
the similarity calculation unit is used for calculating the text similarity and the character string editing distance between the question retrieval template and each question and answer candidate path, and determining the similarity between the question retrieval template and each question and answer candidate path by using a first preset weight corresponding to the text similarity and a second preset weight corresponding to the character string editing distance;
the sequencing unit is used for sequencing the determined similarity according to a descending order to obtain a similarity ranking;
and the path determining unit is used for determining the question-answer candidate path corresponding to the first bit in the similarity ranking as a target question-answer path.
5. The question-answering system according to claim 1, wherein the question parsing module is further configured to determine an entity type of the core entity;
wherein, the question and answer intention comprises a query relation type, and the question and answer retrieval template is as follows:
< core entity: entity type > - < entity relationship: relationship type > - < query entity: query entity type >;
the relation type is determined by performing semantic recognition on the problem to be processed, and the query entity type is a question and answer result of the problem to be processed;
and/or the question and answer intention comprises a query attribute type, and the question and answer retrieval template comprises the following steps:
< core entity: entity type > - < entity attribute: attribute type > - < attribute value: attribute value result >;
the attribute type is determined by performing semantic recognition on the problem to be processed, and the attribute value result is a question and answer result of the problem to be processed.
6. The question-answering system according to claim 2, wherein the one-degree relationship is used for representing an entity relationship the core entity has or an entity attribute of the core entity; the multi-degree relationship is used for representing at least two entity relationships which the core entity has or entity attributes of the core entity under the condition of having at least one entity relationship.
7. A question-answering method based on a knowledge graph is characterized by comprising the following steps:
identifying a question intention and a core entity of a problem to be processed;
generating a question-answer retrieval template according to the identified question-sentence intentions and the core entity;
determining a target field to which the to-be-processed question belongs according to the core entity, and acquiring a plurality of question and answer candidate paths in the target field, wherein the plurality of question and answer candidate paths are query paths generated based on a one-degree relationship in a domain map of the target field;
selecting a target question-answer path from the question-answer candidate paths according to the similarity between the question-answer retrieval template and each question-answer candidate path;
and generating a graph database query sentence according to the target question and answer path, and querying in a target graph database corresponding to the target field according to the generated graph database query sentence to obtain a question and answer result corresponding to the question and answer retrieval template.
8. The question-answering method according to claim 7, characterized by further comprising:
determining a domain map of a target domain to which the problem to be processed belongs according to the core entity, and identifying a first-degree relation based on the core entity in the domain map;
determining a multi-degree relation in the domain map from the domain map according to the one-degree relation;
establishing a plurality of query paths based on the core entity based on the first-degree relation and the multi-degree relation so as to obtain a plurality of question-answer candidate paths corresponding to the domain map of the target domain; wherein the query path comprises a query relationship path or a query attribute path.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the question answering method according to any one of claims 7 or 8.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the question-answering method according to any one of claims 7 or 8.
CN202111019634.8A 2021-09-01 2021-09-01 Knowledge graph-based question-answering system and method, electronic equipment and storage medium Pending CN113641813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111019634.8A CN113641813A (en) 2021-09-01 2021-09-01 Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111019634.8A CN113641813A (en) 2021-09-01 2021-09-01 Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113641813A true CN113641813A (en) 2021-11-12

Family

ID=78424739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111019634.8A Pending CN113641813A (en) 2021-09-01 2021-09-01 Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113641813A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023143640A1 (en) * 2022-01-29 2023-08-03 浙江口碑网络技术有限公司 Query understanding method and apparatus for search intention, and storage medium and electronic device
CN117271754A (en) * 2023-11-17 2023-12-22 杭州海康威视数字技术股份有限公司 Data retrieval method, device and equipment
CN117725188A (en) * 2024-02-08 2024-03-19 亚信科技(中国)有限公司 Question and answer method and device based on artificial intelligence, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023143640A1 (en) * 2022-01-29 2023-08-03 浙江口碑网络技术有限公司 Query understanding method and apparatus for search intention, and storage medium and electronic device
CN117271754A (en) * 2023-11-17 2023-12-22 杭州海康威视数字技术股份有限公司 Data retrieval method, device and equipment
CN117725188A (en) * 2024-02-08 2024-03-19 亚信科技(中国)有限公司 Question and answer method and device based on artificial intelligence, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111506721B (en) Question-answering system and construction method for domain knowledge graph
CN108804641B (en) Text similarity calculation method, device, equipment and storage medium
CN113641813A (en) Knowledge graph-based question-answering system and method, electronic equipment and storage medium
CN104636478B (en) Information query method and equipment
CN112667794A (en) Intelligent question-answer matching method and system based on twin network BERT model
CN111078837B (en) Intelligent question-answering information processing method, electronic equipment and computer readable storage medium
JP2020500371A (en) Apparatus and method for semantic search
CN112035599B (en) Query method and device based on vertical search, computer equipment and storage medium
CN111274267A (en) Database query method and device and computer readable storage medium
CN108664509B (en) Method, device and server for ad hoc query
Gonçalves et al. Aligning biomedical metadata with ontologies using clustering and embeddings
CN115658846A (en) Intelligent search method and device suitable for open-source software supply chain
KR20120047622A (en) System and method for managing digital contents
Korobkin et al. Methods for extracting the descriptions of sci-tech effects and morphological features of technical systems from patents
CN113157887A (en) Knowledge question-answering intention identification method and device and computer equipment
CN117076636A (en) Information query method, system and equipment for intelligent customer service
CN111831624A (en) Data table creating method and device, computer equipment and storage medium
Liu et al. Extracting biomedical events from pairs of text entities
CN115982322A (en) Water conservancy industry design field knowledge graph retrieval method and retrieval system
CN115203206A (en) Data content searching method and device, computer equipment and readable storage medium
CN114780589A (en) Multi-table connection query method, device, equipment and storage medium
CN110909532B (en) User name matching method and device, computer equipment and storage medium
CN114238595A (en) Metallurgical knowledge question-answering method and system based on knowledge graph
KR102130779B1 (en) System of providing documents for machine reading comprehension and question answering system including the same
Cerón-Figueroa et al. Instance-based ontology matching for open and distance learning materials

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right

Effective date of registration: 20211105

Address after: 100000 a111, 1f, building 3, No. 1, zone 1, Lize Zhongyuan, Wangjing emerging industrial zone, Chaoyang District, Beijing

Applicant after: MIAOZHEN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Floor 29, 30, 31, 32, No. 701, Yunjin Road, Xuhui District, Shanghai, 200030

Applicant before: Shanghai minglue artificial intelligence (Group) Co.,Ltd.

TA01 Transfer of patent application right
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination