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

By constructing an abstract knowledge graph, entities with similar semantics are abstracted into the same concept, reducing the complexity of the knowledge graph, solving the problem of low efficiency in trade knowledge question answering, and achieving fast and accurate knowledge question answering.

CN115658910BActive Publication Date: 2026-06-16INST OF AUTOMATION CHINESE ACAD OF SCI +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INST OF AUTOMATION CHINESE ACAD OF SCI
Filing Date
2022-09-02
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing symbol-based logical reasoning methods lead to an exponential increase in complexity as the size of the trade knowledge graph grows, resulting in low efficiency in trade knowledge question answering.

Method used

By constructing an abstract knowledge graph, multiple entities with similar semantics in the original knowledge graph are abstracted into the same concept, thus reducing the complexity of the knowledge graph. Based on the abstract knowledge graph, the entity relationship chain that meets the conditions can be quickly determined, and finally the target tail entity can be determined in the original knowledge graph.

🎯Benefits of technology

While retaining most of the semantic information of the original knowledge graph, the complexity of the knowledge graph was reduced, the efficiency of knowledge question answering was improved, and the target tail entity was quickly identified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658910B_ABST
    Figure CN115658910B_ABST
Patent Text Reader

Abstract

The application provides a knowledge question answering method and device, electronic equipment and readable storage medium, and relates to the technical field of computers, and the method comprises the steps that an abstract knowledge graph is constructed based on an original knowledge graph, the abstract knowledge graph 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; a to-be-queried sentence is acquired, the to-be-queried sentence is composed of 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 to-be-determined target tail entity; at least one entity relationship chain meeting the target association relationship is determined based on the to-be-queried sentence and the abstract knowledge graph; at least one candidate tail entity is determined based on the original knowledge graph and the at least one entity relationship chain, and a target tail entity corresponding to the to-be-queried sentence is determined based on the at least one candidate tail entity, so that the defect that the knowledge question answering efficiency is too low in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a knowledge question-answering method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Trade knowledge graphs are widely used in the field of financial trade analysis. They are used to store rich trade industry knowledge and support semantic understanding and knowledge search in the trade field. Through trade knowledge graphs, hidden deep trade knowledge can be discovered, thereby revealing deep connections between enterprises, seeking trade opportunities, and predicting trade risks in advance. They can provide rich knowledge support for trade decisions, thereby improving the economic benefits of trading enterprises.

[0003] In existing technologies, symbol-based logical reasoning methods are used to obtain the required trade knowledge. However, the complexity of this reasoning method increases exponentially with the size of the trade knowledge graph, resulting in low efficiency in trade knowledge question answering. Summary of the Invention

[0004] This invention provides a knowledge question answering method, apparatus, electronic device, and readable storage medium to address the shortcomings of low efficiency in the prior art.

[0005] This invention provides a knowledge question-answering method, comprising:

[0006] An abstract knowledge graph is constructed based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the association between the abstract head entity and the abstract tail entity.

[0007] Obtain the query statement, which consists of a preset header entity and a target association relationship, wherein the target association relationship represents the association relationship between the preset header entity and the target tail entity to be determined;

[0008] Based on the query statement and the abstract knowledge graph, at least one entity relationship chain that satisfies the target association relationship is determined;

[0009] Based on the original knowledge graph and at least one entity relationship chain, at least one candidate tail entity is determined, and based on at least one candidate tail entity, the target tail entity corresponding to the query statement is determined.

[0010] According to a knowledge question answering method provided by the present invention, the step of constructing an abstract knowledge graph based on an original knowledge graph includes:

[0011] Obtain each original entity group in the original knowledge graph, wherein the original entity group includes an original head entity, an original tail entity, and the association relationship between the original head entity and the original tail entity;

[0012] For each original entity group, an abstract tail entity corresponding to the original tail entity is defined based on the original head entity and the association relationship in the original entity group;

[0013] Each original tail entity in multiple original entity groups is replaced with its corresponding abstract tail entity to form multiple abstract entity groups, and an abstract knowledge graph is constructed based on multiple abstract entity groups.

[0014] According to a knowledge question answering method provided by the present invention, determining at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph includes:

