A knowledge graph completion method and device for alleviating sparsity

By constructing auxiliary triples, using large language models and discriminator filtering, fusing neighbor information and adopting a dynamic suppression strategy, the problem of decreased accuracy of intelligent question-answering systems caused by the sparsity of knowledge graphs is solved, and the ability to answer rare entity questions is improved.

CN119623598BActive Publication Date: 2025-10-17CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411770810.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-10-17
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

Existing knowledge graphs, when faced with sparsity problems, find it difficult to effectively answer questions about rare entities, resulting in a decrease in the accuracy of intelligent question-answering systems.

Method used

The completion performance of knowledge graphs is improved by constructing auxiliary triples, using a large language model for instruction fine-tuning and discriminator filtering, fusing neighbor information and adopting a dynamic suppression strategy.

Benefits of technology

It improves the system's ability to answer questions about rare entities and enhances the completeness and accuracy of the knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623598B_ABST
    Figure CN119623598B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses a knowledge graph completion method and device for relieving sparsity, which comprises the following steps: constructing auxiliary triplets; using the data of an original knowledge graph to perform instruction fine-tuning on a large language model to obtain a discriminator; filtering the auxiliary triplets by using the discriminator, fusing the filtered triplets with the original knowledge graph, and obtaining an enhanced knowledge graph; performing message aggregation on the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information; using a dynamic suppression strategy to correct the loss in the graph structure representation of fused neighbor information, improving the performance of the model on the knowledge graph completion task, and obtaining an adjusted knowledge graph. The knowledge graph completion method and device for relieving sparsity can effectively mine entity information similar to rare entities through the construction of a similarity matrix and auxiliary triplets, thereby improving the answering capability of the system for rare entity problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for completing a knowledge graph to alleviate sparsity. Background Art

[0002] A knowledge graph is a knowledge base that stores entities and relationships in a graph format. Data is stored as triples. Through knowledge representation and reasoning techniques, it can provide intelligent systems with processed prior knowledge, enhancing the system's cognitive intelligence. Therefore, it has been widely used in many fields, including information retrieval, question-answering systems, and recommender systems. Although existing knowledge graphs already contain millions of facts, they still suffer from graph incompleteness, which severely limits the performance of downstream tasks. To alleviate this problem, the knowledge graph completion task (KGC) has emerged.

[0003] The knowledge graph completion task is to automatically predict the missing information in a given triple based on the known fact triple information in the knowledge graph, thereby mining new information to continuously expand and improve the knowledge graph.

[0004] In intelligent question-answering systems, the completeness of the knowledge graph is crucial for accurately answering complex user questions. Knowledge graph completion technology allows the system to automatically infer and fill gaps in the knowledge graph, thereby improving the system's understanding of questions and the accuracy of its responses. However, when intelligent question-answering systems need to answer questions about rare entities, the sparsity of the knowledge graph may prevent the system from providing accurate answers. Summary of the Invention

[0005] In response to the deficiencies in the prior art, the present invention proposes a knowledge graph completion method and device that alleviates sparsity, in order to solve the above technical problems.

[0006] First, a knowledge graph completion method is provided to alleviate sparsity, including:

[0007] Construct auxiliary triples;

[0008] Use the original knowledge graph data to fine-tune the large language model to obtain the discriminator;

[0009] The auxiliary triples are filtered using the discriminator, and the filtered triples are fused with the original knowledge graph to obtain an enhanced knowledge graph;

[0010] Performing message aggregation on the enhanced knowledge graph to obtain a graph structure representation that integrates neighbor information;

[0011] A dynamic suppression strategy is used to correct the loss in the graph structure representation result of the fused neighbor information, improve the performance of the model in the knowledge graph completion task, and obtain an adjusted knowledge graph.

[0012] Furthermore, the constructing of the auxiliary triplet includes:

[0013] Encode the text description of the entity in the original knowledge graph to obtain an n-dimensional sentence vector;

[0014] Calculate the cosine similarity between all sentence vectors and construct a similarity matrix;

[0015] When the triple in the original knowledge graph contains sparse entities, the entity most similar to the sparse entity in the similarity matrix is ​​used to replace the head or tail entity in the original triple to construct an auxiliary triple.

[0016] Furthermore, the method uses the original knowledge graph data to fine-tune the large language model to obtain a discriminator, including:

[0017] Train the triples in the original knowledge graph to obtain the structural embedding representation of the triples;

