A question and answer method, a knowledge graph completion method and related devices

By predicting tail entity representations and generating supplementary knowledge in the knowledge graph, the problem of incomplete text entity relationships is solved, thus improving the accuracy of question answering.

CN115658861BActive Publication Date: 2026-07-10IFLYTEK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IFLYTEK CO LTD
Filing Date
2022-10-20
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Incomplete relationships between text entities in knowledge graphs lead to insufficient accuracy in question answering.

Method used

By predicting tail entity representations and generating supplementary knowledge, and utilizing head text entities and text relationships to search for knowledge matching the question in the knowledge graph, the accuracy of question answering is improved.

Benefits of technology

It enhances the accuracy of knowledge graph question answering, ensuring that complete relevant answers can be obtained when answering questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658861B_ABST
    Figure CN115658861B_ABST
Patent Text Reader

Abstract

The application discloses a question and answer method, a knowledge graph completion method and related devices, and the method comprises the following steps: using the representation of the first head text entity and the first text relationship of the tail entity to be supplemented in the target knowledge graph, and predicting a plurality of tail entity prediction representations; based on the plurality of tail entity prediction representations, a target tail text entity is found out from the target knowledge graph, and the first head text entity, the first text relationship and the target tail text entity are used to generate the supplemented knowledge of the target knowledge graph; a question to be answered is acquired; based on the question representation of the question to be answered, the knowledge matched with the question to be answered is found out from the target knowledge graph supplemented by knowledge; and based on the knowledge matched with the question to be answered, the answer to the question to be answered is obtained, so that the accuracy of the knowledge graph question and answer can be improved by supplementing the target knowledge graph and then answering the question to be answered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, and in particular to a question-answering method, a knowledge graph completion method, and related apparatus. Background Technology

[0002] The core of a knowledge graph is a large-scale semantic network, which is a knowledge representation based on a directed graph structure. Nodes represent text entities and concepts, and edges represent various textual semantic relationships. In a knowledge graph, a piece of knowledge can exist in the form of a triple, including a head text entity, a textual relationship, and a tail text entity, indicating that there is a textual relationship between the head and tail text entities. For example, "Company A, Employee, B" means that B is an employee of Company A.

[0003] Knowledge graphs can be used as knowledge bases to answer questions, that is, to find the answer to the question from the knowledge graph. The question-answering task process of knowledge graphs involves, given a knowledge graph and a question, searching for the answer from the knowledge graph based on the question. For example, using a knowledge graph to answer the question "Who are the employees of Company A?". A knowledge graph built using existing knowledge contains several text entities and text relationships, but the relationships between the text entities in the knowledge graph are not necessarily complete, which can lead to inaccurate answers when solving questions. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a question-answering method, a knowledge graph completion method, and related apparatus that can improve the accuracy of knowledge graph question answering.

[0005] To address the aforementioned technical problems, this application provides a question-answering method, comprising: predicting several tail entity prediction representations using the representations of the first head text entity and the first text relation of the tail entity to be supplemented in the target knowledge graph; searching for the target tail text entity from the target knowledge graph based on the several tail entity prediction representations, and generating supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity; obtaining the question to be answered; searching for knowledge matching the question to be answered from the supplemented target knowledge graph based on the question representation of the question to be answered; and obtaining the answer to the question to be answered based on the knowledge matching the question to be answered.

[0006] Specifically, based on the question representation of the question to be answered, knowledge matching the question to be answered is retrieved from the target knowledge graph supplemented with knowledge, including: using the representation of each text entity in the target knowledge graph to find related text entities that are related to the target text entities in the question to be answered; and obtaining at least one piece of knowledge in the target knowledge graph that contains related text entities as knowledge matching the question to be answered.

[0007] To address the aforementioned technical problems, this application provides a knowledge graph completion method, which includes: determining the first head text entity and the first text relation of the tail entity to be supplemented from the target knowledge graph; determining a unified representation of the tail entity using the entity representation of the first head text entity and the relation representation of the first text relation; predicting several tail entity prediction representations based on the unified tail entity representation; finding the target tail text entity from the target knowledge graph based on the several tail entity prediction representations; and generating supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity.

[0008] Specifically, the unified representation of the tail entity is determined by using the entity representation of the first head text entity and the relation representation of the first text relation, including: semantically expanding the relation representation of the first text relation to obtain the expanded relation representation; and fusing the entity representation of the first head text entity and the expanded relation representation to obtain the unified representation of the tail entity.

[0009] The semantic extension of the relation representation of the first text relation to obtain the extended relation representation includes: using the relation semantic extension matrix to extend the relation representation to obtain the extended relation representation.

[0010] The process of merging the entity representation of the first-head text entity with the extended relational representation to obtain the unified representation of the tail entity includes: multiplying the entity representation of the first-head text entity with the extended relational representation to obtain the unified representation of the tail entity.

[0011] Among them, several tail entity prediction representations are obtained based on the unified tail entity representation prediction, including: using multi-channel mapping parameters to perform multi-channel mapping on the unified tail entity representation to obtain several tail entity prediction representations.

[0012] The process of finding target tail text entities from the target knowledge graph based on several tail entity prediction representations includes: for each tail entity prediction representation, obtaining the first similarity between the tail entity prediction representation and the entity representation of each text entity in the target knowledge graph; and selecting text entities from the target knowledge graph whose first similarity meets the similarity requirement as the target tail text entities corresponding to the tail entity prediction representations.

[0013] The process of generating supplementary knowledge for the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity includes: in response to the absence of knowledge in the target knowledge graph that contains the first head text entity, the first text relation, and the target tail text entity, generating supplementary knowledge for the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity.

[0014] The knowledge graph completion method is implemented through a completion model. The method also includes the following steps to train the completion model: predicting the entity representation of the second head text entity and the relation representation of the second text relationship in the target knowledge graph to obtain several sample tail entity prediction representations. The target knowledge graph contains tail text entity annotation information, which is used to annotate at least one real tail text entity in the target knowledge graph that forms knowledge with the second head text entity and the second text relationship; determining the target loss based on several sample tail entity prediction representations and tail text entity annotation information; and adjusting the parameters of the completion model using the target loss. The parameters of the completion model include parameters related to the entity representation of the entity and the relation representation of the relationship in the target knowledge graph.