[0015] Based on the abstract knowledge graph and the query statement, the shortest path that satisfies the target association relationship is obtained, and at least one shortest path is obtained. The starting node of the shortest path is the node corresponding to the preset head entity.

[0016] For each shortest path, the sub-associations between two adjacent nodes in the shortest path are obtained sequentially to obtain multiple sequentially arranged sub-associations, and the entity relationship chain corresponding to the shortest path is formed based on the multiple sequentially arranged sub-associations.

[0017] According to a knowledge question-answering method provided by the present invention, the method further includes:

[0018] For any two adjacent sub-associations in the entity relation chain, determine whether the two adjacent sub-associations constitute a mutually inverse association group;

[0019] If the two adjacent sub-associations form a reciprocal association group, the two adjacent sub-associations will be deleted from the entity relationship chain.

[0020] According to a knowledge question answering method provided by the present invention, the step of determining at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and determining the target tail entity corresponding to the query statement based on the at least one candidate tail entity, includes:

[0021] For each entity relationship chain, the tail entity corresponding to the entity relationship chain is determined from the original knowledge graph, and the tail entity is determined as a candidate tail entity;

[0022] Obtain the first weight of each candidate tail entity, and determine the candidate tail entity with the highest first weight as the target tail entity corresponding to the query statement.

[0023] According to a knowledge question answering method provided by the present invention, obtaining the first weight of each candidate tail entity includes:

[0024] For each candidate tail entity, obtain the second weight corresponding to each entity relationship chain to which the candidate tail entity belongs;

[0025] For each entity relationship chain to which the candidate tail entity belongs, based on the third weight of each intermediate entity in the entity relationship chain and its corresponding second weight, obtain the weight product term corresponding to the entity relationship chain;

[0026] The weights of each entity relationship chain to which the candidate tail entity belongs are superimposed to obtain the first weight of the candidate tail entity.

[0027] The present invention also provides a trade knowledge reasoning device, comprising:

[0028] The graph construction module is used to construct an abstract knowledge graph based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the association between the abstract head entity and the abstract tail entity.

[0029] The data acquisition module is used to acquire the query statement, which consists of a preset header entity and a target association relationship. The target association relationship represents the association relationship between the preset header entity and the target tail entity to be determined.

[0030] The relationship chain determination module is used to determine at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph;

[0031] The entity determination module is used to determine at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and to determine the target tail entity corresponding to the query statement based on at least one candidate tail entity.

[0032] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the knowledge question-answering method as described above.

[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the knowledge question-answering method as described above.

[0034] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the knowledge question-answering method as described above.

[0035] The knowledge question answering method, apparatus, electronic device, and readable storage medium provided by this invention abstract multiple entities with similar semantics in the original knowledge graph into the same concept to construct an abstract knowledge graph. This reduces the complexity of the knowledge graph while retaining most of the semantic information in the original knowledge graph, thereby enabling the rapid determination of entity relationship chains that meet the conditions based on the abstract knowledge graph. Furthermore, based on the obtained entity relationship chains and the original knowledge graph, the target tail entity corresponding to the query statement can be quickly determined. This solves the problem of low efficiency in the prior art and improves the efficiency of knowledge question answering. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is one of the flowcharts illustrating the knowledge question-answering method provided in this embodiment of the invention;

[0038] Figure 2 This is the second flowchart illustrating the knowledge question-answering method provided in this embodiment of the invention;

[0039] Figure 3 This is the third flowchart illustrating the knowledge question-answering method provided in this embodiment of the invention;

[0040] Figure 4 This is the fourth flowchart of the knowledge question-answering method provided in the embodiments of the present invention;

[0041] Figure 5 This is the fifth flowchart illustrating the knowledge question-answering method provided in this embodiment of the invention;

[0042] Figure 6 This is the sixth flowchart illustrating the knowledge question-answering method provided in this embodiment of the invention;

[0043] Figure 7 This is a schematic diagram of the knowledge question-answering device provided in an embodiment of the present invention;

[0044] Figure 8 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0046] The following is combined Figures 1-6 Describe the knowledge question-and-answer method of this invention. For example... Figure 1 As shown, the present invention provides a knowledge question-answering method, including:

[0047] Step S1: Construct an abstract knowledge graph based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the relationships between the abstract head entity and the abstract tail entity.