[0018] Project the triplet's structural embedding representation into the text token representation space of the large language model to construct the instruction prefix;

[0019] The input sequence with the instruction prefix is ​​used to fine-tune the instruction of the large language model to obtain a discriminator. Furthermore, the auxiliary triples are filtered by the discriminator, and the filtered triples are fused with the original knowledge graph to obtain an enhanced knowledge graph, including:

[0020] Input the constructed auxiliary triples into the discriminator, predict the authenticity of the auxiliary triples, and obtain the auxiliary triples whose discriminant results are true;

[0021] The true auxiliary triples are fused with the original knowledge graph to obtain the enhanced knowledge graph.

[0022] Furthermore, the enhanced knowledge graph is subjected to message aggregation to obtain a graph structure representation integrating neighbor information, including:

[0023] Calculate the importance of neighbor triples to the entities in the enhanced knowledge graph, that is, the attention score;

[0024] Normalize the attention scores to obtain the weight coefficients;

[0025] The weight coefficient is used to perform weighted summation on the embedding representations of neighboring entities and fuse them with the embedding representation of the current entity to obtain the updated entity embedding representation;

[0026] The above steps are repeated until the embedding representations of all entities are updated, obtaining a graph structure representation of fused neighbor information.

[0027] Further, the dynamic suppression strategy is used to correct the loss in the graph structure representation result of the fused neighbor information, improve the performance of the model on the knowledge graph completion task, and obtain an adjusted knowledge graph, including:

[0028] Define an input query pair, including entities and relationships, and corresponding labels;

[0029] According to the input query pair and the label, construct a positive sample set, a negative sample set, and an auxiliary triple sample set for enhancing the knowledge graph;

[0030] Introduce a weight to correct the loss and adjust the strength of knowledge graph enhancement, wherein the value of the weight is dynamically adjusted according to the sample type and the loss size;

[0031] When the sample belongs to the auxiliary triple sample set and its loss is greater than a preset threshold, the weight of the corresponding sample is reduced;

[0032] According to the corrected dynamic loss function, train the entire model until a predetermined training termination condition is reached, obtaining an adjusted knowledge graph.

[0033] In a second aspect, a knowledge graph completion device for alleviating sparsity is provided, characterized in that it comprises:

[0034] A construction module for constructing auxiliary triples;

[0035] A fine-tuning module for fine-tuning a large language model with instructions using data from the original knowledge graph to obtain a discriminator;

[0036] A filtering module for filtering the auxiliary triples using the discriminator and fusing the filtered triples with the original knowledge graph to obtain an enhanced knowledge graph;

[0037] An aggregation module for aggregating messages from the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information;

[0038] A correction module for correcting the loss in the graph structure representation result of the fused neighbor information using a dynamic suppression strategy to improve the performance of the model on the knowledge graph completion task and obtain an adjusted knowledge graph.

[0039] Further, a knowledge graph completion device for alleviating sparsity includes a processor and a memory storing program instructions, wherein the processor is configured to execute a knowledge graph completion method for alleviating sparsity as described in any one of the preceding embodiments when running the program instructions.

[0040] In a third aspect, an electronic device is provided, comprising the knowledge graph completion device for alleviating sparsity described above.

[0041] The application has the following advantages by adopting the technical scheme:

[0042] The application effectively mines entity information similar to the rare entity by constructing the similarity matrix and the auxiliary triple, thereby improving the answering capability of the system for the rare entity problem. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the specific embodiments of the present application, the drawings required to be used in the specific embodiments will be briefly introduced below. In all the drawings, the elements or parts are not necessarily drawn according to the actual proportions.

[0044] Fig. 1 A flowchart of the knowledge graph completion method for alleviating sparsity of the present application;

[0045] Fig. 2 A flowchart of the knowledge graph enhancement module and the loss-constrained KGE model in the knowledge graph completion method for alleviating sparsity of the present application;

[0046] Fig. 3 A flowchart of the knowledge graph completion device for alleviating sparsity of the present application. DETAILED DESCRIPTION

[0047] The embodiments of the technical scheme of the present application will be described in detail below with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical scheme of the present application, and therefore only serve as examples, but cannot limit the protection scope of the present application.

[0048] As shown in Figs. 1-3 A knowledge graph completion method for alleviating sparsity of the present application comprises the following steps:

[0049] Step S01, constructing an auxiliary triple;

[0050] Step S02, using the data of the original knowledge graph to fine-tune the instruction of the large language model to obtain a discriminator;