[0015] Specifically, the target loss is determined based on several sample tail entity prediction representations and tail text entity annotation information, including: for each sample tail entity prediction representation, obtaining the second similarity between the sample tail entity prediction representation and the entity representation of each text entity in the target knowledge graph; selecting text entities from the target knowledge graph whose second similarity meets the similarity requirement as the predicted tail text entities corresponding to the sample tail entity prediction representation; and determining the target loss based on the predicted tail text entities and tail text entity annotation information.

[0016] To address the aforementioned technical problems, this application provides a question-answering device comprising: a prediction module, a completion module, an acquisition module, a matching module, and a question-answering module. The prediction module uses the representations of the first head text entity and the first text relation of the tail entity to be supplemented in the target knowledge graph to predict several tail entity prediction representations. The completion module searches for the target tail text entity in the target knowledge graph based on these tail entity prediction representations and generates supplementary knowledge for the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity. The acquisition module acquires the question to be answered. The matching module searches for knowledge matching the question in the supplemented target knowledge graph based on the question representation of the question to be answered. The question-answering module obtains the answer to the question based on the knowledge matched to the question.

[0017] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a knowledge graph completion device, comprising: a determination module, a representation module, a prediction module, and a completion module. The determination module is used to determine the first head text entity and the first text relation of the tail entity to be supplemented from the target knowledge graph; the representation module is used to determine a unified representation of the tail entity using the entity representation of the first head text entity and the relation representation of the first text relation; the prediction module is used to predict several predicted representations of the tail entities based on the unified representation of the tail entities; and the completion module is used to find the target tail text entity from the target knowledge graph based on the several predicted representations of the tail entities, and generate supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity.

[0018] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement any of the above-mentioned question-answering methods or knowledge graph completion methods.

[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium storing program instructions thereon, which, when executed by a processor, implement any of the above-mentioned question-answering methods or knowledge graph completion methods.

[0020] The above scheme uses the entity representation of the first head text entity and the relation representation of the first text relation to predict several tail entity prediction representations. Based on these tail entity prediction representations, target tail text entities in the target knowledge graph that can form knowledge with the first head text entity and the first text relation can be identified, thus completing the target knowledge graph. Then, for the question to be answered, knowledge matching the question is searched in the target knowledge graph to obtain the answer. By completing the target knowledge graph in this way before answering the question, the accuracy of knowledge graph question answering can be improved. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating an embodiment of the knowledge graph completion method of this application;

[0022] Figure 2 This is a flowchart illustrating another embodiment of step S120 of this application;

[0023] Figure 3 This is a flowchart illustrating another embodiment of step S140 of this application;

[0024] Figure 4 This is a flowchart illustrating another embodiment of the knowledge graph completion method of this application;

[0025] Figure 5This is a schematic diagram of an embodiment of the knowledge graph completion model in the knowledge graph completion method of this application;

[0026] Figure 6 This is a flowchart illustrating an embodiment of the question-and-answer method of this application;

[0027] Figure 7 This is a schematic diagram of the framework of an embodiment of the knowledge graph completion device of this application;

[0028] Figure 8 This is a schematic diagram of the framework of an embodiment of the question-and-answer device of this application;

[0029] Figure 9 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;

[0030] Figure 10 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0031] To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. In the following description, specific details such as particular system structures, interfaces, and technologies are set forth for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0032] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0033] It is understood that the knowledge graph completion method in this application can be executed by an electronic device, which can be any device with processing capabilities, such as a mobile phone, computer, tablet computer, etc.

[0034] It should be noted that a knowledge graph can serve as a knowledge base, used to retrieve answers to questions, thereby enabling the use of the knowledge graph to answer those questions. Since the relationships between text entities in a knowledge graph may be incomplete, an incomplete knowledge graph can affect the accuracy of question answering. Therefore, before using the target knowledge graph to answer questions, it should first be completed to improve the accuracy of question answering.

[0035] In a specific application scenario, the target knowledge graph contains text entities Company A, person a, and person b. The target knowledge graph only contains knowledge about Company A, its employees, and a. However, both a and b are employees of Company A. Therefore, the target knowledge graph lacks knowledge about Company A, its employees, and b. If the question to be answered is "Who are the employees of Company A?", using the incomplete target knowledge graph will only yield answer a, missing answer b. Before answering the question, if the target knowledge graph is first completed to obtain supplementary knowledge including Company A, its employees, and b, then using the completed target knowledge graph to answer the question will yield both answers a and b, improving the accuracy of knowledge graph question answering.

[0036] The following section first explains knowledge graph completion; please refer to [link / reference]. Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the knowledge graph completion method of this application. Specifically, the method may include the following steps:

[0037] Step S110: Determine the first head text entity and the first text relationship of the tail entity to be supplemented from the target knowledge graph.

[0038] The target knowledge graph is the knowledge graph that needs to be completed. A completion operation can be based on a specific text entity and text relationship (such as Company A and its employees in the example above). The search involves checking if a text entity (such as 'b' in the example above) exists in the target knowledge graph that can be used as a tail text entity and associated with the aforementioned text entity through a text relationship. The found text entity can then be used as a tail text entity to construct supplementary knowledge that is currently missing in the target knowledge graph, thus completing the target knowledge graph.

[0039] In some embodiments, the first text entity can be any text entity in the target knowledge graph, and the first text relation can be any text relation in the target knowledge graph.

[0040] In some embodiments, the first head text entity can also be any head text entity in the target knowledge graph.

[0041] It should be noted that the knowledge in a knowledge graph includes head text entities, text relations, and tail text entities, used to represent the semantic relationships between text entities and relation entities. Text entities can exist in text form or in other forms that can represent text meaning. Similarly, text relations can exist in text form or in other forms that can represent text meaning.

[0042] Step S120: Determine the unified representation of the tail entity using the entity representation of the first head text entity and the relation representation of the first text relation.

[0043] It should be noted that a header text entity and a text relation can correspond to one or more tail text entities. For example, the header text entity "Company A" and the relation "Employee" can correspond to multiple tail text entities "A", "B", and "C", indicating that A, B, and C are all employees of Company A. In a certain dimension, a header text entity and several tail text entities corresponding to a relation can be represented by a unified representation. This unified representation of the tail text entities can be determined using the entity representation of the header text entity and the relation representation of the text relation.