[0048] The original knowledge graph consists of an original head entity h, an original tail entity t, and the association r between the original head and tail entities. The abstract tail entity is determined based on the original head entity h and the association r; therefore, this abstract tail entity can be represented as h. r .

[0049] It should be noted that the original head entity h and the original tail entity t both represent a specific thing in the real world, while the abstract tail entity h r It is an abstract representation of multiple original tail entities t with similar semantics, that is, an abstract tail entity h. r It corresponds to one or more original tail entities t with similar semantics.

[0050] Step S2: Obtain the query statement. The query statement consists of a preset header entity and a target relationship. The target relationship represents the relationship between the preset header entity and the target tail entity to be determined.

[0051] The query statement can be represented as (h1, r1, t1), where h1 represents the preset header entity, r1 represents the target association relationship, and t1 represents the target tail entity to be determined. That is, the preset header entity h1 and the target association relationship r1 are known, while the target tail entity is unknown.

[0052] Step S3: Based on the query statement and the abstract knowledge graph, determine at least one entity relationship chain that satisfies the target association relationship.

[0053] The entity relationship chain is a chain of relationships consisting of multiple sequentially arranged sub-relationships. A sub-relationship represents the relationship between entities corresponding to two adjacent nodes. These two adjacent nodes are any two adjacent nodes within a node interval determined by the head node corresponding to a preset head entity and the tail node corresponding to a target tail entity; this node interval is a closed interval. The sub-relationships include the relationship between the preset head entity and intermediate entities, the relationship between two intermediate entities, and the relationship between an intermediate entity and the target tail entity, where the intermediate entity is determined based on the target relationship.

[0054] Step S4: Based on the original knowledge graph and at least one entity relationship chain, determine at least one candidate tail entity, and based on at least one candidate tail entity, determine the target tail entity corresponding to the query statement.

[0055] Steps S1 to S4 above abstract multiple entities with similar semantics in the original knowledge graph into the same concept to construct an abstract knowledge graph. This reduces the complexity of the knowledge graph while retaining most of the semantic information in the original knowledge graph. As a result, entity relationship chains that meet the conditions can be quickly determined based on the abstract knowledge graph. Then, the target tail entity corresponding to the query statement can be quickly determined based on the obtained entity relationship chains and the original knowledge graph. This solves the problem of low efficiency in knowledge question answering in the prior art and improves the efficiency of knowledge question answering.

[0056] Furthermore, the relationships in the original knowledge graph can be obtained through expert annotation or text extraction.

[0057] Furthermore, the original knowledge graph is the original trade knowledge graph, where entities can be a company, an employee, or an industry. The relationships between entities can be competitive or cooperative relationships between companies, or leadership relationships between employees.

[0058] In one embodiment, such as Figure 2 As shown, step S1 above includes steps S11 to S13, wherein:

[0059] Step S11: Obtain each original entity group in the original knowledge graph. The original entity group includes the original head entity, the original tail entity, and the association between the original head entity and the original tail entity.

[0060] Here, the original entity group is a triple array, which can be represented as (h, r, t), where h represents the original head entity, t represents the original tail entity, and r represents the association between the original head entity and the original tail entity. The original head entity h and the original tail entity t are the head node and tail node in the original knowledge graph, respectively, and the association r is the edge in the original knowledge graph.

[0061] Step S12: For each original entity group, define the abstract tail entity corresponding to the original tail entity based on the original head entity and the association relationship in the original entity group.

[0062] Specifically, multiple original tail entities t in the original knowledge graph that have the same association r as the original head entity h are considered to have the same or similar semantics, and these multiple original tail entities t are mapped to an abstract concept node, which is the abstract tail entity h. r .

[0063] Furthermore, multiple original tail entities t can be combined with an abstract tail entity h. r The mapping relationships between them are stored in a predefined mapping dictionary or other memory for easy retrieval later.

[0064] Step S13: Replace each original tail entity in the multiple original entity groups with its corresponding abstract tail entity to form multiple abstract entity groups, and construct an abstract knowledge graph based on the multiple abstract entity groups.