[0051] Step S03, using the discriminator to filter the auxiliary triple, and fusing the filtered triple with the original knowledge graph to obtain an enhanced knowledge graph;

[0052] Step S04, performing message aggregation on the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information;

[0053] Step S05, the loss in the graph structure representation result of the fusion neighbor information is corrected by adopting a dynamic inhibition strategy, the performance of the model on the knowledge graph completion task is improved, and an adjusted knowledge graph is obtained.

[0054] Specifically, the application effectively mines entity information similar to the rare entity through the construction of the similarity matrix and the auxiliary triple, thereby improving the answering ability of the system to the rare entity problem.

[0055] Specifically, the knowledge graph completion method proposed by the application mainly includes two modules. The first module is a knowledge graph enhancement module, which focuses on constructing useful auxiliary triples using a large language model according to the structure and text description of sparse entities, to enhance the knowledge graph and promote message passing between sparse entities. The second module is a loss-constrained KGE model, which introduces an adaptive message aggregation mechanism and a loss constraint strategy, so that the model focuses on more important neighbor information and dynamically adjusts the enhancement strength of the knowledge graph, to effectively perform the knowledge graph completion task.

[0056] In some embodiments, the auxiliary triple is constructed, including:

[0057] The text description of the entity in the original knowledge graph is encoded to obtain an n-dimensional sentence vector;

[0058] The cosine similarity between all sentence vectors is calculated to construct a similarity matrix;

[0059] When the triple in the original knowledge graph contains a sparse entity, the head or tail entity in the original triple is replaced by the most similar entity in the similarity matrix to the sparse entity, and an auxiliary triple is constructed.

[0060] Specifically, the knowledge graph enhancement module

[0061] First, for the entities in the sparse area, the steps of automatically constructing the auxiliary triple designed by the application are as follows:

[0062] The text description of all entities is encoded using the Sentence-Bert model to obtain an n-dimensional sentence vector.

[0063] The cosine similarity between all sentence vectors is calculated to obtain a similarity matrix A sim ∈R N×N where N = |ε| is the number of all entities. This process is represented as follows:

[0064]

[0065] where D i represents the sentence vector obtained by encoding the description text of entity i using the Sentence-Bert model.

[0066] Then, in a triple, when the head / tail entity is a sparse entity, the tail / head entity is replaced by its k most similar entities, thereby constructing an auxiliary triple.

[0067] For example, when k is 1, in the triple (London, / location / location / contains, University of London), the "University of London" entity is a sparse entity.

[0068] According to the similarity matrix A sim , the entity "City of London" has the most similar semantics to "London". By replacing "London" with "City of London", a new auxiliary triple (City of London, / location / location / contains, University of London) is obtained, thereby enriching the structural information of the sparse entity "University of London".

[0069] In some embodiments, the large language model is instructed fine-tuned using the data of the original knowledge graph to obtain a discriminator, including:

[0070] The triples in the original knowledge graph are trained to obtain a structural embedding representation of the triples;

[0071] The structural embedding representation of the triples is projected into the text token representation space of the large language model to construct an instruction prefix;

[0072] The large language model is instructed fine-tuned using the input sequence with the instruction prefix to obtain the discriminator.

[0073] In some embodiments, the discriminator is used to filter auxiliary triples, and the filtered triples are fused with the original knowledge graph to obtain an enhanced knowledge graph, including:

[0074] The constructed auxiliary triples are input into the discriminator to predict the authenticity of the auxiliary triples, and auxiliary triples with a true discrimination result are obtained;

[0075] The true auxiliary triples are fused with the original knowledge graph to obtain an enhanced knowledge graph.

[0076] Specifically, the step of using a large model as a discriminator to filter the triples constructed in the above steps is as follows:

[0077] First, the RotatE model is used to train all triples in the knowledge graph to obtain the structural embedding representation of entities and relations. In this stage, the optimization objective is as follows:

[0078]

[0079] where γ is a fixed boundary parameter, σ1 represents the sigmoid activation function, and (s' i ,r,o' i ) represents the i-th negative sample of the triple (s, r, o). The definition of the scoring function is as follows:

[0080]

[0081] where represents the Hadmard product.

[0082] After obtaining the structural embedding representation of entities and relations, the Alpaca large language model is fine-tuned using knowledge graph data.

[0083] When fine-tuning Alpaca, each triple is taken as a sample.

[0084] Taking triple (s, r, o) as an example, the prefix adapter P is used to project the structural embedding of s, r, and o into the text token representation space of Alpaca, obtaining virtual text tokens.

