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.
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.