[0065] The abstract entity group is a triple array, which can be represented as (h′, r, h′). r h′ represents the abstract header entity, h′ r 'r' represents the abstract tail entity, and 'r' represents the association between the abstract head entity and the abstract tail entity.

[0066] Specifically, with the abstract head entity h′ as the head node and the abstract tail entity h′ as the tail node... r Construct a knowledge graph with tail nodes and association relationships r as edges, where the edges corresponding to association relationships r are used to connect the head node corresponding to the abstract head entity h′ with the abstract tail entity h′. r Connect the corresponding tail nodes.

[0067] 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. Therefore, we can eventually obtain the abstract entity corresponding to each original entity in the original knowledge graph, and then replace each original entity in the original knowledge graph with its corresponding abstract entity to obtain the replaced abstract knowledge graph.

[0068] Steps S11 to S13 above map multiple original entities with the same relationship to the same abstract concept node, thereby obtaining the correspondence between multiple original entities and abstract entities. In subsequent steps, all original entities that meet the conditions can be found at once based on the correspondence and the abstract entities obtained by logical reasoning, which can further improve the efficiency of knowledge question answering.

[0069] In one embodiment, such as Figure 3 As shown, step S3 above includes steps S31 to S32, wherein:

[0070] Step S31: Based on the abstract knowledge graph and the query statement, obtain the shortest path that satisfies the target association relationship, and obtain at least one shortest path. The starting node of the shortest path is the node corresponding to the preset head entity.

[0071] In one embodiment, it is determined whether there is a shortest path in the abstract knowledge graph that satisfies the target association relationship; if there is no shortest path in the abstract knowledge graph that satisfies the target association relationship, the shortest path that satisfies the target association relationship is obtained based on the original knowledge graph and the query statement. In the case that there is no shortest path in the abstract knowledge graph that satisfies the target association relationship, the shortest path is extracted through an alternative solution, which improves the inclusiveness of the knowledge question answering method provided in this application, thereby facilitating the implementation of knowledge question answering in various different scenarios.

[0072] Step S32: For each shortest path, sequentially obtain the sub-associations between two adjacent nodes in the shortest path to obtain multiple sequentially arranged sub-associations, and form the entity relation chain corresponding to the shortest path based on the multiple sequentially arranged sub-associations.

[0073] In one embodiment, the shortest path shown in formula (1) and the entity relationship chain shown in formula (2) are used as examples to illustrate this embodiment:

[0074]

[0075] R1(x,z1)∧R2(z1,z2)∧…∧R n (z n-1 ,y)→R(x,y) (2)

[0076] Where x represents the preset head entity, y represents the target tail entity to be determined, and z1 to z n-1 R represents the intermediate entity found from the abstract knowledge graph based on the target association relationship R, where R1 represents the sub-association relationship between the predefined head entity x and the intermediate entity z1, and R2 represents the sub-association relationship between the intermediate entities z1 and z2. n Represents intermediate entity z n-1 Sub-associations with the target tail entity y.

[0077] Therefore, it can be seen that when the shortest path shown in formula (1) exists, x and y have an association relationship R, and when extracting the entity relationship chain from the shortest path, only the entity relationship chain R1∧R2∧…∧R is considered. n→R itself, ignoring abstract entities and original entities, in order to improve the extraction efficiency of entity relationship chains.

[0078] Steps S31 to S32 above determine at least one shortest path that satisfies the target association relationship based on the abstract knowledge graph and the query statement. When extracting the entity relationship chain from the shortest path, only the entity relationship chain itself is considered, while the abstract entity and the original entity are ignored. This can improve the extraction efficiency of the entity relationship chain, and further improve the efficiency of knowledge question answering.

[0079] In one embodiment, such as Figure 4 As shown, the knowledge question-answering method provided by the present invention further includes steps S33 to S34, wherein:

[0080] Step S33: For any two adjacent sub-associations in the entity relation chain, determine whether the two adjacent sub-associations constitute a mutually inverse association group.

[0081] Step S34: If two adjacent sub-associations form a group of mutually inverse associations, delete the two adjacent sub-associations from the entity relationship chain.

[0082] For example, if sub-associations R1 and R2 are two adjacent sub-associations and these two adjacent sub-associations are inverses of each other, then R1∧R2∧R3 can be simplified to R3, that is, sub-associations R1 and R2 are deleted from the entity relation chain.

