Movatterモバイル変換


[0]ホーム

URL:


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
CN113641813ACN202111019634.8ACN202111019634ACN113641813ACN 113641813 ACN113641813 ACN 113641813ACN 202111019634 ACN202111019634 ACN 202111019634ACN 113641813 ACN113641813 ACN 113641813A
Authority
CN
China
Prior art keywords
question
answer
entity
path
query
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 LtdfiledCriticalShanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202111019634.8ApriorityCriticalpatent/CN113641813A/en
Publication of CN113641813ApublicationCriticalpatent/CN113641813A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请提供了一种基于知识图谱的问答系统、方法、电子设备及存储介质,其中,该问答系统包括:问题解析模块,用于识别待处理问题的问句意图和核心实体;问答检索模板生成模块,用于根据识别的问句意图和核心实体,生成问答检索模板;候选路径获取模块,用于根据核心实体确定待处理问题所属目标领域,并获取目标领域下的多个问答候选路径;目标路径确定模块,用于根据问答检索模板与每个问答候选路径之间的相似度,从多个问答候选路径中选出目标问答路径;问题答案确定模块,用于根据目标问答路径生成图数据库查询语句,并依据所生成的图数据库查询语句在与目标领域对应的目标图数据库中进行查询,以获得与问答检索模板对应的问答结果。

Figure 202111019634

The application provides a question answering system, method, electronic device and storage medium based on knowledge graph, wherein the question answering system includes: a question parsing module for identifying question intent and core entities of the question to be processed; generating a question and answer retrieval template The module is used to generate a question-and-answer retrieval template according to the identified question intent and core entities; the candidate path acquisition module is used to determine the target domain of the question to be processed according to the core entity, and obtain multiple question-and-answer candidate paths in the target domain; the target The path determination module is used to select the target Q&A path from multiple Q&A candidate paths according to the similarity between the Q&A retrieval template and each Q&A candidate path; the question answer determination module is used to generate a graph database query according to the target Q&A path and query in the target graph database corresponding to the target domain according to the generated graph database query sentence, so as to obtain the question and answer result corresponding to the question and answer retrieval template.

Figure 202111019634

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:
thequestion 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 retrievaltemplate 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 candidatepath 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 targetpath 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 determiningmodule 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 determiningmodule 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-answeringsystem 200 includes a candidatepath generating module 260 in addition to thequestion parsing module 210, the question-answering retrievaltemplate generating module 220, the candidatepath acquiring module 230, the targetpath determining module 240, and the questionanswer determining module 250;
the candidatepath 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-answeringsystem 200 further includes amap definition module 270;
themap 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 targetpath 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, thequestion 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, theproblem analysis module 310 receives the pending problem "who is a wife of yao? ", thequestion parsing module 310 sends the question to theintent recognition module 311 and theentity recognition module 312, theintent recognition module 311 recognizes the question intent of the question to be processed: inquiring about the wife who yao, theentity identification module 312 identifies the core entity of the problem to be treated: yao Yi (some of Yao); theintention identifying module 311 and theentity identifying module 312 send the identified question and sentence intentions and core entities to thequestion parsing module 310, thequestion parsing module 310 sends the question and sentence intentions and core entities to the question and answer retrievaltemplate generating module 320, and the question and answer retrievaltemplate 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 mapSchema 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 mapSchema analysis module 340. The domain mapSchema 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 mapSchema analysis module 340 sends all the first-degree relations in the analyzed map structure to the question-answer candidatepath generation module 350, and the question-answer candidatepath 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 candidatepath 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 pathsimilarity 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 querylanguage conversion module 370.
Next, the target question-answering path-to-graph querylanguage 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 querylanguage query module 380.
Finally, the graph querylanguage query module 380 queries in the graph database according to the graph query language, and sends the queried question and answer result to the questionanswer determination module 390, and the questionanswer 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 aprocessor 510, amemory 520, and a bus 530.
Thememory 520 stores machine-readable instructions executable by theprocessor 510, when the electronic device 500 runs, theprocessor 510 communicates with thememory 520 through the bus 530, and when the machine-readable instructions are executed by theprocessor 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.8A2021-09-012021-09-01Knowledge graph-based question-answering system and method, electronic equipment and storage mediumPendingCN113641813A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111019634.8ACN113641813A (en)2021-09-012021-09-01Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111019634.8ACN113641813A (en)2021-09-012021-09-01Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Publications (1)

Publication NumberPublication Date
CN113641813Atrue CN113641813A (en)2021-11-12

Family