[0085] Then, these virtual tokens are placed at the beginning of the original input sequence as the prefix of the instruction. The final input sequence of the Alpaca model is as follows:

[0086]

[0087] where represents the concatenation operation, I it is the instruction token embedding from the instruction template. and represent the text token embedding of the text name from entity s, relation r, and entity o, respectively.

[0088] When fine-tuning, the output of the Alpaca model is "True" or "False". The output represents the authenticity of the input triple.

[0089] After fine-tuning, a discriminator with the ability to distinguish the authenticity of triples is obtained.

[0090] Then, the auxiliary triples constructed in the above content are input into the large model discriminator to predict the authenticity of each auxiliary triple, and filtering operations are performed on all auxiliary triples.

[0091] Finally, the triplets whose discriminative results are true are reserved and fused with the original knowledge graph to enhance the knowledge graph.

[0092] In some embodiments, the enhanced knowledge graph is subjected to message aggregation to obtain a graph structure representation fused with neighbor information, including:

[0093] The importance of neighbor triplets to entities in the enhanced knowledge graph, i.e. attention scores, are calculated;

[0094] The attention scores are normalized to obtain weight coefficients;

[0095] The embedding representations of neighbor entities are weighted and summed using the weight coefficients, and fused with the embedding representation of the current entity to obtain an updated entity embedding representation;

[0096] The above steps are repeated until the embedding representations of all entities are updated, and a graph structure representation fused with neighbor information is obtained.

[0097] Specifically, the loss constrains the KGE module

[0098] An adaptive message aggregation mechanism designed by the present application is used to automatically learn and focus on neighbors that are crucial to the central entity, and the steps are as follows:

[0099] Given an entity s, the set of neighbors directly connected to it is The set of relationships directly connected is represents the edge connected to entity s and neighbor entity u.

[0100] First, the importance of each neighbor triplet to entity s, i.e. the attention score b s,r,o , is calculated. attn The node representation of entity s, the representation of relationship r and the node representation of entity o are concatenated, and the concatenated representation is linearly transformed by W s,r,o , and finally activated by a 2 activation function to obtain the attention score b s,r,o . Its formula is as follows:

[0101] b attn = a 2 (W s [h r ||h o ])

[0102] Where || represents concatenation operation, 2 denotes LeakyReLU activation function, and denote linear transformation.

[0103] Then, the attention score b s,r,oSoftmax normalization is performed to obtain weight coefficients a s,r,o :

[0104]

[0105] Next, the node representation h o of the adjacent entity o and the representation h r of its corresponding relationship r are combined to obtain the combined representation h r , which is then linearly transformed. Then, according to the weight coefficients a s,r,o obtained in the previous step, the combined representation h res is weighted and summed with W s . Finally, the updated node representation of the entity s is obtained through a Tanh activation function. The message aggregation method of the entity s is defined as:

[0106]

[0107] where σ3 represents the Tanh activation function, and the combination operator is a cyclic correlation operation, which is defined as follows:

[0108] (h o ,h r )=h o ★h r

[0109] W res ∈R d×d is a self-loop relationship parameter, and W r is a relationship type-specific parameter, which is defined as follows:

[0110]

[0111] where W O represents the parameter corresponding to the forward relationship, and W I represents the parameter corresponding to the reverse relationship.

[0112] Finally, after the embedding representation of the entity is updated, the embedding representation of the relationship is updated, and the formula is as follows:

[0113] h′ r =W rel h r

[0114] where W rel ∈R d×d is a trainable parameter matrix of the relationship embedding.

[0115] In some embodiments, a dynamic suppression strategy is used to correct the loss in the graph structure representation result of integrating neighbor information, thereby improving the performance of the model in the knowledge graph completion task and obtaining an adjusted knowledge graph, including:

[0116] Define input query pairs, including entities and relations, and corresponding labels;

[0117] According to the input query pair and label, construct a positive sample set, a negative sample set and an auxiliary triplet sample set for enhancing the knowledge graph;

[0118] Introduce weights to correct the loss and adjust the strength of knowledge graph enhancement.

[0119] Among them, the value of the weight is dynamically adjusted according to the sample type and its loss size;

[0120] When a sample belongs to the auxiliary triplet sample set and its loss is greater than a preset threshold, the weight of the corresponding sample is reduced;

[0121] According to the modified dynamic loss function, the entire model is trained until the predetermined training termination condition is reached to obtain the adjusted knowledge graph.