[0083] Steps S33 to S34 above determine whether any two adjacent sub-associations in the entity relation chain form a mutually inverse relation group. If two adjacent sub-associations form a mutually inverse relation group, the two adjacent sub-associations are deleted from the entity relation chain to simplify the extracted entity relation chain. This simplifies the entity relation chain and allows for the rapid identification of the target tail entity corresponding to the query statement through the simplified entity relation chain, thereby improving the processing efficiency of knowledge question answering.

[0084] In one embodiment, such as Figure 5 As shown, step S4 above includes steps S41 to S42, wherein:

[0085] Step S41: For each entity relationship chain, determine the tail entity corresponding to the entity relationship chain from the original knowledge graph, and determine the tail entity as a candidate tail entity.

[0086] For example, for an entity relation chain l: R1∧R2∧R3, there exists a path corresponding to this entity relation chain l in the original knowledge graph. In the case of , the tail entity t is determined to be a candidate tail entity.

[0087] Step S42: Obtain the first weight of each candidate tail entity, and determine the candidate tail entity with the highest first weight as the target tail entity corresponding to the query statement.

[0088] 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.

[0089] Steps S41 to S42 above determine multiple candidate tail entities that meet the conditions from the original knowledge graph based on at least one entity relationship chain, and select the candidate tail entity with the highest weight value from the multiple candidate tail entities as the target tail entity corresponding to the query statement, which can improve the accuracy of knowledge question answering results.

[0090] In one embodiment, such as Figure 6 As shown, step S42 above includes steps S421 to S423, wherein:

[0091] Step S421: For each candidate tail entity, obtain the second weight corresponding to each entity relationship chain to which the candidate tail entity belongs.

[0092] In one embodiment, the number of times each entity relationship chain appears in all entity relationship chains that satisfy the target association relationship and the total number of entity relationship chains that satisfy the target association relationship are obtained. The second weight corresponding to each entity relationship chain is obtained by dividing the number of occurrences of each entity relationship chain by the total number of relationship chains.

[0093] Specifically, for a target association, since there are multiple entity pairs in the knowledge graph that satisfy the target association, for example, for the target association R, there are entity pairs (z1, y) that satisfy the target association R, and there are also entity pairs (z2, y) that satisfy the target association R. Based on these different entity pairs, multiple entity relationship chains can be extracted, some of which are the same. For a certain entity relationship chain, assuming that the number of times it is extracted is f1, and the total number of times all entity relationship chains are extracted is f2, then the frequency of this entity relationship chain is equal to f1 divided by f2.

[0094] Step S422: For each entity relationship chain to which the candidate tail entity belongs, obtain the weight product term corresponding to the entity relationship chain based on the third weight of each intermediate entity in the entity relationship chain and its corresponding second weight.

[0095] In one embodiment, for any intermediate entity in any entity relationship chain, the total number of possible intermediate entities at the location of the intermediate entity is obtained, and the probability of dividing 1 by the total number of entities is used as the third weight of the intermediate entity.

[0096] Step S423: The weight product terms corresponding to each entity relationship chain to which the candidate tail entity belongs are superimposed to obtain the first weight of the candidate tail entity.

[0097] In one embodiment, the first weight of the candidate tail entity can be represented by the following formula (3):

[0098]

[0099] Where, ω t l represents the first weight of the candidate tail entity t. i This represents the i-th entity relationship chain. e represents the set of entity relationship chains. j This represents the j-th intermediate entity in the i-th entity relationship chain. Represents the entity relationship chain l i The second weight, Represents the entity relationship chain l i The third weight of the intermediate entity e1 in the middle, Represents the entity relationship chain l i The third weight of the intermediate entity e2 in the middle, Represents the entity relationship chain l i intermediate entities in The third weight. Represents the entity relationship chain l i The corresponding weighted product term.

[0100] Specifically, when j=1, Represents the entity relationship chain l i The probability that the first intermediate entity in the corresponding shortest path is e1; when j=2, Represents the entity relationship chain l i The probability that the second intermediate entity in the corresponding shortest path is e2; entity relationship chain l i The length can be represented as |l i |, that is, in the entity relationship chain there is |l i If there are | sub-associations, then the last entity in the shortest path can be represented as the |lth | i |+1 entities, that is, in j=|l i In the case of |+1, Represents the entity relationship chain l i The last entity in the corresponding shortest path is the entity. The probability of.