ID=78424739

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111019634.8APendingCN113641813A (en)2021-09-012021-09-01Knowledge graph-based question-answering system and method, electronic equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN113641813A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114238592A (en)*2021-11-152022-03-25国家电网有限公司客户服务中心Deep question-answering system and method based on template
CN114490978A (en)*2022-01-192022-05-13Oppo广东移动通信有限公司 Knowledge base question and answer method, device, electronic device and storage medium
CN114756663A (en)*2022-03-292022-07-15税友信息技术有限公司 A kind of intelligent question answering method, system, device and computer readable storage medium
CN115329137A (en)*2022-04-282022-11-11浙江工业大学Graph database query statement construction method based on natural language semantic conversion
CN115408503A (en)*2022-07-262022-11-29北京明略昭辉科技有限公司Map retrieval method and device, electronic equipment and storage medium
WO2023143640A1 (en)*2022-01-292023-08-03浙江口碑网络技术有限公司Query understanding method and apparatus for search intention, and storage medium and electronic device
CN116578723A (en)*2023-05-262023-08-11中国工商银行股份有限公司 Information query method, device, processor and electronic equipment
CN117271754A (en)*2023-11-172023-12-22杭州海康威视数字技术股份有限公司Data retrieval method, device and equipment
CN117725188A (en)*2024-02-082024-03-19亚信科技(中国)有限公司 Question-and-answer methods, devices, electronic equipment and storage media based on artificial intelligence

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110837550A (en)*2019-11-112020-02-25中山大学Knowledge graph-based question and answer method and device, electronic equipment and storage medium
CN111400480A (en)*2020-04-212020-07-10支付宝(杭州)信息技术有限公司User intention recognition method and device for multi-turn conversation
CN111414465A (en)*2020-03-162020-07-14北京明略软件系统有限公司 Processing method and device in question answering system based on knowledge graph
CN112650840A (en)*2020-12-042021-04-13天津泰凡科技有限公司Intelligent medical question-answering processing method and system based on knowledge graph reasoning

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110837550A (en)*2019-11-112020-02-25中山大学Knowledge graph-based question and answer method and device, electronic equipment and storage medium
CN111414465A (en)*2020-03-162020-07-14北京明略软件系统有限公司 Processing method and device in question answering system based on knowledge graph
CN111400480A (en)*2020-04-212020-07-10支付宝(杭州)信息技术有限公司User intention recognition method and device for multi-turn conversation
CN112650840A (en)*2020-12-042021-04-13天津泰凡科技有限公司Intelligent medical question-answering processing method and system based on knowledge graph reasoning

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114238592A (en)*2021-11-152022-03-25国家电网有限公司客户服务中心Deep question-answering system and method based on template
CN114490978A (en)*2022-01-192022-05-13Oppo广东移动通信有限公司 Knowledge base question and answer method, device, electronic device and storage medium
WO2023143640A1 (en)*2022-01-292023-08-03浙江口碑网络技术有限公司Query understanding method and apparatus for search intention, and storage medium and electronic device
CN114756663A (en)*2022-03-292022-07-15税友信息技术有限公司 A kind of intelligent question answering method, system, device and computer readable storage medium
CN115329137A (en)*2022-04-282022-11-11浙江工业大学Graph database query statement construction method based on natural language semantic conversion
CN115408503A (en)*2022-07-262022-11-29北京明略昭辉科技有限公司Map retrieval method and device, electronic equipment and storage medium
CN116578723A (en)*2023-05-262023-08-11中国工商银行股份有限公司 Information query method, device, processor and electronic equipment
CN117271754A (en)*2023-11-172023-12-22杭州海康威视数字技术股份有限公司Data retrieval method, device and equipment
CN117271754B (en)*2023-11-172024-06-04杭州海康威视数字技术股份有限公司Data retrieval method, device and equipment
CN117725188A (en)*2024-02-082024-03-19亚信科技(中国)有限公司 Question-and-answer methods, devices, electronic equipment and storage media based on artificial intelligence

Similar Documents

PublicationPublication DateTitle
CN113641813A (en)Knowledge graph-based question-answering system and method, electronic equipment and storage medium
CN109886294B (en)Knowledge fusion method, apparatus, computer device and storage medium
CN111078837B (en)Intelligent question-answering information processing method, electronic equipment and computer readable storage medium
CN111506721B (en) A question answering system and construction method for domain knowledge graph
JP2020500371A (en) Apparatus and method for semantic search
CN111274267A (en)Database query method and device and computer readable storage medium
CN113157887B (en)Knowledge question and answer intention recognition method and device and computer equipment
JP2019040598A5 (en)
Gonçalves et al.Aligning biomedical metadata with ontologies using clustering and embeddings
CN119377371A (en) A method, system, device and medium for intelligent question answering based on large model
CN117076636A (en)Information query method, system and equipment for intelligent customer service
CN118656385B (en) A data query method based on large model
Sundaram et al.Making metadata more FAIR using large language models
CN118964376A (en) Data query method, system, control device and storage medium
CN119025552A (en) A natural language intelligent number asking method, device and storage medium
CN117150046B (en)Automatic task decomposition method and system based on context semantics
CN118228824A (en)Knowledge question-answering method, knowledge question-answering device, electronic equipment and storage medium
CN120104762B (en)Database query method, device and equipment based on large model retrieval enhancement generation
CN114090721B (en) Method and device for query and data update based on natural language data
KR102834704B1 (en)Method and system for searching similar precedents using a deep learning language model with dual encoders
CN120011548A (en) TextureSql method, device and storage medium based on large model
ZhangApplication of a Large Language Model Incorporating Semantic Information of Data in the SQL Generation Task
Hartmann et al.Directing the development of constraint languages by checking constraints on rdf data
姜逸越 et al.Query by Dataset Based on Instance Similarities Generated by Sentence Embeddings
CN119669412A (en) A metadata-based question-answering method and related device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
TA01Transfer of patent application right
TA01Transfer 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.

SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp