CN115658910A - Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium - Google Patents

Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115658910A
CN115658910A CN202211074171.XA CN202211074171A CN115658910A CN 115658910 A CN115658910 A CN 115658910A CN 202211074171 A CN202211074171 A CN 202211074171A CN 115658910 A CN115658910 A CN 115658910A
Authority
CN
China
Prior art keywords
entity
abstract
tail
original
relation
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
CN202211074171.XA
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.)
Tianjin Zhongke Intelligent Identification Co ltd
Institute of Automation of Chinese Academy of Science
Original Assignee
Tianjin Zhongke Intelligent Identification Co ltd
Institute of Automation of Chinese Academy of Science
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 Tianjin Zhongke Intelligent Identification Co ltd, Institute of Automation of Chinese Academy of Science filed Critical Tianjin Zhongke Intelligent Identification Co ltd
Priority to CN202211074171.XA priority Critical patent/CN115658910A/en
Publication of CN115658910A publication Critical patent/CN115658910A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a knowledge question-answering method, a knowledge question-answering device, electronic equipment and a readable storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: constructing an abstract knowledge map based on the original knowledge map, wherein the abstract knowledge map is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity; obtaining a sentence to be queried, wherein the sentence to be queried consists of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined; determining at least one entity relation chain meeting the target association relation based on the statement to be queried and the abstract knowledge map; the method comprises the steps of determining at least one alternative tail entity based on an original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to a sentence to be queried based on the at least one alternative tail entity, so that the defect of low knowledge question-answering efficiency in the prior art is overcome.