[0101] Steps S421 to S423 above, by considering the weight of each entity relationship chain to which it belongs and the weight of each intermediate entity in each entity relationship chain when calculating the weight of each candidate tail entity, can accurately calculate the weight corresponding to each candidate tail entity, thereby further improving the accuracy of the knowledge question answering results.

[0102] The following is a specific embodiment applied to the field of trade knowledge question answering, to further illustrate the knowledge question answering method provided by the present invention.

[0103] In a specific embodiment, an abstract trade knowledge graph is constructed based on the original trade knowledge graph. This abstract trade knowledge graph consists of abstract head entities, abstract tail entities, and the relationships between them. A query statement (x, R, y) is obtained. This query statement consists of a preset head entity x and a target relationship R, where R represents the relationship between the preset head entity x and the target tail entity y to be determined. Based on the query statement (x, R, y) and the abstract trade knowledge graph, at least one entity relationship chain satisfying the target relationship is determined. Based on the original trade knowledge graph and at least one entity relationship chain, at least one candidate tail entity is determined. Based on the at least one candidate tail entity, the target tail entity corresponding to the query statement is determined, and the target tail entity is output as the answer to the query statement. One entity relationship chain l is R1(x,z1)∧R2(z1,y)→R(x,y), where node x represents company a, node z1 represents company b, R1(x,z1) indicates that company a is a subsidiary of company b, y represents the service industry, and R2(z1,y) indicates that company b belongs to the service industry. Therefore, it can be inferred from entity relationship chain l that company a also belongs to the service industry. Through entity relationship chain l, knowledge such as (company x, belonging to, company y) that is not present in the original trade knowledge graph can be discovered, thereby uncovering hidden trade knowledge and further improving the accuracy and reliability of trade knowledge question-and-answer results.

[0104] The knowledge question-answering device provided by the present invention is described below. The knowledge question-answering device described below can be referred to in correspondence with the knowledge question-answering method described above.

[0105] like Figure 7 As shown, the present invention provides a knowledge question-and-answer device 100, which includes:

[0106] The graph construction module 10 is used to construct an abstract knowledge graph based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the association relationship between the abstract head entity and the abstract tail entity.

[0107] The data acquisition module 20 is used to acquire the query statement. The query statement consists of a preset header entity and a target relationship. The target relationship represents the relationship between the preset header entity and the target tail entity to be determined.

[0108] The relationship chain determination module 30 is used to determine at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph.

[0109] The entity determination module 40 is used to determine at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and to determine the target tail entity corresponding to the query statement based on at least one candidate tail entity.

[0110] In one embodiment, the graph construction module 10 includes an entity group acquisition unit, an entity abstraction unit, and a graph construction unit, wherein:

[0111] The entity group acquisition unit is used to acquire each original entity group in the original knowledge graph. The original entity group includes an original head entity, an original tail entity, and the association relationship between the original head entity and the original tail entity.

[0112] An entity abstraction unit is used to define an abstract tail entity corresponding to the original tail entity for each original entity group, based on the original head entity and the association relationship in the original entity group.

[0113] The graph construction unit is used to replace each original tail entity in multiple original entity groups with its corresponding abstract tail entity to form multiple abstract entity groups, and to construct an abstract knowledge graph based on multiple abstract entity groups.

[0114] In one embodiment, the relationship chain determination module 30 includes a path determination unit and a relationship chain determination unit, wherein:

[0115] The path determination unit is used to obtain the shortest path that satisfies the target association relationship based on the abstract knowledge graph and the query statement, and to obtain at least one shortest path. The starting node of the shortest path is the node corresponding to the preset head entity.

[0116] The relationship chain determination unit is used to sequentially obtain the sub-associations between two adjacent nodes in each shortest path for each shortest path, obtain multiple sequentially arranged sub-associations, and form the entity relationship chain corresponding to the shortest path based on the multiple sequentially arranged sub-associations.