[0044] Based on the relationship between the entity representation of the header text entity, the relation representation of the text relation, and the entity representation of the tail text entity in a knowledge set, in order to predict the tail text entity corresponding to the first header text entity and the first text relation, a unified representation of the tail entity can be determined through the entity representation of the first header text entity and the relation representation of the first text relation. The first header text entity and the first text relation can correspond to several target tail text entities. Through the above method, the unified representation of the tail entities of these several target tail text entities corresponding to the first header text entity and the first text relation can be determined, and used to identify these several tail text entities.

[0045] Step S130: Based on the unified tail entity representation prediction, several tail entity prediction representations are obtained.

[0046] Prediction based on the unified representation of tail entities yields several predicted tail entity representations. These tail entity prediction representations can then be used to further determine the target tail text entity. Different predicted tail entity representations can correspond to different target tail text entities or the same target tail text entity.

[0047] In some embodiments, obtaining several tail entity prediction representations based on the unified tail entity representation can be achieved by the following steps: performing multi-channel mapping on the unified tail entity representation using multi-channel mapping parameters to obtain several tail entity prediction representations.

[0048] In a specific application scenario, multi-channel mapping of the unified representation of tail entities using multi-channel mapping parameters can be achieved through the following steps: multiply the multi-channel matrix with the unified representation of tail entities to obtain several predicted representations of tail entities.

[0049] In some embodiments, the unified representation of tail entities can also be processed by other multi-channel mapping methods to obtain several tail entity prediction representations.

[0050] Step S140: Based on several tail entity prediction representations, find the target tail text entity from the target knowledge graph, and use the first head text entity, the first text relation and the target tail text entity to generate supplementary knowledge of the target knowledge graph.

[0051] Each tail entity prediction representation is processed separately, and the target tail text entity corresponding to that tail entity prediction representation is searched in the target knowledge graph. The target tail text entity can represent a text entity in the target knowledge graph found based on the tail entity prediction representation that can be associated with the first head text entity through a first text relation. Thus, the target tail text entity can be used to form a knowledge entry with the first head text entity and the first text relation.

[0052] It should be noted that different tail entity prediction representations can correspond to different text entities in the target knowledge graph, and different tail entity prediction representations can also correspond to the same text entity in the target knowledge graph. Furthermore, the target tail text entities retrieved from the target knowledge graph can include all text entities in the target knowledge graph that can correspond to the first head text entity and the first text relation. This includes tail text entities in the target knowledge graph that belong to the same knowledge item as the first head text entity and the first text relation, as well as text entities in the target knowledge graph that do not constitute knowledge with the first head text entity and the first text relation. After retrieving the target tail text entities corresponding to each tail entity prediction representation in the target knowledge graph, supplementary knowledge can be generated using the first head text entity, the first text relation, and the target tail text entities to complete the target knowledge graph.

[0053] In this embodiment, the relevant steps are used to perform a completion operation, searching for tail text entities that can be associated with the first head text entity and the first text relationship in the target knowledge graph, in order to generate complete knowledge. During the completion process, different first head text entities and first text relationships can be selected, and the above steps can be repeated multiple times.

[0054] The above scheme uses the entity representation of the first head text entity and the relation representation of the first text relation to determine the unified representation of the tail entity. Based on the unified representation of the tail entity, several tail entity prediction representations are predicted. Thus, based on these several tail entity prediction representations, the target tail text entities in the target knowledge graph that can constitute knowledge with the first head text entity and the first text relation can be determined. By utilizing the property of the unified representation of the target tail text entity in a certain dimension, it is possible to simultaneously predict several entity prediction representations, thereby quickly obtaining several entities in the target knowledge graph as target tail text entities and improving the efficiency of knowledge graph completion.

[0055] Please see Figure 2 , Figure 2This is a flowchart illustrating another embodiment of step S120 of this application. Specifically, step S120 may include the following steps:

[0056] Step S221: Perform semantic expansion on the relation representation of the first text relation to obtain the expanded relation representation.

[0057] Specifically, the semantic representation of the first text relation is semantically extended to obtain an extended relation representation, which is then used in subsequent calculations. Semantic extension of the relation representation enriches its meaning, enabling the acquisition of a unified representation of tail entities. This unified representation can contain rich information about several target tail text entities, thus more accurately representing them.

[0058] The knowledge graph completion method in this application can be implemented through a completion model, wherein the relation representation of the first text relation is the input data of the model. During the model runtime, the relation representation is semantically extended so that the relation representation can represent rich meanings while also simplifying the input parameters of the model.

[0059] In some embodiments, semantic expansion of the relation representation of the first text relation to obtain the expanded relation representation can be achieved by the following steps: using a relation semantic expansion matrix to expand the relation representation to obtain the expanded relation representation.

[0060] In some embodiments, the relational representation of the first text relation can also be extended using other data extension methods, not limited to semantic extension using a semantic extension matrix.

[0061] Step S222: Merge the entity representation of the first head text entity with the expanded relational representation to obtain the unified representation of the tail entity.

[0062] In some embodiments, the fusion of the entity representation of the first-head text entity and the extended relational representation to obtain the unified representation of the tail entity can be achieved by the following steps: multiplying the entity representation of the first-head text entity with the extended relational representation to obtain the unified representation of the tail entity.

[0063] In some embodiments, the entity representation of the first-head text entity and the extended relation representation may include, but are not limited to, multiplication, and may also include other methods, such as addition, weighted summation, etc.

[0064] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of step S140 of this application. Specifically, step S140 may include the following steps:

[0065] Step S341: Obtain the first similarity between the tail entity prediction representation and the entity representation of each text entity in the target knowledge graph.

[0066] The process of finding the target tail text entity from the target knowledge graph based on several tail entity prediction representations can be achieved through steps S341 and S342. In steps S341 and S342, each tail entity prediction representation is processed separately, and the first similarity between each tail entity prediction representation and the entity representation of each text entity in the target knowledge graph is obtained.