[0122] Specifically, the dynamic loss suppression strategy designed by the present invention is used to correct the loss, adjust the enhancement strength of the knowledge graph, and train the entire model. The specific steps are as follows:

[0123] First, define the input query pair as (e s ,r), where entity e s ∈ε, relation

[0124] Label in N is the number of entities |ε|.

[0125] For label y, samples can be divided into the following three types:

[0126]

[0127] in, represents the positive sample set, represents the negative sample set, Represents the auxiliary triplet sample set used to enhance the knowledge graph.

[0128] Next, we introduce a weight β i Correct the loss, adjust the strength of knowledge graph enhancement, and reduce The impact of false positive samples in the sample set on training. The modified dynamic loss function is defined as follows:

[0129]

[0130] wherein, denotes the triplets in the same training batch, and φ is the scoring function ConvE. BCELoss(·) represents the binary cross-entropy loss.

[0131] The weight β is dynamically adjusted in the training process i The size of the sample belongs to , and the loss of the sample is greater than the threshold value R (t) , the corresponding weight β i is reduced.

[0132]

[0133] wherein, t represents the iteration number of the current training, the threshold value R (t) is the loss value of the top [(t-1) / 30·γ] % in the loss set γ is a hyperparameter that determines the growth rate of the dynamic loss suppression.

[0134] Specifically, the knowledge graph completion method according to the present application can effectively improve the prediction performance of the model in the sparse area and alleviate the impact of sparsity.

[0135] At the same time, the method of using the fine-tuned large model as a triplet discriminator to enhance the knowledge graph proposed in the present application is different from the traditional graph enhancement method, which does not need to manually design complex rules to construct triplets, but uses the discriminator to filter to obtain reliable auxiliary triplets.

[0136] In addition, the enhancement strategy proposed in the present application is independent of the model, so that the enhanced knowledge graph data can be used for any other knowledge graph embedding model.

[0137] In some other embodiments, a knowledge graph completion device for alleviating sparsity is provided, comprising:

[0138] A construction module is configured to construct auxiliary triplets.

[0139] A fine-tuning module is configured to fine-tune a large language model using the data of the original knowledge graph to obtain a discriminator.

[0140] A filtering module is configured to filter the auxiliary triplets using the discriminator, fuse the filtered triplets with the original knowledge graph, and obtain an enhanced knowledge graph.

[0141] An aggregation module is configured to aggregate messages of the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information.

[0142] The correction module is configured to correct the loss in the graph structure representation result of the fused neighbor information by using a dynamic suppression strategy, improve the performance of the model on the knowledge graph completion task, and obtain an adjusted knowledge graph.

[0143] In some embodiments, a knowledge graph completion device for alleviating sparsity includes a processor and a memory storing program instructions, the processor being configured to execute the program instructions to perform a knowledge graph completion method for alleviating sparsity as any one of the preceding embodiments.

[0144] In some other embodiments, an electronic device (e.g., a mobile phone or a computer) is provided, which includes the knowledge graph completion device for alleviating sparsity as the preceding embodiments.

[0145] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should be covered in the scope of the claims and the description of the present application.

Claims

1. A knowledge graph completion method for an intelligent question-answering system that alleviates sparsity, characterized by: include: Construct auxiliary triples; The original knowledge graph data from the intelligent question-answering system is used to fine-tune the large language model to obtain the discriminator; The auxiliary triples are filtered using the discriminator, and the filtered triples are fused with the original knowledge graph in the intelligent question-answering system to obtain an enhanced knowledge graph; Performing message aggregation on the enhanced knowledge graph to obtain a graph structure representation that integrates neighbor information; A dynamic suppression strategy is used to correct the loss in the graph structure representation result of the fused neighbor information, thereby improving the performance of the model in the knowledge graph completion task and obtaining an adjusted knowledge graph; The constructing of the auxiliary triplet includes: Encode the text description of the entity in the original knowledge graph in the intelligent question-answering system to obtain an n-dimensional sentence vector; Calculate the cosine similarity between all sentence vectors and construct a similarity matrix; When a triple in the original knowledge graph in the intelligent question-answering system contains a sparse entity, the entity most similar to the sparse entity in the similarity matrix is ​​used to replace the head or tail entity in the original triple to construct an auxiliary triple; The auxiliary triples are filtered by the discriminator, and the filtered triples are fused with the original knowledge graph in the intelligent question-answering system to obtain an enhanced knowledge graph, including: Input the constructed auxiliary triples into the discriminator, predict the authenticity of the auxiliary triples, and obtain the auxiliary triples whose discriminant results are true; The true auxiliary triples are integrated with the original knowledge graph in the intelligent question-answering system to obtain an enhanced knowledge graph.