[0117] In one embodiment, the knowledge question-answering device 100 further includes a reversibility determination module and a relationship chain simplification module, wherein:

[0118] The mutual inverse determination module is used to determine whether any two adjacent sub-associations in an entity relationship chain constitute a mutual inverse association group.

[0119] The relation chain simplification module is used to remove two adjacent sub-relationships from the entity relation chain when they form a group of mutually inverse relationships.

[0120] In one embodiment, the entity determination module 40 includes a candidate determination unit and a target determination unit, wherein:

[0121] The candidate determination unit is used to determine the tail entity corresponding to each entity relationship chain from the original knowledge graph, and to determine the tail entity as a candidate tail entity.

[0122] The target determination unit is used to obtain the first weight of each candidate tail entity and determine the candidate tail entity with the highest first weight as the target tail entity corresponding to the query statement.

[0123] In one embodiment, the target determination unit includes a weight acquisition unit, a weight multiplication unit, and a weight superposition unit, wherein:

[0124] The weight acquisition unit is used to acquire the second weight corresponding to each entity relationship chain to which each candidate tail entity belongs for each candidate tail entity.

[0125] The weight multiplication unit is used to obtain the weight product term corresponding to the entity relationship chain for each entity relationship chain to which the candidate tail entity belongs, based on the third weight of each intermediate entity in the entity relationship chain and its corresponding second weight.

[0126] The weight stacking unit is used to stack the weight product terms corresponding to each entity relationship chain to which the candidate tail entity belongs, to obtain the first weight of the candidate tail entity.

[0127] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a knowledge question-answering method. The method includes: constructing an abstract knowledge graph based on the original knowledge graph, the abstract knowledge graph consisting of abstract head entities, abstract tail entities, and the association relationships between the abstract head entities and the abstract tail entities; obtaining a query statement, the query statement consisting of a preset head entity and a target association relationship, the target association relationship representing the association relationship between the preset head entity and the target tail entity to be determined; determining at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph; determining at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and determining the target tail entity corresponding to the query statement based on the at least one candidate tail entity.

[0128] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the knowledge question-answering method provided by the above methods. The method includes: constructing an abstract knowledge graph based on an original knowledge graph, the abstract knowledge graph consisting of abstract head entities, abstract tail entities, and the association relationship between the abstract head entities and the abstract tail entities; obtaining a query statement, the query statement consisting of a preset head entity and a target association relationship, the target association relationship representing the association relationship between the preset head entity and the target tail entity to be determined; determining at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph; determining at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and determining the target tail entity corresponding to the query statement based on the at least one candidate tail entity.

[0130] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the knowledge question-answering method provided by the above methods. The method includes: constructing an abstract knowledge graph based on an original knowledge graph, the abstract knowledge graph consisting of abstract head entities, abstract tail entities, and the association relationships between the abstract head entities and the abstract tail entities; obtaining a query statement, the query statement consisting of a preset head entity and a target association relationship, the target association relationship representing the association relationship between the preset head entity and the target tail entity to be determined; determining at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph; determining at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and determining the target tail entity corresponding to the query statement based on the at least one candidate tail entity.

[0131] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A knowledge-based question-and-answer method, characterized in that, include: An abstract knowledge graph is constructed based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the association between the abstract head entity and the abstract tail entity. The construction of an abstract knowledge graph based on the original knowledge graph includes: obtaining each original entity group in the original knowledge graph, wherein the original entity group includes an original head entity, an original tail entity, and the association relationship between the original head entity and the original tail entity; for each original entity group, defining an abstract tail entity corresponding to the original tail entity based on the original head entity and the association relationship in the original entity group; replacing each original tail entity in multiple original entity groups with its corresponding abstract tail entity to form multiple abstract entity groups, and constructing an abstract knowledge graph based on the multiple abstract entity groups; the original knowledge graph is an original trade knowledge graph, and the entities in the original trade knowledge graph can be a company, an employee, or an industry; the association relationship between entities includes competitive or cooperative relationships between companies, and leadership relationships between employees. Obtain the query statement, which consists of a preset header entity and a target association relationship, wherein the target association relationship represents the association relationship between the preset header entity and the target tail entity to be determined; Based on the query statement and the abstract knowledge graph, at least one entity relationship chain satisfying the target association relationship is determined; the determination of at least one entity relationship chain satisfying the target association relationship based on the query statement and the abstract knowledge graph includes: based on the abstract knowledge graph and the query statement, obtaining the shortest path satisfying the target association relationship, obtaining at least one shortest path, the starting node of the shortest path being the node corresponding to the preset head entity; for each shortest path, sequentially obtaining the sub-associations between two adjacent nodes in the shortest path, obtaining multiple sequentially arranged sub-associations, and forming the entity relationship chain corresponding to the shortest path based on the multiple sequentially arranged sub-associations; Based on the original knowledge graph and at least one entity relationship chain, at least one candidate tail entity is determined, and based on at least one candidate tail entity, the target tail entity corresponding to the query statement is determined.