[0067] Step S342: Select the text entity whose first similarity meets the similarity requirement from the target knowledge graph, and use it as the target tail text entity corresponding to the tail entity prediction representation.

[0068] For each tail entity prediction representation, the text entity whose first similarity with the entity representation of each text entity is selected as the target tail text entity corresponding to the tail entity prediction representation, based on the first similarity between the tail entity prediction representation and the entity representation of each text entity.

[0069] In a specific application scenario, there are three tail entity prediction representations: A, B, and C. Taking tail entity prediction representation A as an example, the target knowledge graph contains text entities a, b, and c. The first similarity between tail entity prediction representation A and the respective entity representations of text entities a, b, and c is obtained. From these, text entity a that meets the first similarity requirement is selected as the target tail text entity corresponding to tail entity prediction representation A. The same processing is performed on tail entity prediction representations B and C to obtain the target tail text entities corresponding to tail entity prediction representations B and C, respectively.

[0070] In some embodiments, the similarity requirement can be the highest possible similarity. The similarity requirement can be adjusted according to the user's actual needs.

[0071] Specifically, for a tail entity prediction representation, the tail entity prediction representation can be multiplied with the entity representation matrix of the target knowledge graph. The entity representation matrix is ​​a matrix composed of all entity representations in the target knowledge graph. The result of the multiplication can reflect the first similarity between the tail entity prediction representation and each entity representation. Based on the result of the multiplication, the target tail text entity corresponding to the tail entity prediction representation can be selected.

[0072] It should be noted that different tail entity prediction representations can correspond to different target tail text entities, or they can correspond to the same target tail text entity.

[0073] Step S343: In response to the absence of knowledge containing the first head text entity, the first text relation, and the target tail text entity in the target knowledge graph, supplementary knowledge of the target knowledge graph is generated using the first head text entity, the first text relation, and the target tail text entity.

[0074] The supplementary knowledge for generating the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity can be achieved through step S343.

[0075] It is understandable that the target knowledge graph may include several pieces of knowledge, including a first head text entity, a first text relation, and a corresponding tail text entity. The target tail text entity may include the tail text entities from the aforementioned pieces of knowledge, as well as text entities not included in the aforementioned pieces of knowledge in the target knowledge graph. Since the target knowledge graph already contains the aforementioned pieces of knowledge, there is no need to generate supplementary knowledge using the first head text entity, the first text relation, and the preceding target tail text entity; only the latter needs to be used. Therefore, when generating supplementary knowledge, it is possible to determine whether the target knowledge graph contains knowledge that includes the first head text entity, the first text relation, and the target tail text entity. If the determination result is that it does not exist, supplementary knowledge is generated using the first head text entity, the first text relation, and the target tail text entity.

[0076] In a specific application scenario, the first head text entity is Company A, and the first text relation is Employee. Based on the first head text entity and the first text relation, the target tail text entities a and b are obtained. Since the target knowledge graph already contains knowledge about Company A, Employee, and a, it is only necessary to generate supplementary knowledge about Company A, Employee, and b.

[0077] The above scheme utilizes the property that the target tail text entities have a unified representation in a certain dimension, which enables the simultaneous prediction of several entity predictions, thereby quickly obtaining several entities in the target knowledge graph as target tail text entities and improving the efficiency of knowledge graph completion.

[0078] Furthermore, for a given text entity and text relation, there may be several corresponding ground truth text entities in the knowledge graph. Compared to the method of obtaining a ground truth text entity through completion, the ground truth text entity labels used in a single training session are fixed. If the target knowledge graph contains two ground truth text entities, and the current prediction is for the second ground truth text entity, but the ground truth label used is for the first ground truth text entity, the ground truth label and the prediction result do not actually correspond. Therefore, the prediction result is considered inaccurate, which is unreasonable. The solution in this application can simultaneously use all ground truth text entities as ground truth labels during training, avoiding the aforementioned situation where the ground truth labels and prediction results do not correspond. While improving efficiency by simultaneously predicting multiple target ground truth text entities, it also improves the accuracy of finding target ground truth text entities.

[0079] Please see Figure 4 , Figure 4 This is a flowchart illustrating another embodiment of the knowledge graph completion method of this application. Specifically, the method may include the following steps:

[0080] Step S410: Based on the entity representation of the second head text entity and the relation representation of the second text relationship in the target knowledge graph, make predictions to obtain several sample tail entity prediction representations.

[0081] It is understood that the knowledge graph completion method in this application is implemented through a completion model. The knowledge graph completion method may also include related steps for training the completion model. In this embodiment, steps S410-S430 are included. After the completion model is trained, the completion model can be used to complete the target knowledge graph. The related steps can refer to the relevant content in the foregoing embodiments, such as steps S120-S130.

[0082] In some embodiments, the completion model can be used to predict several tail entity predictions based on the entity representation of the head text entity and the relation representation of the relation.

[0083] In some embodiments, the completion model can be used to predict several tail entity prediction representations based on the entity representation of the head text entity and the relation representation of the relation, and to determine the corresponding target tail text entity for each tail entity prediction representation.

[0084] Among them, the second head text entity and the second text relation belong to the same knowledge in the target knowledge graph. The target knowledge graph contains tail text entity annotation information, which is used to annotate at least one real tail text entity in the target knowledge graph that forms knowledge with the second head text entity and the second text relation.

[0085] In the target knowledge graph, the head text entity and relation contained in any knowledge can be used as the second head text entity and the second text relation, respectively. There can also be several real tail text entities corresponding to the second head text entity and the second text relation.

[0086] In a specific application scenario, the target knowledge graph contains knowledge containing head text entity A, text relation B, and tail text entity C; knowledge containing head text entity A, text relation B, and tail text entity D; and knowledge containing head text entity A, text relation E, and tail text entity F. If head text entity A is considered the second head text entity, then text relation B can also be considered the second text relation. The tail text entity annotation information is used to identify tail text entities C and D as actual tail text entities. Furthermore, if head text entity A is considered the second head text entity, then text relation E can also be considered the second text relation. The tail text entity annotation information is used to identify tail text entity F as the actual tail text entity.

[0087] The entity representation of the second-head text entity and the relation representation of the second text relationship are randomly initialized before training begins.