2. The method for completing a knowledge graph for an intelligent question-answering system to alleviate sparsity according to claim 1, characterized in that: The method uses the original knowledge graph data in the intelligent question-answering system to fine-tune the large language model to obtain a discriminator, including: Train the triples of the original knowledge graph in the intelligent question-answering system to obtain the structural embedding representation of the triples; Project the triplet's structural embedding representation into the text token representation space of the large language model to construct the instruction prefix; The large language model is fine-tuned using input sequences with instruction prefixes to obtain the discriminator.

3. The method for completing a knowledge graph for an intelligent question-answering system to alleviate sparsity according to claim 1, characterized in that: The message aggregation on the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information includes: Calculate the importance of neighbor triples to the entities in the enhanced knowledge graph, that is, the attention score; Normalize the attention scores to obtain the weight coefficients; The weight coefficient is used to perform weighted summation on the embedding representations of neighboring entities and fuse them with the embedding representation of the current entity to obtain the updated entity embedding representation; Repeat the above steps until the embedding representations of all entities are updated, and a graph structure representation that integrates neighbor information is obtained.

4. The method for completing a knowledge graph for an intelligent question-answering system to alleviate sparsity according to claim 3, characterized in that: The dynamic suppression strategy is used to correct the loss in the graph structure representation result of the fused neighbor information, thereby improving the performance of the model in the knowledge graph completion task and obtaining an adjusted knowledge graph, including: Define input query pairs, including entities and relations, and corresponding labels; According to the input query pair and label, construct a positive sample set, a negative sample set and an auxiliary triplet sample set for enhancing the knowledge graph; Introduce weights to correct the loss and adjust the strength of knowledge graph enhancement, where the weight value is dynamically adjusted according to the sample type and its loss size; When a sample belongs to the auxiliary triplet sample set and its loss is greater than a preset threshold, the weight of the corresponding sample is reduced; According to the modified dynamic loss function, the entire model is trained until the predetermined training termination condition is reached to obtain the adjusted knowledge graph.

5. A knowledge graph completion device for an intelligent question-answering system that alleviates sparsity, characterized in that: include: Building module, used to build auxiliary triples; The fine-tuning module is used to fine-tune the large language model using the original knowledge graph data in the intelligent question-answering system to obtain the discriminator; A filtering module, configured to filter the auxiliary triples using the discriminator, and fuse the filtered triples with the original knowledge graph in the intelligent question-answering system to obtain an enhanced knowledge graph; An aggregation module is used to aggregate messages on the enhanced knowledge graph to obtain a graph structure representation of fused neighbor information; A correction module is used to correct the loss in the graph structure representation result of the fused neighbor information by adopting a dynamic suppression strategy, thereby improving the performance of the model in the knowledge graph completion task and obtaining an adjusted knowledge graph; The encoding module is used to encode the text description of the entity in the original knowledge graph in the intelligent question-answering system to obtain an n-dimensional sentence vector; The calculation module is used to calculate the cosine similarity between all sentence vectors and construct a similarity matrix; The replacement module is used to replace the head or tail entity in the original triple with the entity that is most similar to the sparse entity in the similarity matrix when the triple in the original knowledge graph in the intelligent question-answering system contains a sparse entity, thereby constructing an auxiliary triple; The prediction module is used to input the constructed auxiliary triples into the discriminator, predict the authenticity of the auxiliary triples, and obtain the auxiliary triples whose discriminant results are true; The fusion module is used to fuse the true auxiliary triples with the original knowledge graph in the intelligent question-answering system to obtain an enhanced knowledge graph.

6. A knowledge graph completion device for an intelligent question-answering system that alleviates sparsity, comprising a processor and a memory storing program instructions, characterized in that: The processor is used to execute a knowledge graph completion method for an intelligent question-answering system that alleviates sparsity as described in any one of claims 1 to 4 when running the program instructions.

7. An electronic device, characterized in that: Including the knowledge graph completion device for an intelligent question-answering system that alleviates sparsity as described in claim 5 or 6.

Citation Information

Patent Citations

  • Knowledge graph completion-oriented link prediction method

    CN112883200A

  • Operation and maintenance data analysis method, device and equipment

    CN118069867A