2. The knowledge question-answering method according to claim 1, characterized in that, The method further includes: For any two adjacent sub-associations in the entity relation chain, determine whether the two adjacent sub-associations constitute a mutually inverse association group; If the two adjacent sub-associations form a reciprocal association group, the two adjacent sub-associations will be deleted from the entity relationship chain.

3. The knowledge question-answering method according to claim 1, characterized in that, The step of determining at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and determining the target tail entity corresponding to the query statement based on at least one candidate tail entity, includes: For each entity relationship chain, the tail entity corresponding to the entity relationship chain is determined from the original knowledge graph, and the tail entity is determined as a candidate tail entity; Obtain the first weight of each candidate tail entity, and determine the candidate tail entity with the highest first weight as the target tail entity corresponding to the query statement.

4. The knowledge question-answering method according to claim 3, characterized in that, The step of obtaining the first weight of each candidate tail entity includes: For each candidate tail entity, obtain the second weight corresponding to each entity relationship chain to which the candidate tail entity belongs; For each entity relationship chain to which the candidate tail entity belongs, based on the third weight of each intermediate entity in the entity relationship chain and its corresponding second weight, obtain the weight product term corresponding to the entity relationship chain; The weights of each entity relationship chain to which the candidate tail entity belongs are superimposed to obtain the first weight of the candidate tail entity.

5. A knowledge-based question-and-answer device, characterized in that, include: The graph construction module is used to construct an abstract knowledge graph based on the original knowledge graph. The abstract knowledge graph consists of an abstract head entity, an abstract tail entity, and the association between the abstract head entity and the abstract tail entity. The construction of an abstract knowledge graph based on the original knowledge graph includes: obtaining each original entity group in the original knowledge graph, wherein the original entity group includes an original head entity, an original tail entity, and the association relationship between the original head entity and the original tail entity; for each original entity group, defining an abstract tail entity corresponding to the original tail entity based on the original head entity and the association relationship in the original entity group; replacing each original tail entity in multiple original entity groups with its corresponding abstract tail entity to form multiple abstract entity groups, and constructing an abstract knowledge graph based on the multiple abstract entity groups; the original knowledge graph is an original trade knowledge graph, and the entities in the original trade knowledge graph can be a company, an employee, or an industry; the association relationship between entities includes competitive or cooperative relationships between companies, and leadership relationships between employees. The data acquisition module is used to acquire the query statement, which consists of a preset header entity and a target association relationship. The target association relationship represents the association relationship between the preset header entity and the target tail entity to be determined. The relationship chain determination module is used to determine at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph. The determination of at least one entity relationship chain that satisfies the target association relationship based on the query statement and the abstract knowledge graph includes: obtaining the shortest path that satisfies the target association relationship based on the abstract knowledge graph and the query statement, obtaining at least one shortest path, wherein the starting node of the shortest path is the node corresponding to the preset head entity; for each shortest path, sequentially obtaining the sub-associations between two adjacent nodes in the shortest path, obtaining multiple sequentially arranged sub-associations, and forming the entity relationship chain corresponding to the shortest path based on the multiple sequentially arranged sub-associations. The entity determination module is used to determine at least one candidate tail entity based on the original knowledge graph and at least one entity relationship chain, and to determine the target tail entity corresponding to the query statement based on at least one candidate tail entity.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the knowledge question-answering method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the knowledge question-answering method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the knowledge question-answering method as described in any one of claims 1 to 4.