[0088] In a specific application scenario, entity representations of all text entities in the target knowledge graph are obtained by randomly initializing parameters. Specifically, the initialization parameters follow a normal distribution of (0, 1). Relation representations of all text relations in the target knowledge graph are also obtained by randomly initializing parameters, again following a normal distribution of (0, 1). From the entity representations of all text entities, the entity representation of the second-headed text entity is selected, and from the relation representations of all text relations, the relation representation of the second-headed text relation is selected for training.

[0089] Specifically, the steps for predicting several sample tail entity predictions based on the entity representation of the second head text entity and the relation representation of the second text relation in the target knowledge graph are the same as those for obtaining several tail entity predictions based on the entity representation of the first head text entity and the relation representation of the first text relation, and can be referred to the relevant content in the foregoing embodiments. In some embodiments, it may include semantically expanding the relation representation of the second text relation to obtain an expanded relation representation, fusing the entity representation of the second head text entity and the expanded relation representation to obtain a unified tail entity representation, and using multi-channel mapping parameters to perform multi-channel mapping on the unified tail entity representation to obtain several sample tail entity predictions.

[0090] Step S420: Determine the target loss based on the predicted tail entity representations of several samples and the tail text entity annotation information.

[0091] Among them, the predicted tail entities of several samples are obtained by completing the model during this training process, and the tail text entity annotation information is the real information of the target knowledge graph annotation. By comparing the two, the target loss can be determined so as to adjust the parameters of the completion model.

[0092] Specifically, let's take the predicted tail text entities output by the completion model as an example. For each sample tail entity prediction representation, we process it separately, obtaining the second similarity between the sample tail entity prediction representation and the entity representations of each text entity in the target knowledge graph. We then select text entities from the target knowledge graph whose second similarity meets the similarity requirement as the predicted tail text entities corresponding to the sample tail entity prediction representation. The predicted tail text entities are the prediction results output by the completion model. The annotation information of the tail text entities is the real information annotated in the target knowledge graph. By comparing the prediction results with the real information, we can obtain the target loss.

[0093] In some embodiments, the target loss can be calculated using, but is not limited to, the cross-entropy loss function.

[0094] In some embodiments, the similarity requirement can be the highest possible similarity. The similarity requirement can also be adjusted according to the user's actual needs.

[0095] In a specific application scenario, predictions are made based on the entity representation of the second-head text entity and the relation representation of the second text relationship in the target knowledge graph, resulting in several sample tail entity prediction representations. For each sample tail entity prediction representation, its second similarity with each text entity in the target knowledge graph is calculated, and the text entity with the highest second similarity is selected as the predicted tail text entity corresponding to that sample tail entity prediction representation. Based on the difference between the predicted tail text entity and the labeled information of the actual tail text entity, the target loss is calculated using the cross-entropy loss function. If the predicted tail text entity is not the actual tail text entity, the loss obtained based on that predicted tail text entity is larger; if the predicted tail text entity is the actual tail text entity, the loss obtained based on that predicted tail text entity is smaller.

[0096] Step S430: Adjust the parameters of the completed model using the target loss.

[0097] The parameters of the completion model include those related to the entity representation of text entities and the relational representation of text relationships in the target knowledge graph.

[0098] In a specific application scenario, the target loss is used to adjust the parameters related to the entity representation of text entities and the relation representation of text relationships in the target knowledge graph, thereby adjusting the entity representation and relation representation of the target knowledge graph.

[0099] Furthermore, the parameters of the complete model also include those used in the calculation of entity and relation representations, such as relation semantic extension matrix, multi-channel mapping parameters, etc.

[0100] It should be noted that the above steps are for one training iteration. The training of the completion model can be performed several times until it meets the requirements, at which point training is considered complete. During the training process, the entity and relation representations in the target knowledge graph are adjusted from randomly initialized parameters. After the model training is complete, the entity and relation representations will be able to accurately represent the text entities and text relations in the target knowledge graph.

[0101] In a specific application scenario, in order to accurately represent all text entities and text relations in the target knowledge graph, during training, the head text entity in each knowledge in the target knowledge graph is used as the second head text entity, and the relations in that knowledge are used as the second text relations, which are used to train the completion model.

[0102] After training the completion model, it can be used to complete the target knowledge graph. In some embodiments, using the completion model for completion may include inputting the entity representation of the first head text entity and the relation representation of the first text relation into the completion model, the completion model using the entity representation of the first head text entity and the relation representation of the first text relation to obtain several tail entity prediction representations, and finding the target tail text entity from the target knowledge graph based on the several tail entity prediction representations as the output of the completion model, so as to generate completed knowledge using the target tail text entity.

[0103] In some embodiments, the output of the completion model can also be several tail entity predictions, which are then used to find the target tail text entity and generate completion knowledge.

[0104] In some embodiments, the training steps of the completion model and the completion using the completion model can be performed by the same device or by two devices sequentially.

[0105] Please see Figure 5 , Figure 5 This is a schematic diagram of an embodiment of the completion model in the knowledge graph completion method of this application.

[0106] In this embodiment, the target knowledge graph includes m text entities. For a single text entity, h(1, h) is used. d ) represents the entity representation of the text entity, h d This represents the encoding dimension of a text entity. For a text relation, using r(1, r...)... d ) represents the relation representation of this text relation, rd The encoding dimension represents the text relationships. All entity representations in the target knowledge graph constitute an entity representation matrix, and all relationship representations constitute a relationship representation matrix. An entity representation and a relationship representation are selected from these matrices and input into the completion model. Before model training, the entity and relationship representation matrices are randomly initialized. During training, these matrices are adjusted to accurately represent text entities and relationships. After training, the entity and relationship representation matrices are obtained, providing accurate representations. During completion, an entity representation and a relationship representation are selected from these matrices for each completion operation.

[0107] The completion model utilizes the relational semantic expansion matrix M r (r d h d ×h d Multiplying r with the relation representation r expands the semantic representation, resulting in the expanded semantic representation r′(1, h). d ×h d ), as shown in the following formula:

[0108] r′=r×M r (1)

[0109] In this embodiment, after obtaining the expanded semantic representation r′, to facilitate subsequent calculations, the expanded semantic representation is further converted into r. e Matrix (h) d h d ), as shown in the following formula:

[0110] r e =reshape(r′) (2)

[0111] Then, semantic representation r is used. e Multiplying the entity representation h of the header text entity yields the unified representation t′(1, h) of the tail entity. d ), as shown in the following formula:

[0112] t′=h×r e (3)

[0113] Then, using the multi-channel matrix M t (n, h) d h d Multi-channel mapping is performed on the unified representation of tail entities to obtain n mapping results, which are n predicted representations of tail entities. n is a hyperparameter of the completion model, which determines the upper limit of the number of target tail text entities, as shown in the following formula:

[0114] T = t′ × M t (4)

[0115] Where T = {t1, t2, t3, ..., t} n}, t i Let T represent the set of tail entity prediction representations. Different tail entity prediction representations can correspond to different target tail text entities, or they can correspond to the same target tail text entity.

[0116] In some embodiments, after obtaining n tail entity prediction representations, the completion model can also multiply the n tail entity prediction representations with the entity representation matrix of the target knowledge graph, and pass the product result through a max pooling layer to select the corresponding target tail text entity for each tail entity prediction representation. This yields all tail text entities in the target knowledge graph that can constitute knowledge with the input text entities and text relationships, which can be used to generate completed knowledge.

[0117] Please see Figure 6 , Figure 6 This is a flowchart illustrating an embodiment of the question-and-answer method of this application. Specifically, the method may include the following steps:

[0118] Step S610: Using the representation of the first head text entity and the first text relationship of the tail entities to be supplemented in the target knowledge graph, predict the predicted representation of several tail entities.

[0119] Step S620: Based on several tail entity prediction representations, find the target tail text entity from the target knowledge graph, and use the first head text entity, the first text relation and the target tail text entity to generate supplementary knowledge of the target knowledge graph.

[0120] Generating supplementary knowledge is the step of completing the target knowledge graph. The completion of the target knowledge graph can be achieved through the aforementioned knowledge graph completion method. For details, please refer to the relevant content in the aforementioned embodiments, which will not be elaborated here.

[0121] Step S630: Obtain the questions to be answered.

[0122] Step S640: Based on the question representation of the question to be answered, find the knowledge that matches the question to be answered from the knowledge-supplemented target knowledge graph.

[0123] By understanding the question to be solved, a problem representation can be obtained. For example, a text processing model can be used to process the question to obtain the problem representation. Text processing models can include, but are not limited to, the BERT model.

[0124] In some embodiments, step S640 can be implemented by the following steps:

[0125] By utilizing the representations of each text entity in the target knowledge graph, we can find related entities that are relevant to the target entity in the problem to be solved, and obtain at least one piece of knowledge containing related entities in the target knowledge graph as the knowledge to be matched with the problem to be solved.

[0126] The question to be answered contains a target entity, and the answer to the question is associated with the target entity. For example, the question "What employees does Company A have?" contains the knowledge entity "Company A," which can also be used as the target entity. The question representation can include a representation of the target entity. By comparing the representation of the target entity with the representations of various text entities in the target knowledge graph, it is possible to find the associated entities in the text entities of the target knowledge graph that match the target entity. Thus, the knowledge containing associated entities can be used as knowledge that matches the question to obtain the answer.

[0127] In a specific application scenario, the related entity "Company A" that matches the target entity "Company A" is found in the target knowledge graph. Thus, the knowledge of "Company A" in the target knowledge graph is used as knowledge to match the question to be answered. For example, it may contain knowledge of Company A, employees, and b; or it may contain knowledge of Company A, employees, and a; or it may contain knowledge of Company A, registered capital, and 1 million.

[0128] In some embodiments, the target entity and the associated entity may be the same; for example, both the target entity and the associated entity may be "Company A". In other embodiments, the target entity and the associated entity may have some differences, but they represent the same meaning. For example, the target entity may be "Company A" and the associated entity may be "A Corporation Limited". Although there are some differences in their text, they have the same meaning.

[0129] Step S650: Obtain the answer to the question based on the knowledge matched to the question to be answered.

[0130] In a specific application scenario, the question to be answered is "Who are the employees of Company A?". Before completion, the target knowledge graph contains knowledge of Company A, employees, and 'a'. After completion, the target knowledge graph contains knowledge of Company A, employees, and 'a', as well as knowledge of Company A, employees, and 'b'. If the target knowledge graph is used to solve the problem before completion, only 'a' can be obtained as the answer. After completion, the target knowledge graph can be used to solve the problem, yielding both 'a' and 'b' as answers.

[0131] By completing the target knowledge graph, missing relationships can be filled in, thereby obtaining more accurate results for knowledge graph question answering and improving the accuracy of knowledge graph question answering.

[0132] The aforementioned scheme leverages the unified representation of target tail text entities across a specific dimension to simultaneously predict the representations of several entities. This allows for the rapid acquisition of several entities from the target knowledge graph as target tail text entities, improving the efficiency of knowledge graph completion and further enhancing the accuracy and efficiency of question answering. Furthermore, the completion method in this application also improves the accuracy of knowledge graph completion, further enhancing the accuracy of question answering using the completed knowledge graph.

[0133] Please see Figure 7 , Figure 7 This is a schematic diagram of the framework of an embodiment of the knowledge graph completion device of this application.

[0134] In this embodiment, the knowledge graph completion device 70 includes a determination module 71, a representation module 72, a prediction module 73, and a completion module 74. The determination module 71 is used to determine the first head text entity and the first text relation of the tail entity to be supplemented from the target knowledge graph. The representation module 72 is used to determine the unified representation of the tail entity using the entity representation of the first head text entity and the relation representation of the first text relation. The prediction module 73 is used to predict several tail entity prediction representations based on the unified tail entity representation. The completion module 74 is used to find the target tail text entity from the target knowledge graph based on the several tail entity prediction representations, and generate supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity.

[0135] The representation module 72 includes an extension submodule and a fusion submodule. The extension submodule is used to semantically extend the relation representation of the first text relation to obtain an extended relation representation. The fusion submodule is used to fuse the entity representation of the first head text entity with the extended relation representation to obtain a unified tail entity representation.