Description

Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a knowledge question answering method, a knowledge question answering device, electronic equipment and a readable storage medium.
Background
The trade knowledge map is widely applied to the financial trade analysis field and used for storing rich trade industry knowledge and supporting semantic understanding and knowledge search in the trade field, hidden deep-layer trade knowledge can be found through the trade knowledge map, deep contact among enterprises can be found, trade opportunities can be sought and trade risks can be predicted in advance, rich knowledge support can be provided for trade decision making, and therefore economic benefits of trade enterprises can be improved.
In the prior art, a symbol-based logical reasoning method is adopted to acquire required trade knowledge, however, the complexity of the reasoning method exponentially increases along with the scale of the trade knowledge map, so that the problem of low efficiency of the question-answering of the trade knowledge is caused.
Disclosure of Invention
The invention provides a knowledge question-answering method, a knowledge question-answering device, electronic equipment and a readable storage medium, which are used for overcoming the defect of low knowledge question-answering efficiency in the prior art.
The invention provides a knowledge question-answering method, which comprises the following steps:
constructing an abstract knowledge graph based on an original knowledge graph, wherein the abstract knowledge graph is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity;
obtaining a statement to be queried, wherein the statement to be queried is composed of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined;
determining at least one entity relation chain meeting the target relation based on the statement to be queried and the abstract knowledge map;
and determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
According to the knowledge question-answering method provided by the invention, the abstract knowledge map is constructed based on the original knowledge map, and the method comprises the following steps:
acquiring each original entity group in the original knowledge graph, wherein the original entity group comprises an original head entity, an original tail entity and an incidence relation between the original head entity and the original tail entity;
for each original entity group, defining an abstract tail entity corresponding to an original tail entity based on an original head entity and an incidence relation in the original entity group;
and replacing each original tail entity in the plurality of original entity groups with the corresponding abstract tail entity to form a plurality of abstract entity groups, and constructing an abstract knowledge graph based on the plurality of abstract entity groups.
According to the knowledge question answering method provided by the invention, the step of determining at least one entity relation chain meeting the target relation based on the statement to be queried and the abstract knowledge map comprises the following steps:
based on the abstract knowledge map and the statement to be queried, obtaining a shortest path meeting the target association relation to obtain at least one shortest path, wherein an initial node of the shortest path is a node corresponding to the preset head entity;
and aiming at each shortest path, sequentially acquiring the sub-incidence relation between two adjacent nodes in the shortest path to obtain a plurality of sequentially arranged sub-incidence relations, and forming an entity relation chain corresponding to the shortest path based on the plurality of sequentially arranged sub-incidence relations.
According to the knowledge question-answering method provided by the invention, the method further comprises the following steps:
aiming at any two adjacent sub-incidence relations in the entity relation chain, judging whether the two adjacent sub-incidence relations form a reciprocal incidence relation group;
and deleting the two adjacent sub-incidence relations from the entity relation chain under the condition that the two adjacent sub-incidence relations form a reciprocal incidence relation group.
According to the knowledge question answering method provided by the invention, the method for determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain and determining the target tail entity corresponding to the sentence to be inquired based on the at least one alternative tail entity comprises the following steps:
for each entity relationship chain, determining a tail entity corresponding to the entity relationship chain from the original knowledge graph, and determining the tail entity as an alternative tail entity;
and acquiring a first weight of each alternative tail entity, and determining the alternative tail entity with the highest first weight as a target tail entity corresponding to the statement to be queried.
According to the knowledge question answering method provided by the invention, the acquiring of the first weight of each alternative tail entity comprises the following steps:
aiming at each alternative tail entity, acquiring a second weight corresponding to each entity relation chain to which the alternative tail entity belongs;
for each entity relation chain to which the alternative tail entity belongs, acquiring a weight product term corresponding to the entity relation chain based on the third weight of each intermediate entity in the entity relation chain and the corresponding second weight;
and overlapping the weight product terms corresponding to each entity relationship chain to which the alternative tail entity belongs to obtain a first weight of the alternative tail entity.
The invention also provides a trade knowledge inference device, comprising:
the map construction module is used for constructing an abstract knowledge map based on the original knowledge map, and the abstract knowledge map comprises an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity;
the system comprises a data acquisition module, a query processing module and a query processing module, wherein the data acquisition module is used for acquiring a statement to be queried, the statement to be queried consists of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined;
a relation chain determining module, configured to determine at least one entity relation chain that satisfies the target association relation based on the statement to be queried and the abstract knowledge graph;
and the entity determining module is used for determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor implements the question-answering method as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of question answering as in any one of the above.
The present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the method of question and answer knowledge as described in any one of the above.
According to the knowledge question answering method, the knowledge question answering device, the electronic equipment and the readable storage medium, the plurality of entities with similar semantics in the original knowledge map are abstracted into the same concept to construct the abstract knowledge map, so that the complexity of the knowledge map is reduced while most of semantic information in the original knowledge map is kept, the entity relation chain meeting the conditions can be rapidly determined based on the abstracted knowledge map, the target tail entity corresponding to the statement to be inquired is rapidly determined based on the obtained entity relation chain and the original knowledge map, the defect of low knowledge question answering efficiency in the prior art is overcome, and the knowledge question answering efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 2 is a second schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 3 is a third flowchart illustrating a knowledge question answering method according to an embodiment of the present invention;
FIG. 4 is a fourth flowchart illustrating a knowledge question answering method according to an embodiment of the present invention;
FIG. 5 is a fifth flowchart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 6 is a sixth schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a knowledge question answering apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The knowledge question answering method of the present invention is described below with reference to fig. 1-6. As shown in fig. 1, the present invention provides a knowledge question answering method, comprising:
step S1, constructing an abstract knowledge graph based on the original knowledge graph, wherein the abstract knowledge graph is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity.
The original knowledge graph is composed of an original head entity h, an original tail entity t and an incidence relation r between the original head entity and the original tail entity. The abstract tail entity is determined based on the original head entity h and the incidence relation r, and therefore, the abstract tail entity can be expressed as h r
It should be noted that the original head entity h and the original tail entity t both represent a concrete thing in the real world, and the abstract tail entity h r It is an abstract representation of a plurality of original tail entities t with similar semantics, i.e. an abstract tail entity h r Corresponding to one or more original tail entities t with similar semantics.
And S2, obtaining a sentence to be inquired, wherein the sentence to be inquired is composed of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined.
The statement to be queried may be represented as (h 1, r1, t 1), where h1 represents a preset head entity, r1 represents a target association relationship, and t1 represents a target tail entity to be determined, that is, the preset head entity h1 and the target association relationship r1 are known, and the target tail entity is unknown.
And S3, determining at least one entity relation chain meeting the target relation based on the statement to be queried and the abstract knowledge map.
The entity relation chain is a relation chain formed by a plurality of sequentially arranged sub-association relations. The sub-incidence relation represents the incidence relation between entities corresponding to two adjacent nodes. The two adjacent nodes are any two adjacent nodes in a node interval determined based on a head node corresponding to a preset head entity and a tail node corresponding to a target tail entity, and the node interval is a closed interval. The sub-incidence relations comprise incidence relations between a preset head entity and an intermediate entity, between two intermediate entities and between the intermediate entity and a target tail entity, and the intermediate entity is determined based on the target incidence relation.
And S4, determining at least one alternative tail entity based on the original knowledge graph and the at least one entity relation chain, and determining a target tail entity corresponding to the sentence to be queried based on the at least one alternative tail entity.
In the steps S1 to S4, the plurality of entities having similar semantics in the original knowledge graph are abstracted to the same concept to construct the abstract knowledge graph, so that the complexity of the knowledge graph is reduced while most of semantic information in the original knowledge graph is retained, and thus the entity relation chain satisfying the condition can be quickly determined based on the abstracted knowledge graph, and further the target tail entity corresponding to the statement to be queried can be quickly determined based on the obtained entity relation chain and the original knowledge graph, thereby solving the defect of low knowledge question-answering efficiency in the prior art and improving the knowledge question-answering efficiency.
Further, the incidence relation in the original knowledge graph can be obtained through expert labeling or text extraction and the like.
Further, the original knowledgegraph is an original trade knowledgegraph, and an entity in the original trade knowledgegraph may be a company, an employee, or an industry. The association relationship between the entities may be a competitive relationship or a cooperative relationship between companies or a leadership relationship between employees and employees.
In one embodiment, as shown in fig. 2, the step S1 includes steps S11 to S13, wherein:
step S11, each original entity group in the original knowledge graph is obtained, wherein the original entity group comprises an original head entity, an original tail entity and an incidence relation between the original head entity and the original tail entity.
The original entity group is a ternary array and can be represented as (h, r, t), h represents an original head entity, t represents an original tail entity, and r represents an incidence relation between the original head entity and the original tail entity. The original head entity h and the original tail entity t are respectively a head node and a tail node in the original knowledge graph, and the incidence relation r is an edge in the original knowledge graph.
And S12, aiming at each original entity group, defining an abstract tail entity corresponding to the original tail entity based on the original head entity and the incidence relation in the original entity group.
Specifically, a plurality of original tail entities t having the same incidence relation r with the original head entity h in the original knowledge graph are regarded as having the same or similar semantics, and the plurality of original tail entities t are mapped to an abstract concept node, that is, the abstract tail entity h is the abstract tail entity r
Further, a plurality of original tail entities t and an abstract tail entity h can be combined r The mapping relation between the two is stored in a predefined mapping dictionary or other memories so as to be convenient to search in the subsequent use.
And S13, replacing each original tail entity in the plurality of original entity groups with a corresponding abstract tail entity to form a plurality of abstract entity groups, and constructing an abstract knowledge graph based on the plurality of abstract entity groups.
Wherein the abstract entity group is a ternary array, which can be expressed as (h ', r, h' r ) And h 'represents an abstract header entity, h' r And r represents the incidence relation between the abstract head entity and the abstract tail entity.
Specifically, abstract head entity h ' is taken as a head node, and abstract tail entity h ' is taken as an abstract tail entity h ' r Constructing a knowledge graph for the tail nodes and the association relation r as the edge, wherein the edge corresponding to the association relation r is used for enabling the head nodes corresponding to the abstract head entity h 'and the abstract tail entity h' r The corresponding tail nodes are connected.
It should be noted that although only the abstract tail entity corresponding to the original tail entity in each original entity group is defined, in the original knowledge graph, the tail entity of the original entity group a may also be the head entity of the original entity group b, so that the abstract entity corresponding to each original entity in the original knowledge graph can be finally obtained, and each original entity in the original knowledge graph is replaced by the corresponding abstract entity, so that the replaced abstract knowledge graph can be obtained.
In the steps S11 to S13, the multiple original entities having the same association relationship are mapped to the same abstract concept node, so that the corresponding relationship between the multiple original entities and the abstract entity can be obtained, and all the original entities meeting the conditions can be searched for at one time based on the corresponding relationship and the abstract entity obtained by logical reasoning in the subsequent steps, thereby further improving the efficiency of the knowledge question answering.
In one embodiment, as shown in fig. 3, the step S3 includes steps S31 to S32, wherein:
and S31, acquiring shortest paths meeting the target association relation based on the abstract knowledge graph and the statement to be inquired, and acquiring at least one shortest path, wherein the starting node of the shortest path is a node corresponding to the preset head entity.
In one embodiment, whether the shortest path meeting the target association relationship exists in the abstract knowledge graph is judged; under the condition that the shortest path meeting the target association relation does not exist in the abstract knowledge graph, the shortest path meeting the target association relation is obtained based on the original knowledge graph and the statement to be inquired, so that under the condition that the shortest path meeting the target association relation does not exist in the abstract knowledge graph, the shortest path is extracted through an alternative scheme, the inclusion of the knowledge question answering method provided by the application is improved, and the knowledge question answering is convenient to realize under various different scenes.
And step S32, aiming at each shortest path, sequentially acquiring the sub-association relationship between two adjacent nodes in the shortest path to obtain a plurality of sequentially arranged sub-association relationships, and forming an entity relationship chain corresponding to the shortest path based on the plurality of sequentially arranged sub-association relationships.
In an embodiment, the shortest path shown in formula (1) and the entity relationship chain shown in formula (2) are taken as examples to explain the embodiment:
Figure BDA0003830825150000091
R 1 (x,z 1 )∧R 2 (z 1 ,z 2 )∧…∧R n (z n-1 ,y)→R(x,y) (2)
wherein x represents a preset head entity, y represents a target tail entity to be determined, and z 1 To z n-1 Representing intermediate entities found from an abstract knowledge graph based on a target association R, where R 1 Representing a default header entity x and an intermediate entity z 1 Sub-associative relationship between R 2 Representing an intermediate entity z 1 With an intermediate entity z 2 Sub-association relationship between R n Representing an intermediate entity z n-1 And the target tail entity y.
As can be seen, in the case where the shortest path shown in formula (1) exists, x and y have an association relationship R, and only the entity relationship chain R is concerned in extracting the entity relationship chain from the shortest path 1 ∧R 2 ∧…∧R n → R itself, while ignoring abstract and primitive entities to improve the extraction efficiency of entity relationship chains.
In the above steps S31 to S32, at least one shortest path satisfying the target association relationship is determined based on the abstract knowledge map and the sentence to be queried, and when the entity relationship chain is extracted from the shortest path, only the entity relationship chain itself is concerned, and the abstract entity and the original entity are ignored, so that the extraction efficiency of the entity relationship chain can be improved, and the question-answering efficiency can be further improved.
In one embodiment, as shown in fig. 4, the question answering method further includes steps S33 to S34, where:
step S33, determining whether two adjacent sub-association relations form a reciprocal association relation group for any two adjacent sub-association relations in the entity relation chain.
And step S34, deleting the two adjacent sub-incidence relations from the entity relation chain under the condition that the two adjacent sub-incidence relations form a reciprocal incidence relation group.
For example, a sub-incidence relation R 1 And a sub-incidence relation R 2 Is two adjacent sub-associationsRelationships, and the two adjacent sub-associations are reciprocal, then R can be assigned 1 ∧R 2 ∧R 3 Reduced to R 3 I.e. deleting the sub-associative relations R in the entity-relationship chain 1 And a sub-incidence relation R 2
In the above steps S33 to S34, the extracted entity relationship chain is simplified by determining whether any two adjacent sub-association relationships in the entity relationship chain form a reciprocal association relationship group, and deleting the two adjacent sub-association relationships from the entity relationship chain when the two adjacent sub-association relationships form the reciprocal association relationship group, so that the target tail entity corresponding to the sentence to be queried can be quickly determined by the simplified entity relationship chain, and the processing efficiency of the knowledge question answering is improved.
In one embodiment, as shown in fig. 5, the step S4 includes steps S41 to S42, wherein:
and S41, determining a tail entity corresponding to the entity relation chain from the original knowledge graph aiming at each entity relation chain, and determining the tail entity to be an alternative tail entity.
For example, for a chain of entity relationships l: r 1 ∧R 2 ∧R 3 The path corresponding to the entity relation chain l exists in the original knowledge graph
Figure BDA0003830825150000101
Then it is determined that the tail entity t is an alternative tail entity.
And S42, acquiring the first weight of each alternative tail entity, and determining the alternative tail entity with the highest first weight as the target tail entity corresponding to the statement to be queried.
In one embodiment, the first weight of the candidate tail entity is obtained based on the weight of each entity relationship chain to which the candidate tail entity belongs and the weight of the entity in each entity relationship chain to which the candidate tail entity belongs.
In the steps S41 to S42, the accuracy of the question and answer result can be improved by determining a plurality of candidate tail entities meeting the conditions from the original knowledge graph based on at least one entity relationship chain, and screening the candidate tail entity with the highest weight value from the plurality of candidate tail entities as the target tail entity corresponding to the sentence to be queried.
In one embodiment, as shown in fig. 6, the step S42 includes steps S421 to S423, wherein:
step S421, for each candidate tail entity, obtaining a second weight corresponding to each entity relationship chain to which the candidate tail entity belongs.
In one embodiment, the occurrence number of each entity relationship chain in all the entity relationship chains satisfying the target association relationship and the total number of the relationship chains satisfying the target association relationship are obtained, and the second weight corresponding to each entity relationship chain is obtained based on the division of the occurrence number corresponding to each entity relationship chain and the total number of the relationship chains.
Specifically, for a target association, there is an entity pair (z) due to the presence of multiple entity pairs in the knowledge-graph that satisfy the target association, such as for target association R 1 Y) satisfies the target association R, there is also an entity pair (z) 2 And y) satisfies the target association relation R. From these different entity pairs, multiple entity relationship chains may be abstracted, where some of the entity relationship chains are identical. For a certain entity relationship chain, assuming that the number of times of extraction is f1, and the total number of times of extraction of all entity relationship chains is f2, the frequency of the entity relationship chain is equal to f1 divided by f2.
Step S422, for each entity relationship chain to which the candidate tail entity belongs, obtaining a weight product term corresponding to the entity relationship chain based on the third weight of each intermediate entity in the entity relationship chain and the corresponding second weight thereof.
In one embodiment, for any intermediate entity in any entity relation chain, the total number of entities of the intermediate entity where the intermediate entity is located is obtained, and the probability of 1 divided by the total number of entities is used as the third weight of the intermediate entity.
Step S423, overlapping the weight product terms corresponding to each entity relationship chain to which the candidate tail entity belongs to obtain a first weight of the candidate tail entity.
In one embodiment, the first weight of the alternative tail entity may be represented by the following equation (3):
Figure BDA0003830825150000111
wherein, ω is t First weight, l, representing alternative tail entity t i Represents the i-th entity relation chain,
Figure BDA0003830825150000112
represents a collection of entity relationship chains, e j Represents the jth intermediate entity in the ith entity relationship chain,
Figure BDA0003830825150000113
representing a physical relationship chain l i Is used to determine the second weight of (a),
Figure BDA0003830825150000114
representing an entity relationship chain l i Intermediate entity e in 1 Of the first weight of (a) is,
Figure BDA0003830825150000121
representing a physical relationship chain l i Intermediate entity e in (1) 2 Is determined to be the third weight of (a),
Figure BDA0003830825150000122
representing a physical relationship chain l i Intermediate entity in (3)
Figure BDA0003830825150000123
And (3) a third weight.
Figure BDA0003830825150000124
Representing a physical relationship chain l i The corresponding weight product term.
Specifically, in the case of j =1,
Figure BDA0003830825150000125
representing a physical relationship chain l i The first intermediate entity in the corresponding shortest path is e 1 The probability of (d); in the case where j =2, the control section,
Figure BDA0003830825150000126
representing a physical relationship chain l i The second intermediate entity in the corresponding shortest path is e 2 The probability of (d); entity relationship chain l i Can be expressed as | l i I.e. there is l in the chain of physical relationships i If the sub-association relationship is the shortest path, the last entity in the shortest path can be represented as the ith i I.e. | +1 entities, i.e. at j = | l i In the case of | +1 of the case,
Figure BDA0003830825150000127
representing an entity relationship chain l i The last entity in the corresponding shortest path is the entity
Figure BDA0003830825150000128
The probability of (c).
In the above steps S421 to S423, the weight of each entity relationship chain to which the candidate tail entity belongs and the weight of each intermediate entity in each entity relationship chain to which the candidate tail entity belongs are considered when calculating the weight of each candidate tail entity, so that the weight corresponding to each candidate tail entity can be accurately calculated, and the accuracy of the knowledge question-answering result is further improved.
The following provides a specific embodiment applied to the field of trade knowledge question answering to further explain the knowledge question answering method provided by the present invention.
In a specific embodiment, an abstract trade knowledge map is constructed based on the original trade knowledge map, and the abstract trade knowledge map is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity. Obtaining a statement to be queried (x, R, y), wherein the statement to be queried is composed of a preset head entity x and a target incidence relation R, and the target incidence relation R represents the incidence relation between the preset head entity x and a target tail entity y to be determined. Based on the statement to be queried (x, R, y) and the abstract trade knowledge graphAnd determining at least one entity relation chain meeting the target association relation by the spectrum, determining at least one alternative tail entity based on the original trade knowledge spectrum and the at least one entity relation chain, determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity, and outputting the target tail entity as an answer of the statement to be queried. Wherein one entity relationship chain l is R 1 (x,z 1 )∧R 2 (z 1 Y) → R (x, y), node x representing company a, node z 1 Represents company b, R 1 (x,z 1 ) Indicating that company a is a subsidiary of company b, y is service, R 2 (z 1 Y) indicates that company b belongs to the service industry, it can be inferred from the entity relationship chain l: company a also belongs to the service industry. Knowledge which does not exist in the original trade knowledge map (company x, affiliated to company y) and the like can be found through the entity relation chain l, so that hidden trade knowledge is found, and the accuracy and reliability of the question-answering result of the trade knowledge are further improved.
The following describes the knowledge question-answering device provided by the present invention, and the knowledge question-answering device described below and the knowledge question-answering method described above can be referred to in correspondence to each other.
As shown in fig. 7, the present invention provides a question-answering apparatus 100, the question-answering apparatus 100 including:
the map building module 10 is configured to build an abstract knowledge map based on the original knowledge map, where the abstract knowledge map is composed of an abstract head entity, an abstract tail entity, and an association relationship between the abstract head entity and the abstract tail entity.
The data obtaining module 20 is configured to obtain a statement to be queried, where the statement to be queried is formed by a preset head entity and a target association relationship, and the target association relationship represents an association relationship between the preset head entity and a target tail entity to be determined.
And the relation chain determining module 30 is configured to determine at least one entity relation chain satisfying the target relation based on the statement to be queried and the abstract knowledge graph.
And the entity determining module 40 is configured to determine at least one candidate tail entity based on the original knowledge graph and the at least one entity relation chain, and determine a target tail entity corresponding to the statement to be queried based on the at least one candidate tail entity.
In one embodiment, the map building module 10 includes an entity group acquiring unit, an entity abstraction unit, and a map building unit, wherein:
an entity group obtaining unit, configured to obtain each original entity group in the original knowledge graph, where the original entity group includes an original head entity, an original tail entity, and an association relationship between the original head entity and the original tail entity.
And the entity abstraction unit is used for defining an abstract tail entity corresponding to the original tail entity based on the original head entity and the incidence relation in each original entity group.
And the map construction unit is used for replacing each original tail entity in the plurality of original entity groups with the corresponding abstract tail entity to form a plurality of abstract entity groups, and constructing the abstract knowledge map based on the plurality of abstract entity groups.
In one embodiment, the relationship chain determination module 30 comprises a path determination unit and a relationship chain determination unit, wherein:
and the path determining unit is used for acquiring the shortest paths meeting the target association relation based on the abstract knowledge graph and the statement to be inquired to obtain at least one shortest path, wherein the starting node of the shortest path is a node corresponding to the preset head entity.
And the relationship chain determining unit is used for sequentially acquiring the sub-association relationship between two adjacent nodes in the shortest path aiming at each shortest path to obtain a plurality of sequentially arranged sub-association relationships, and forming an entity relationship chain corresponding to the shortest path based on the plurality of sequentially arranged sub-association relationships.
In one embodiment, the knowledge question-answering apparatus 100 further comprises a reciprocal decision module and a relationship chain simplification module, wherein:
and the reciprocal judgment module is used for judging whether the two adjacent sub-incidence relations form a reciprocal incidence relation group or not according to any two adjacent sub-incidence relations in the entity relation chain.
And the relation chain simplifying module is used for deleting the two adjacent sub-incidence relations from the entity relation chain under the condition that the two adjacent sub-incidence relations form a reciprocal incidence relation group.
In one embodiment, the entity determination module 40 comprises an alternative determination unit and a target determination unit, wherein:
and the alternative determining unit is used for determining a tail entity corresponding to the entity relation chain from the original knowledge graph aiming at each entity relation chain and determining the tail entity as the alternative tail entity.
And the target determining unit is used for acquiring the first weight of each candidate tail entity and determining the candidate tail entity with the highest first weight as the target tail entity corresponding to the statement to be queried.
In one embodiment, the target determination unit comprises a weight acquisition unit, a weight multiplication unit and a weight superposition unit, wherein:
and the weight obtaining unit is used for obtaining a second weight corresponding to each entity relation chain to which the alternative tail entity belongs aiming at each alternative tail entity.
And the weight multiplication unit is used for acquiring a weight product term corresponding to the entity relation chain based on the third weight of each intermediate entity in the entity relation chain and the corresponding second weight thereof aiming at each entity relation chain to which the alternative tail entity belongs.
And the weight superposition unit is used for superposing the weight product terms corresponding to each entity relationship chain to which the alternative tail entity belongs to obtain the first weight of the alternative tail entity.
Fig. 8 illustrates a physical structure diagram of an electronic device, and as shown in fig. 8, the electronic device may include: a processor (processor) 810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to perform a method of knowledge question answering that includes constructing an abstract knowledge graph based on an original knowledge graph, the abstract knowledge graph being composed of an abstract header entity, an abstract trailer entity, and an association between the abstract header entity and the abstract trailer entity; obtaining a statement to be queried, wherein the statement to be queried is composed of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined; determining at least one entity relation chain meeting the target association relation based on the statement to be queried and the abstract knowledge graph; and determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes 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 invention. 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.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing the question answering method provided by the above methods, and the method includes: constructing an abstract knowledge graph based on the original knowledge graph, wherein the abstract knowledge graph is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity; obtaining a sentence to be queried, wherein the sentence to be queried consists of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined; determining at least one entity relation chain meeting the target association relation based on the statement to be queried and the abstract knowledge map; and determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the question answering method provided by the above methods, the method including: constructing an abstract knowledge map based on the original knowledge map, wherein the abstract knowledge map is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity; obtaining a sentence to be queried, wherein the sentence to be queried consists of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined; determining at least one entity relation chain meeting the target association relation based on the statement to be queried and the abstract knowledge map; and determining at least one alternative tail entity based on the original knowledge graph and the at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of various embodiments or some parts of embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of knowledge question answering, comprising:
constructing an abstract knowledge graph based on an original knowledge graph, wherein the abstract knowledge graph is composed of an abstract head entity, an abstract tail entity and an incidence relation between the abstract head entity and the abstract tail entity;
obtaining a statement to be queried, wherein the statement to be queried is composed of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined;
determining at least one entity relation chain meeting the target relation based on the statement to be queried and the abstract knowledge map;
and determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
2. The method of claim 1, wherein constructing an abstract knowledge graph based on the original knowledge graph comprises:
acquiring each original entity group in the original knowledge graph, wherein the original entity group comprises an original head entity, an original tail entity and an incidence relation between the original head entity and the original tail entity;
for each original entity group, defining an abstract tail entity corresponding to an original tail entity based on an original head entity and an incidence relation in the original entity group;
and replacing each original tail entity in the plurality of original entity groups with the corresponding abstract tail entity to form a plurality of abstract entity groups, and constructing an abstract knowledge graph based on the plurality of abstract entity groups.
3. The method of claim 1, wherein the determining at least one entity relationship chain satisfying the target association relationship based on the query sentence and the abstract knowledge graph comprises:
based on the abstract knowledge graph and the statement to be queried, obtaining a shortest path meeting the target association relation to obtain at least one shortest path, wherein an initial node of the shortest path is a node corresponding to the preset head entity;
and aiming at each shortest path, sequentially acquiring the sub-incidence relation between two adjacent nodes in the shortest path to obtain a plurality of sequentially arranged sub-incidence relations, and forming an entity relation chain corresponding to the shortest path based on the plurality of sequentially arranged sub-incidence relations.
4. A method of knowledge question-answering according to any one of claims 1 to 3, characterized in that the method further comprises:
aiming at any two adjacent sub-incidence relations in the entity relation chain, judging whether the two adjacent sub-incidence relations form a reciprocal incidence relation group;
and deleting the two adjacent sub-incidence relations from the entity relation chain under the condition that the two adjacent sub-incidence relations form a reciprocal incidence relation group.
5. The method of claim 1, wherein the determining at least one candidate tail entity based on the original knowledge graph and at least one entity relation chain and determining a target tail entity corresponding to the sentence to be queried based on the at least one candidate tail entity comprises:
for each entity relationship chain, determining a tail entity corresponding to the entity relationship chain from the original knowledge graph, and determining the tail entity as an alternative tail entity;
and acquiring a first weight of each alternative tail entity, and determining the alternative tail entity with the highest first weight as a target tail entity corresponding to the statement to be queried.
6. The question-answering method according to claim 5, wherein the obtaining the first weight of each candidate tail entity comprises:
aiming at each alternative tail entity, acquiring a second weight corresponding to each entity relation chain to which the alternative tail entity belongs;
for each entity relationship chain to which the alternative tail entity belongs, acquiring a weight product term corresponding to the entity relationship chain based on the third weight of each intermediate entity in the entity relationship chain and the corresponding second weight thereof;
and overlapping the weight product terms corresponding to each entity relationship chain to which the alternative tail entity belongs to obtain a first weight of the alternative tail entity.
7. A trade knowledge inference apparatus, comprising:
the map construction module is used for constructing an abstract knowledge map based on the original knowledge map, wherein the abstract knowledge map comprises an abstract head entity, an abstract tail entity and an association relationship between the abstract head entity and the abstract tail entity;
the system comprises a data acquisition module, a query module and a query module, wherein the data acquisition module is used for acquiring a statement to be queried, the statement to be queried consists of a preset head entity and a target incidence relation, and the target incidence relation represents the incidence relation between the preset head entity and a target tail entity to be determined;
the relation chain determining module is used for determining at least one entity relation chain meeting the target association relation based on the statement to be queried and the abstract knowledge graph;
and the entity determining module is used for determining at least one alternative tail entity based on the original knowledge graph and at least one entity relation chain, and determining a target tail entity corresponding to the statement to be queried based on the at least one alternative tail entity.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the trivia method of any of claims 1 to 6 when executing the program.
9. A non-transitory computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the question answering method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of knowledge question answering according to any one of claims 1 to 6.
CN202211074171.XA 2022-09-02 2022-09-02 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium Pending CN115658910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211074171.XA CN115658910A (en) 2022-09-02 2022-09-02 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211074171.XA CN115658910A (en) 2022-09-02 2022-09-02 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115658910A true CN115658910A (en) 2023-01-31