[0136] The extension submodule is used to semantically extend the relation representation of the first text relation to obtain the extended relation representation. Specifically, it includes: using the relation semantic extension matrix to extend the relation representation to obtain the extended relation representation.

[0137] The fusion submodule is used to fuse the entity representation of the first text entity with the extended relational representation to obtain a unified representation of the tail entity. Specifically, it includes multiplying the entity representation of the first text entity with the extended relational representation to obtain a unified representation of the tail entity.

[0138] The prediction module 73 is used to predict several tail entity prediction representations based on the unified tail entity representation. Specifically, it includes: performing multi-channel mapping on the unified tail entity representation using multi-channel mapping parameters to obtain several tail entity prediction representations.

[0139] The completion module 74 includes a search submodule, which is used to find the target tail text entity from the target knowledge graph based on several tail entity prediction representations. Specifically, it includes: for each tail entity prediction representation, obtaining the first similarity between the tail entity prediction representation and the entity representation of each entity in the target knowledge graph; and selecting entities from the target knowledge graph whose first similarity meets the similarity requirement as the target tail text entity corresponding to the tail entity prediction representation.

[0140] The completion module 74 includes a generation submodule, which is used to generate supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity. Specifically, it includes generating supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity in response to the absence of knowledge containing the first head text entity, the first text relation, and the target tail text entity in the target knowledge graph.

[0141] The knowledge graph completion method is implemented through a completion model. The knowledge graph completion device also includes a training module for training the completion model. Specifically, the training module is used to predict the tail entity prediction representation based on the entity representation of the second head text entity and the relation representation of the second text relationship in the target knowledge graph. The target knowledge graph contains tail text entity annotation information, which is used to annotate at least one real tail text entity in the target knowledge graph that forms knowledge with the second head text entity and the second text relationship. Based on the tail entity prediction representation and the tail text entity annotation information, the target loss is determined. The parameters of the completion model are adjusted using the target loss. The parameters of the completion model include parameters related to the entity representation of the entity and the relation representation of the relationship in the target knowledge graph.

[0142] Specifically, the target loss is determined based on several sample tail entity prediction representations and tail text entity annotation information, including: for each sample tail entity prediction representation, obtaining the second similarity between the sample tail entity prediction representation and the entity representation of each entity in the target knowledge graph; selecting entities from the target knowledge graph whose second similarity meets the similarity requirement as the predicted tail text entities corresponding to the sample tail entity prediction representations; and determining the target loss based on the predicted tail text entities and tail text entity annotation information.

[0143] Please see Figure 8 , Figure 8 This is a schematic diagram of the framework of an embodiment of the question-and-answer device of this application.

[0144] In this embodiment, the question-answering device 80 includes a prediction module 81, a completion module 82, an acquisition module 83, a matching module 84, and a question-answering module 85.

[0145] The prediction module 81 is used to predict several tail entity prediction representations by using the representations of the first head text entity and the first text relation of the tail entity to be supplemented in the target knowledge graph. The completion module 82 is used to find the target tail text entity from the target knowledge graph based on the several tail entity prediction representations, and generate supplementary knowledge of the target knowledge graph by using the first head text entity, the first text relation and the target tail text entity. The acquisition module 83 is used to acquire the question to be answered. The matching module 84 is used to find the knowledge that matches the question to be answered from the knowledge-supplemented target knowledge graph based on the question representation of the question to be answered. The question answering module 85 is used to obtain the answer to the question to be answered based on the knowledge matched to the question to be answered.

[0146] Among them, the matching module 84 is used to search for knowledge that matches the question to be answered from the knowledge-supplemented target knowledge graph based on the question representation of the question to be answered, specifically including:

[0147] By utilizing the representations of each text entity in the target knowledge graph, we can find related text entities that are relevant to the target text entities in the question to be answered; and obtain at least one piece of knowledge in the target knowledge graph that contains related text entities as the knowledge to be matched with the question to be answered.

[0148] Please see Figure 9 , Figure 9 This is a schematic diagram of the framework of an embodiment of the electronic device of this application.

[0149] In this embodiment, the electronic device 90 includes a memory 91 and a processor 92, wherein the memory 91 is coupled to the processor 92. Specifically, the various components of the electronic device 90 can be coupled together via a bus, or the processor 92 of the electronic device 90 can be connected to each other component individually. The electronic device 90 can be any device with processing capabilities, such as a computer, tablet computer, mobile phone, etc.

[0150] The memory 91 is used to store program data executed by the processor 92, as well as data generated by the processor 92 during processing. Examples include entity representations, relational representations, and tail entity prediction representations. The memory 91 includes a non-volatile storage portion for storing the aforementioned program data.

[0151] Processor 92 controls the operation of electronic device 90. Processor 92 can also be called CPU (Central Processing Unit). Processor 92 may be an integrated circuit chip with signal processing capabilities. Processor 92 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. General-purpose processor can be a microprocessor or any conventional processor. In addition, processor 92 can be implemented by multiple integrated circuit chips.

[0152] The processor 92 executes instructions by calling the program data stored in the memory 91 to implement any of the above knowledge graph completion methods or question-answering methods.

[0153] Please see Figure 10 , Figure 10 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application.

[0154] In this embodiment, the computer-readable storage medium 100 stores processor-executable program data 101, which can be executed to implement any of the above-described knowledge graph completion methods or question-answering methods.

[0155] The computer-readable storage medium 100 can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium that can store program data. Alternatively, it can be a server that stores the program data, which can send the stored program data to other devices for execution or run the stored program data itself.

[0156] In some embodiments, the computer-readable storage medium 100 may also be such as Figure 9 The memory shown.

[0157] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A question-and-answer method, characterized in that, include: By using the representation of the first text entity and the first text relationship of the tail entity to be supplemented in the target knowledge graph, several tail entity prediction representations are obtained. Based on the predicted representation of the aforementioned tail entities, target tail text entities are found from the target knowledge graph, and supplementary knowledge of the target knowledge graph is generated using the first head text entity, the first text relation, and the target tail text entity. Get the questions to be answered; Based on the question representation of the question to be answered, knowledge matching the question is retrieved from the target knowledge graph that has been supplemented with knowledge. The answer to the question is obtained based on the knowledge matched with the question to be answered; The step of predicting several tail entity prediction representations by utilizing the representations of the first head text entity and the first text relation of the tail entities to be supplemented in the target knowledge graph includes: The semantic representation of the first text relation is semantically extended to obtain the extended relation representation. By fusing the entity representation of the first head text entity with the extended relational representation, a unified representation of the corresponding tail entity is obtained; Based on the unified tail entity representation, several tail entity prediction representations are obtained.

2. The method according to claim 1, characterized in that, The step of searching for knowledge matching the unanswered question from the supplemented target knowledge graph based on the question representation of the unanswered question includes: Using the representations of each text entity in the target knowledge graph, we can find related text entities that are relevant to the target text entity in the question to be answered. Obtain at least one piece of knowledge containing the associated text entity from the target knowledge graph, and use it as knowledge to match the question to be answered.

3. A knowledge graph completion method, characterized in that, The method includes: Identify the first text entity and the first text relationship of the tail entity to be supplemented from the target knowledge graph; The semantic representation of the first text relation is semantically extended to obtain the extended relation representation. By fusing the entity representation of the first head text entity with the extended relational representation, a unified representation of the corresponding tail entity is obtained; Based on the unified tail entity representation, several tail entity prediction representations are obtained. Based on the predicted representation of the aforementioned tail entities, target tail text entities are found from the target knowledge graph, and supplementary knowledge of the target knowledge graph is generated using the first head text entity, the first text relation, and the target tail text entity.

4. The method according to claim 3, characterized in that, The semantic extension of the relation representation of the first text relation to obtain the extended relation representation includes: The relation representation is extended using a relation semantic extension matrix to obtain the extended relation representation. And / or, the fusion of the entity representation of the first header text entity and the expanded relational representation to obtain the unified representation of the tail entity includes: Multiply the entity representation of the first head text entity by the extended relational representation to obtain the unified representation of the tail entity.

5. The method according to claim 3, characterized in that, The prediction based on the unified tail entity representation yields several tail entity prediction representations, including: The tail entity unified representation is mapped using multi-channel mapping parameters to obtain several tail entity predicted representations.

6. The method according to claim 3, characterized in that, The prediction based on the plurality of tail entities represents finding the target tail text entities from the target knowledge graph, including: For each tail entity prediction representation, a first similarity is obtained between the tail entity prediction representation and the entity representations of each text entity in the target knowledge graph; and Select the text entities whose first similarity meets the similarity requirement from the target knowledge graph, and use them as the target tail text entities corresponding to the tail entity prediction representation; And / or, the supplementary knowledge for generating the target knowledge graph using the first head text entity, the first text relation, and the target tail text entity includes: In response to the absence of knowledge containing the first head text entity, the first text relation, and the target tail text entity in the target knowledge graph, supplementary knowledge of the target knowledge graph is generated using the first head text entity, the first text relation, and the target tail text entity.

7. The method according to claim 3, characterized in that, The knowledge graph completion method is implemented through a completion model, and the method further includes the following steps to train the completion model: Based on the entity representation of the second head text entity and the relation representation of the second text relation in the target knowledge graph, prediction is performed to obtain several sample tail entity prediction representations. The target knowledge graph contains tail text entity annotation information, which is used to annotate at least one real tail text entity in the target knowledge graph that forms knowledge with the second head text entity and the second text relation. Based on the predicted tail entity representations of the aforementioned samples and the tail text entity annotation information, the target loss is determined; The parameters of the completion model are adjusted using the target loss, and the parameters of the completion model include parameters related to the entity representation of text entities and the relation representation of text relationships in the target knowledge graph.

8. The method according to claim 7, characterized in that, The determination of the target loss based on the predicted tail entity representations of the several samples and the tail text entity annotation information includes: For each of the sample tail entity prediction representations, obtain the second similarity between the sample tail entity prediction representation and the entity representation of each text entity in the target knowledge graph; Select text entities whose second similarity meets the similarity requirement from the target knowledge graph, and use them as the predicted tail text entities corresponding to the predicted representation of the sample tail entities; The target loss is determined based on the predicted tail text entity and the tail text entity annotation information.

9. A question-and-answer device, characterized in that, include: The prediction module is used to predict several tail entity prediction representations by using the representation of the first head text entity and the first text relationship of the tail entity to be supplemented in the target knowledge graph. The completion module is used to find the target tail text entity from the target knowledge graph based on the predicted representation of the several tail entities, and to generate supplementary knowledge of the target knowledge graph using the first head text entity, the first text relation and the target tail text entity. The retrieval module is used to retrieve questions to be answered. The matching module is used to find knowledge that matches the question to be answered from the target knowledge graph supplemented with knowledge, based on the question representation of the question to be answered; The question-answering module is used to obtain the answer to the question based on the knowledge matched to the question to be answered; The prediction module uses the representation of the first-head text entity and the first text relation of the tail entities to be supplemented in the target knowledge graph to predict several tail entity prediction representations, including: The semantic representation of the first text relation is semantically extended to obtain the extended relation representation. By fusing the entity representation of the first head text entity with the extended relational representation, a unified representation of the corresponding tail entity is obtained; Based on the unified tail entity representation, several tail entity prediction representations are obtained.

10. A knowledge graph completion device, characterized in that, include: The determination module is used to determine the first head text entity and the first text relationship of the tail entity to be supplemented from the target knowledge graph; The representation module is used to semantically extend the relation representation of the first text relation to obtain the extended relation representation. By fusing the entity representation of the first head text entity with the extended relational representation, a unified representation of the corresponding tail entity is obtained; The prediction module is used to predict several tail entity prediction representations based on the unified tail entity representation; The completion module is used to find the target tail text entity from the target knowledge graph based on the predicted representation of the plurality of tail entities, and to generate supplementary knowledge of the target knowledge graph using the first head text entity, the first text relationship and the target tail text entity.

11. An electronic device, characterized in that, It includes a memory and a processor that are coupled to each other, the processor being used to execute program instructions stored in the memory to implement the question-answering method of any one of claims 1 to 2 or the knowledge graph completion method of any one of claims 3 to 8.

12. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the question-answering method of any one of claims 1 to 2 or the knowledge graph completion method of any one of claims 3 to 8.