Family

ID=85024461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211074171.XA Pending CN115658910A (en) 2022-09-02 2022-09-02 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115658910A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117494806A (en) * 2023-12-28 2024-02-02 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Relation extraction method, system and medium based on knowledge graph and large language model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117494806A (en) * 2023-12-28 2024-02-02 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Relation extraction method, system and medium based on knowledge graph and large language model
CN117494806B (en) * 2023-12-28 2024-03-08 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) Relation extraction method, system and medium based on knowledge graph and large language model

Similar Documents

Publication Publication Date Title
CN110032641B (en) Method and device for extracting event by using neural network and executed by computer
CN111597314B (en) Reasoning question-answering method, device and equipment
CN111523831B (en) Risk group identification method and device, storage medium and computer equipment
CN112926990A (en) Method and device for fraud identification
CN111522915A (en) Extraction method, device and equipment of Chinese event and storage medium
US9009029B1 (en) Semantic hashing in entity resolution
CN109948140B (en) Word vector embedding method and device
CN116501898B (en) Financial text event extraction method and device suitable for few samples and biased data
CN112507139B (en) Knowledge graph-based question and answer method, system, equipment and storage medium
CN111291187A (en) Emotion analysis method and device, electronic equipment and storage medium
CN109885180A (en) Error correction method and device, computer-readable medium
CN115658910A (en) Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium
CN113190746B (en) Recommendation model evaluation method and device and electronic equipment
CN116992052B (en) Long text abstracting method and device for threat information field and electronic equipment
CN111199421B (en) Social relationship-based user recommendation method and device and electronic equipment
CN111882048A (en) Neural network structure searching method and related equipment
CN115374793B (en) Voice data processing method based on service scene recognition and related device
CN115035890B (en) Training method and device of voice recognition model, electronic equipment and storage medium
CN116545740A (en) Threat behavior analysis method and server based on big data
CN111125329A (en) Text information screening method, device and equipment
CN116127974A (en) Radar-oriented entity relationship joint extraction method
CN111737425B (en) Response method, device, server and storage medium
CN115577147A (en) Visual information map retrieval method and device, electronic equipment and storage medium
CN114387088A (en) Loan risk identification method and device based on knowledge graph
CN112307205A (en) Text classification method, system and computer storage medium based on automatic summarization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination