A method for classifying triplets based on multi-element information embedding

By using a triplet classification method based on multivariate information embedding, and combining the joint learning of textual and structural information, the problem of low accuracy in long-tail entity classification in existing technologies is solved, and the performance of triplet classification is improved.

CN118551043BActive Publication Date: 2026-11-20BEIJING INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410434263.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-05-05
Filing Date
2024-04-11
Publication Date
2026-11-20
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

Existing triplet classification methods lack in-depth mining of auxiliary information on entities and relationships, making it difficult to handle long-tail entities with sparse data, resulting in low classification accuracy.

Method used

A triplet classification method based on multivariate information embedding is adopted. By constructing a knowledge graph embedding module based on text information enhancement and a knowledge graph embedding module based on structural information enhancement, and combining the MI-TransE scoring function, the joint learning of text information and structural information is achieved.

Benefits of technology

It improves the accuracy and generalization ability of triple classification, especially the classification performance of long-tail entities. By introducing the interactive fusion of text description information and knowledge graph structure information, it enhances the feature representation of entities and relations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551043B_ABST
    Figure CN118551043B_ABST
Patent Text Reader

Abstract

The application discloses a kind of triad classification method based on multivariate information embedding, belong to information extraction and natural language processing technical field.It includes: firstly, the triad of knowledge graph is preprocessed;Second, construct knowledge graph embedding based on text information enhancement;Then, construct knowledge graph embedding based on structure information enhancement;Then, construct knowledge graph embedding joint learning based on text information and structure information;Finally, judge the authenticity of triad, output the classification result of triad.By introducing the text description information of triad, the semantic information of triad entity and relationship is captured.By introducing interactive attention mechanism, the internal structure information of triad is captured.By introducing interactive aggregator, the global structure information of knowledge graph can be better captured.By introducing MI-TransE method, the connection between semantic information and structure information of triad can be effectively modeled, so as to improve the accuracy of triad classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a triplet classification method based on multivariate information embedding, belonging to the fields of information extraction and natural language processing technology. Background Technology

[0002] Triple classification is an important task in the fields of knowledge graph construction and knowledge extraction. The triple classification task involves identifying whether a given triple is correct, that is, determining whether the triple matches knowledge in the real world. Triple classification technology is widely used in question answering systems, information recommendation, and sentiment analysis, and has significant application value.

[0003] Triplet classification methods mainly include distance-based classification methods, tensor product-based classification methods, deep learning-based classification methods, and auxiliary information-based classification methods.

[0004] The basic idea behind distance-based triple classification methods is to evaluate triples by calculating the distance between the head and tail entities, such as the TransE (Translating Embedding) model. In these methods, the relationship between the head and tail entities is translated, and the authenticity of the triple is determined based on the distance between them.

[0005] The basic idea behind triple classification based on tensor products is to determine the authenticity of triples by mapping them from the knowledge graph to a three-dimensional tensor. A triple is considered authentic when its corresponding tensor element is 1, and false when its tensor element is 0. Furthermore, a tensor can be decomposed into matrices of entities, tensor representations of relations, and the transpose of the entity matrix.

[0006] The core idea of ​​deep learning-based triple classification is to capture the entity and relation features of triples in knowledge graphs using deep learning models. Existing deep learning models include convolutional neural networks, capsule networks, recurrent neural networks, and graph neural networks. In recent years, graph neural networks have achieved superior performance in graph-based data modeling tasks. Graph convolutional networks can mine structural information and node neighborhood information in knowledge graphs, aggregate information propagated in neural network layers to generate embedded representations of triples, and score the triples according to a scoring function to determine their authenticity.

[0007] The core idea of ​​triple classification based on auxiliary information is to utilize auxiliary information such as context and type of entities and relations in knowledge graph triples to enhance the semantic information lacking in knowledge graph embedding learning. Auxiliary information in existing research includes textual description information, type information, path information, and rule information.

[0008] Existing triplet classification methods suffer from the following main problems: First, current triplet classification methods lack in-depth mining of auxiliary information about entities and relations, mainly relying on the structural information of knowledge graphs while minimizing the mining of textual and type information. Second, in triplet classification methods based on auxiliary information, the lack of full utilization of knowledge graph structural information makes it difficult to capture semantic ambiguity in triplet representations, leading to reduced classification performance. Third, existing triplet classification methods need improvement in classifying triplets related to sparse, long-tail entities. Summary of the Invention

[0009] The purpose of this invention is to address the problems of insufficient utilization of auxiliary information and difficulty in handling sparse long-tail entities in existing triplet classification methods, resulting in low classification accuracy. This invention provides a triplet classification method based on multivariate information embedding. This method obtains triplet information and textual auxiliary information from a knowledge graph and uses a multivariate information embedding-based triplet classification model to predict the authenticity of triples. The key feature of this method is that it mines both textual auxiliary information and structural information from triples, and integrates these two types of feature information interactively. This helps to solve the problem of insufficient representation ability for sparse data such as long-tail entities, thus improving the performance of triplet classification.

[0010] To achieve the above objectives, the present invention adopts the following technical solution.

[0011] The triplet classification model based on multivariate information embedding includes three knowledge graph embedding learning modules:

[0012] The first module is a knowledge graph embedding module based on text information enhancement, which includes constructing text information sequences of entities and relations, and generating text-enhanced embeddings of head entities, relations and tail entities;

[0013] The second module is a knowledge graph embedding module based on structural information enhancement, which includes calculating the interaction attention weights of triples and fusing the global structural information of triples with the neighbor node information of entities.

[0014] The third module is the joint learning module for textual and structural information. It designs a scoring function based on Mixed Interaction Knowledge Translating Embedding (MI-TransE) and uses the maximum marginal loss function based on negative samples to train and optimize the classification model, thereby achieving triple classification.

[0015] In summary, the triplet classification model based on multi-information embedding adopts a strategy of enhancing entity embedding representation from both textual and structural information of knowledge graph triples, and improving the interaction between the two types of information through fusion learning and the design of an interactive scoring function.

[0016] The triplet classification method based on multivariate information embedding includes the following steps:

[0017] Step 1: Preprocess the knowledge graph triples;

[0018] Given a knowledge graph consisting of sets of triples, output the knowledge graph triple set, entity set, relation set, the text information sequence of the entities, and the text information sequence of the relations. The text information sequence of the entities is obtained from the entity description text, and the text information sequence of the relations is obtained from the relation description text.

[0019] A knowledge graph is defined as G = {(h,r,t), h∈E, r∈R, t∈E}, where E represents the entity set, R represents the relation set, (h,r,t) is a triple, where h represents the head entity, r represents the relation, and t represents the tail entity. Let the descriptive text of the entities in the triples include sentences. The descriptive text of the relations in a triple includes sentences.

[0020] Here, the text information sequence of an entity refers to the token sequence after removing stop words from the descriptive text sentence of the entity. The text information sequence ST(e) of entity e is defined as follows:

[0021]

[0022] in, This refers to the first token, the second token, ..., the nth token in the description text of entity e. e One token;

[0023] The text information sequence of a relation refers to the sequence of tokens after removing stop words from the descriptive text sentence of the relation. The ST(r) of the text information sequence of a relation is defined as follows:

[0024]

[0025] in, The first token, the second token, ..., the nth token in the description text of relation r. r A token.

[0026] Then, based on the entities, relations, and triples in the knowledge graph, entity sets, relation sets, and triple sets are constructed.

[0027] Step 2: Generate a knowledge graph embedding based on text information enhancement, which includes the following sub-steps:

[0028] Step 2.1: For the text information sequence of entities and relations extracted in Step 1, construct the text sequence embeddings of the head entity, relation and tail entity, and input them into the pre-trained model BERT;

[0029] First, for each token in the entity's text information sequence, segmentation embedding and position embedding are added. The entity's text information sequence is separated by [SEP] tags, which are used to separate sentences containing tokens. For each token in the relation's text information sequence, segmentation embedding and position embedding are added.

[0030] Then, the embedding representation of the triples is constructed as shown in Equation (3):

[0031]

[0032] Among them, emb h This indicates the embedding of the header entity h. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the head entity h. h Embedding of individual tokens. The text sequence embedding is called the head entity.

[0033] emb r Represents the embedding of relation r. Let represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of relation r. r Embedding of individual tokens. Text sequence embeddings are called relations.

[0034] emb t Indicates the embedding of the tail entity t. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the tail entity t. t Embedding of individual tokens. Text sequence embeddings are called tail entities.

[0035] Finally, the text sequence embeddings of the head entity, the relation, and the tail entity in each triple are input into the pre-trained model BERT.

[0036] Step 2.2: Use the pre-trained model BERT to perform semantic encoding on the text sequence embeddings of head entities, relations and tail entities, output the embedding vectors of the last layer of the pre-trained model BERT, and generate the embedding representations of head entities, relations and tail entities.

[0037] Step 2.3: Generate text-enhanced embeddings for head entities, relations, and tail entities;

[0038] For the embedding of the head entity, relation, and tail entity in step 2.2, linear mapping is applied to generate text-enhanced embeddings for the head entity, relation, and tail entity. Specifically, for the embedding of the head entity h, emb... h Embedded relation r in emb r And the embedding of the tail entity t in emb t After linear mapping, the text-enhanced embedding representation TeE(h) of the head entity h, the text-enhanced embedding representation TeE(t) of the tail entity t, and the text-enhanced embedding representation TeE(r) of the relation r are generated. The generation methods are shown in formulas (4), (5) and (6):

[0039] TeE(h)=σ(W h BERT(emb h )+u h (4)

[0040] TeE(r)=σ(W r BERT(emb r )+u r ), (5)

[0041] TeE(t)=σ(W t BERT(emb t )+u t ), (6)

[0042] in, It is a parameter matrix. Let d1 be the bias vector, d2 be the embedding dimension of entities and relations, and d3 be the embedding dimension generated by the pre-trained BERT model. σ is a non-linear activation function. In this embodiment, the sigmoid function is used.

[0043] Step 3: Generate knowledge graph embeddings based on structured information enhancement, which includes the following sub-steps:

[0044] Step 3.1: For the entity set, relation set, and triplet set constructed in Step 1, construct the initialization embedding matrix of the entities and the initialization embedding matrix of the relations using a random initialization method;

[0045] Step 3.2: Calculate the triplet interaction attention weights:

[0046] Step 3.2.1: The initial embedding representation of the head entity, relation, and tail entity of the concatenated triple is input into the LeakyReLU function through a linear transformation to obtain the weight values;

[0047] Step 3.2.2: After normalizing the weight values ​​from Step 3.2.1 using the Softmax function, the triplet interaction attention values ​​are obtained;

[0048] Step 3.3: Utilize the interactive aggregator and multi-head graph attention mechanism to generate entity embedding representations based on structural information enhancement;

[0049] Step 3.3.1: Multiply the attention weights with the embedding representation vectors of the head and tail entity nodes to obtain the updated embedding representation vector for each entity node;

[0050] Step 3.3.2: Generate interactive embedding representations of entity nodes using the interaction aggregator;

[0051] First, for the entity node embedding representation generated in step 2.1, after generating the updated entity node embedding representation in step 3.3.1, weighted calculation and Hadamard product calculation are performed respectively. The two calculation results are then fused after linear transformation to obtain the interactive embedding representation of the entity node.

[0052] Step 3.3.3: Generate entity embedding representations based on structural information enhancement using a multi-head attention mechanism;

[0053] First, for each attention head in multi-head attention, the interaction embedding representation of the entity is obtained through step 3.3.2, and the interaction embedding representations of the entities from all attention heads are concatenated.

[0054] Then, by taking the average value, the embedded representation of the entity node in each layer is obtained.

[0055] Finally, the last layer of the multi-head graph attention network is output as an entity embedding representation based on structural information enhancement.

[0056] Step 4: Jointly learn the text augmentation embedding representation and the structural augmentation embedding representation, which includes the following sub-steps:

[0057] Step 4.1: For the text-enhanced embedding of the head and tail entities generated in Step 2, and the head and tail entity embeddings based on structural information enhancement generated in Step 3, a scoring function based on Mixed Interaction Knowledge Translating Embedding (MI-TransE) is used to achieve knowledge representation learning of multi-dimensional information.

[0058] Specifically, based on the idea of ​​the TransE model, the text enhancement embedding h of the head entity generated in step 2 is performed. Text Text enhancement embedding of tail entities t Text Construct a scoring function f1 based on the translation embedding TransE (Knowledge Translating Embedding), as shown in formula (12); for the head entity embedding h generated in step 3 Stru Tail entity embedding t Stru Construct a scoring function f2 based on TransE, as shown in formula (13); for the head entity embedding h generated in step 2 Text Embedded with the tail entity generated in step 3 Stru Construct a scoring function f3 based on TransE, as shown in formula (14); for the head entity embedding h generated in step 3 Stru Embedded with the tail entity generated in step 2 Text Construct a scoring function f4 based on TransE, as shown in formula (15):

[0059] f1 = ||h Text +rt Text ||2, (12)

[0060] f2=||h Stru +rt Stru ||2, (13)

[0061] f3=||h Text +rt Stru ||2, (14)

[0062] f4 = ||h Stru +rt Text ||2, (15)

[0063] Step 4.2: Construct the scoring function;

[0064] The MI-TransE scoring function f consists of the four scoring functions f1, f2, f3, and f4 from step 4.1, as shown in formula (16):

[0065] f = f1 + f2 + f3 + f4, (16)

[0066] Step 5: Determine the authenticity of the triples and output the classification result of the triples;

[0067] Using the scoring function in step 4.2, the entity ID and relation ID in the triple are extracted. The entity embedding based on text information enhancement generated in step 2.3 and entity embedding based on structural information enhancement generated in step 3.3 are scored, the score is calculated, and the authenticity of the triple is determined.

[0068] Beneficial effects

[0069] This invention addresses the triplet classification problem by proposing a triplet classification method based on multivariate information embedding, which offers the following advantages compared to existing technologies:

[0070] 1. To address the poor generalization prediction ability caused by entity sparsity in triples, this invention proposes a knowledge graph embedding generation method based on textual information enhancement. The idea behind this method is to integrate the textual information from the triples into the graph embedding learning process. Based on the textual information sequences of entities and relations, textual sequence embeddings of head entities, relations, and tail entities are constructed and input into the pre-trained model BERT. Further, text-enhanced embeddings of head entities, relations, and tail entities are generated through linear mapping. This proposed knowledge graph embedding generation method based on textual information enhancement captures the semantic information of triple entities and relations by introducing textual description information from triples; by introducing a pre-trained model, it enhances the feature representation of entity and relation sequence text, thereby improving the performance of triple classification.

[0071] 2. To address the problem that existing methods struggle to fully utilize the intrinsic information of triples when processing graph structures, this invention proposes a knowledge graph embedding generation method based on enhanced structural information. It designs a graph attention mechanism based on triple interactions, utilizing both entity neighborhood information and global knowledge graph information. The entity and relation vector of the triple are concatenated, and attention values ​​are designed based on the concatenated embedding. An interaction aggregator generates interactive embedding representations of entity nodes. A graph attention network learns the structural information of triples, and a multi-head attention mechanism aggregates the entity structural information to obtain entity representation information. This invention's proposed knowledge graph embedding generation method, by introducing an interactive attention mechanism, captures the intrinsic structural information of triples. The introduction of an interactive aggregator better captures the global structural information of the knowledge graph. The introduction of a multi-head attention mechanism enhances the representation of entity structural information and improves the performance of triple classification.

[0072] 3. To address the insufficient interaction between textual and structural information in triples, this invention designs a joint learning method based on knowledge graph embedding of both textual and structural information. To jointly learn these two types of information enhancement embeddings in the same vector space, this invention proposes an interaction scoring function using the MI-TransE method. Marginal loss functions and negative sampling mechanisms are employed during the embedding optimization process. The proposed joint learning method based on knowledge graph embedding of textual and structural information, by introducing the MI-TransE method, can effectively model the relationship between the semantic and structural information of triples, thereby improving the accuracy of triple classification. Attached Figure Description

[0073] Figure 1 This is a flowchart illustrating a triplet classification method based on multivariate information embedding and an embodiment of the present invention. Detailed Implementation

[0074] The triplet classification system based on the method of this invention uses Vision Studio Code as the development tool and Python as the development language. The preferred embodiments of the triplet classification method based on multivariate information embedding of this invention are described in detail below with reference to specific examples.

[0075] Example 1

[0076] This embodiment describes the process of using a triplet classification method based on multivariate information embedding as described in this invention, such as... Figure 1 As shown. The input data comes from the triplet classification dataset UMLS, which is a dataset describing medical concepts, containing 135 entities and 46 relations. The input data includes head entities, relations, and tail entities, such as organ_or_tissue_function, process_of, and neoplastic_process.

[0077] First, a triplet classification method based on multi-source information embedding is proposed. This method realizes the fusion of knowledge graph information from different perspectives. Specifically, entity embedding representations are constructed by using a knowledge graph embedding module based on text information and a knowledge graph embedding module based on structural information, respectively. The interaction of the two types of information is carried out through a joint learning module of text information and structural information.

[0078] Secondly, the first module is a knowledge graph embedding module based on textual information. This module constructs entity text information sequences and relation text information sequences (corresponding to step 1). The text sequences of head entities, relations, and tail entities are embedded and input into the pre-trained model BERT. Further, through linear mapping, text-enhanced embeddings of head entities, relations, and tail entities are generated (corresponding to step 2).

[0079] Third, the second module is a knowledge graph embedding module based on structured information enhancement. This module concatenates the processed triple entity and relation vectors in the order of head entity, relation, and tail entity, and then generates the concatenated embedding of the triple through a linear transformation. Next, based on the concatenated embedding of the triple, attention values ​​are generated through a linear transformation and an activation function, while the attention values ​​of neighboring nodes are obtained after normalization. The entity representation information is aggregated from the entity information of its neighborhood through a multi-head attention mechanism. Finally, the original entity embedding matrix is ​​linearly transformed and added to the entity embedding matrix generated by the graph attention network to obtain the entity embedding matrix. The entity embedding generated by this module has rich structural information (corresponding to step 3).

[0080] Fourth, the third module is the joint learning module for textual and structural information. The idea behind this module is to interactively fuse the triplet embeddings obtained from the two modules, while ensuring that both embeddings reside in the same vector space. Through the designed MI-TransE scoring function, the scoring functions of the text-based knowledge graph embedding module and the structure-enhanced knowledge graph embedding module are combined (corresponding to step 4). Finally, the triples are scored based on the scoring function to determine their authenticity (corresponding to step 5).

[0081] from Figure 1 As can be seen, the specific steps include the following:

[0082] Step 1: Preprocess the knowledge graph triples;

[0083] Given a knowledge graph consisting of sets of triples, output the knowledge graph triple set, entity set, relation set, the text information sequence of the entities, and the text information sequence of the relations. The text information sequence of the entities is obtained from the entity description text, and the text information sequence of the relations is obtained from the relation description text.

[0084] A knowledge graph is defined as G = {(h,r,t), h∈E, r∈R, t∈E}, where E represents the entity set, R represents the relation set, (h,r,t) is a triple, where h represents the head entity, r represents the relation, and t represents the tail entity. Let the descriptive text of the entities in the triples include sentences. The descriptive text of the relations in a triple includes sentences.

[0085] For example, the entity “organ_or_tissue_function” corresponds to the descriptive text “Inbiology, tissue is a cellular organisational level between cells and a complete organ. A tissue is an ensemble of similar.”

[0086] The entity “tumor process (neoplastic_process)” corresponds to the description text “A neoplasm is a type of abnormal and excessive growth, called neoplasia, of tissue. The growth of aneoplasm is uncoordinated.”

[0087] Here, the text information sequence of an entity refers to the token sequence after removing stop words from the descriptive text sentence of the entity. The text information sequence ST(e) of entity e is defined as follows:

[0088]

[0089] in, This refers to the first token, the second token, ..., the nth token in the description text of entity e. e A token.

[0090] The text information sequence of a relation refers to the sequence of tokens after removing stop words from the descriptive text sentence of the relation. The ST(r) of the text information sequence of a relation is defined as follows:

[0091]

[0092] in, The first token, the second token, ..., the nth token in the description text of relation r. r A token.

[0093] Then, based on the entities, relations, and triples in the knowledge graph, entity sets, relation sets, and triple sets are constructed.

[0094] Step 2: Generate a knowledge graph embedding based on text information enhancement;

[0095] Step 2.1: For the text information sequence of entities and relations extracted in Step 1, construct the text sequence embeddings of the head entity, relation and tail entity, and input them into the pre-trained model BERT;

[0096] First, for each token in the entity's text information sequence, segmentation embedding and position embedding are added. The entity's text information sequence is separated by [SEP] tags, which are used to separate sentences containing tokens. For each token in the relation's text information sequence, segmentation embedding and position embedding are added.

[0097] Then, the embedding representation of the triples is constructed as shown in Equation (3):

[0098]

[0099] Among them, emb h This indicates the embedding of the header entity h. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the head entity h. h Embedding of individual tokens. The text sequence embedding is called the head entity.

[0100] emb r Represents the embedding of relation r. Let represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of relation r. r Embedding of individual tokens. Text sequence embeddings are called relations.

[0101] emb t Indicates the embedding of the tail entity t. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the tail entity t. t Embedding of a token. Text sequence embeddings are called tail entities.

[0102] Finally, the text sequence embeddings of the head entity, the relation, and the tail entity in each triple are input into the pre-trained model BERT.

[0103] Step 2.2: Use the pre-trained model BERT to perform semantic encoding on the text sequence embeddings of head entities, relations and tail entities, output the embedding vectors of the last layer of the pre-trained model BERT, and generate the embedding representations of head entities, relations and tail entities;

[0104] Step 2.3: Generate text-enhanced embeddings for head entities, relations, and tail entities;

[0105] For the embedding of the head entity, relation, and tail entity in step 2.2, linear mapping is applied to generate text-enhanced embeddings for the head entity, relation, and tail entity. Specifically, for the embedding of the head entity h, emb... h Embedded relation r in emb r And the embedding of the tail entity t in emb t After linear mapping, the text-enhanced embedding representation TeE(h) of the head entity h, the text-enhanced embedding representation TeE(t) of the tail entity t, and the text-enhanced embedding representation TeE(r) of the relation r are generated. The generation methods are shown in formulas (4), (5) and (6):

[0106] TeE(h)=σ(W h BERT(emb h )+u h (4)

[0107] TeE(r)=σ(W r BERT(emb r )+u r ), (5)

[0108] TeE(t)=σ(W t BERT(emb t )+u t ), (6)

[0109] in, It is a parameter matrix. Let d1 be the bias vector, d2 be the embedding dimension of entities and relations, and d3 be the embedding dimension generated by the pre-trained BERT model. σ is a non-linear activation function. In this embodiment, the sigmoid function is used.

[0110] Step 3: Generate knowledge graph embeddings based on structured information enhancement;

[0111] Step 3.1: For the entity set, relation set, and triplet set constructed in Step 1, construct the initialization embedding matrix of the entities and the initialization embedding matrix of the relations using a random initialization method;

[0112] The initial embedding matrix of the entity is: Where, d E N represents the dimension of entity embedding. E Let be the number of entities. The initial embedding matrix of the relation is: Where, d R N represents the dimension of relation embedding. R The number of relations;

[0113] Step 3.2: Calculate the triplet interaction attention weights;

[0114] Step 3.2.1: Initialize the embedding representation of the head entity, relation, and tail entity of the concatenated triple, and input it into the LeakyReLU function through a linear transformation to obtain the weight value b. ikj The method for setting the weight values ​​is shown in formula (7):

[0115]

[0116] Where || represents the merge operation, W tr The linear transformation parameter matrix, For entity e i Initialization embedding, For relation r k Initialization embedding, For entity e j Initialization embedding. W b Let be the parameter matrix for training, and σ be the non-linear activation function. In this embodiment, the LeakyReLU function is used as the non-linear activation function.

[0117] Step 3.2.2: Normalize the weight values ​​calculated in Step 3.2.1 using the Softmax function to obtain the triplet interaction attention weights;

[0118] Triple interaction attention weight tr ikj The calculation method is shown in formula (8):

[0119]

[0120] Among them, W b and W tr It is a parameter matrix, where E is the entity set and R is the relation set;

[0121] Step 3.3: Utilize the interactive aggregator and multi-head graph attention mechanism to generate entity embedding representations based on structural information enhancement;

[0122] Step 3.3.1: Multiply the triplet interaction attention weights from Step 3.2 with the embedding representation vectors of the head and tail entity nodes to obtain the updated embedding representation vector for each entity node;

[0123] Each entity node e i The updated embedding representation vector h i The calculation method for “” is shown in formula (9):

[0124]

[0125] Where σ is a nonlinear activation function.

[0126] In this embodiment, the non-linear activation function used is the LeakyReLU function.

[0127] Step 3.3.2: Generate interactive embedding representations of entity nodes using the interaction aggregator;

[0128] First, for the entity node embedding representation emb generated in step 2.1 e The entity node embedding representation generated in step 3.3.1 is subjected to weighted calculation and Hadamard product calculation respectively. The two calculation results are then fused after linear transformation to obtain the interactive embedding representation h” of the entity node. The specific calculation method is shown in formula (10):

[0129]

[0130] Among them, W ag1 and W ag2 Let be the parameter matrix for training, where σ1 and σ2 represent linear transformation operations, and ⊙ represents the Hadamard product.

[0131] Step 3.3.3: Generate entity embedding representations based on structural information enhancement using a multi-head attention mechanism;

[0132] First, for each attention head in multi-head attention, the interaction embedding representation of the entity is obtained through step 3.3.2, and the interaction embedding representations of the entities from all attention heads are concatenated.

[0133] Then, by taking the average value, the entity node embedding representation of each layer is obtained, and the calculation method is shown in formula (11):

[0134]

[0135] Where M is the number of multi-head attention, h″ m The interaction embedding representation of the entity node at the m-th attention head. After iterative operations in the attention network layer, the one-hop neighbor information of the entity is aggregated. As the number of network layers increases, the multi-hop neighbor information of the entity is aggregated.

[0136] Finally, the last layer of the multi-head graph attention network is output as an entity embedding representation based on structural information enhancement.

[0137] Step 4: Jointly learn the text augmentation embedding representation and the structural augmentation embedding representation;

[0138] Step 4.1: For the text-enhanced embedding of the head and tail entities generated in Step 2, and the head and tail entity embeddings based on structural information enhancement generated in Step 3, a scoring function based on Hybrid Interactive Knowledge Translation Embedding (MI-TransE) is used to achieve knowledge representation learning of multi-dimensional information.

[0139] Specifically, based on the idea of ​​the TransE model, the text enhancement embedding h of the head entity generated in step 2 is performed. Text Text enhancement embedding of tail entities t Text Construct a scoring function f1 based on the translation embedding TransE (Knowledge Translating Embedding), as shown in formula (12); for the head entity embedding h generated in step 3 Stru Tail entity embedding t Stru Construct a scoring function f2 based on TransE, as shown in formula (13); for the head entity embedding h generated in step 2 Text Embedded with the tail entity generated in step 3 Stru Construct a scoring function f3 based on TransE, as shown in formula (14); for the head entity embedding h generated in step 3 Stru Embedded with the tail entity generated in step 2 Text Construct a scoring function f4 based on TransE, as shown in formula (15):

[0140] f1 = ||h Text +rt Text ||2, (12)

[0141] f2=||h Stru +rt Stru ||2, (13)

[0142] f3=||h Text +rt Stru ||2, (14)

[0143] f4 = ||h Stru +rt Text ||2, (15)

[0144] Step 4.2: Construct the scoring function;

[0145] The MI-TransE scoring function f consists of the four scoring functions f1, f2, f3, and f4 from step 4.1, as shown in formula (16):

[0146] f = f1 + f2 + f3 + f4, (16)

[0147] Step 5: Determine the authenticity of the triples and output the classification result of the triples;

[0148] Using the scoring function in step 4.2, the entity ID and relation ID in the triple are extracted. The entity embedding based on text information enhancement generated in step 2.3 and entity embedding based on structural information enhancement generated in step 3.3 are used to score the triple and calculate the score to determine the authenticity of the triple.

[0149] To illustrate the triplet classification performance of this invention, this experiment compares three methods under the same conditions, using the same training set, validation set, and test set.

[0150] The first method is a triplet classification model based on auxiliary information. Building upon a pre-trained BERT model, it uses entity and relation descriptions as input to predict the embedding representations of entities and relations. The second method uses different pre-trained language models to represent entities and relations as vectors and trains on multiple pre-trained language models. The third method is the triplet classification method of this invention.

[0151] The evaluation metric used in the experiment was the accuracy (ACC) of triplet classification. The accuracy of triplet classification is the proportion of data samples correctly classified as true out of the total number of data samples classified, i.e., accuracy = number of correct classifications / total number of samples, as shown in formula (17), where Num True Num represents the number of correct categories. Total This represents the total number of samples.

[0152] ACC = Num Ture / Num Total (17)

[0153] The recognition results of the triplet classification are as follows: the Acc value of the first method is 93.5%, the Acc value of the second method is 93.3%, and the Acc value of the method of this invention is 93.76%. Experiments demonstrate the effectiveness of the proposed triplet classification based on multivariate information embedding.

[0154] The above description is merely a preferred embodiment of the present invention, and the present invention should not be limited to the content disclosed in this embodiment and the accompanying drawings. Any equivalent or modified embodiments made without departing from the spirit of the present invention fall within the scope of protection of the present invention.

Claims

1. A triplet classification method based on multivariate information embedding, characterized in that: It includes three modules: The first module is a knowledge graph embedding module based on text information enhancement, which includes constructing text information sequences of entities and text information sequences of relations, and generating text-enhanced embeddings of head entities, relations and tail entities; The second module is a knowledge graph embedding module based on structural information enhancement, which includes calculating the interaction attention weights of triples and fusing the global structural information of triples with the neighbor node information of entities. The third module is the joint learning module for textual and structural information. It designs a scoring function based on Mixed Interaction Knowledge Translating Embedding (MI-TransE) and uses the maximum marginal loss function based on negative samples for classification model training and optimization to achieve triple classification. The triplet classification method based on multivariate information embedding includes the following steps: Step 1: Preprocess the knowledge graph triples; Given a knowledge graph consisting of sets of triples, output the knowledge graph triple set, entity set, relation set, text information sequence of entities, and text information sequence of relations; where the text information sequence of entities is obtained from the entity description text, and the text information sequence of relations is obtained from the relation description text. Then, based on the entities, relations, and triples in the knowledge graph, construct entity sets, relation sets, and triple sets; Step 2: Generate a knowledge graph embedding based on text information enhancement; Step 2.1: For the text information sequence of entities and relations extracted in Step 1, construct the text sequence embeddings of the head entity, relation and tail entity, and input them into the pre-trained model BERT; Step 2.2: Use the pre-trained model BERT to perform semantic encoding on the text sequence embeddings of head entities, relations and tail entities, output the embedding vectors of the last layer of the pre-trained model BERT, and generate the embedding representations of head entities, relations and tail entities; Step 2.3: Generate text-enhanced embeddings for head entities, relations, and tail entities; Step 3: Generate knowledge graph embeddings based on structured information enhancement; Step 3.1: For the entity set, relation set, and triplet set constructed in Step 1, construct the initialization embedding matrix of the entities and the initialization embedding matrix of the relations using a random initialization method; The initial embedding matrix of the entity is: ,in, For the dimension of entity embedding, The number of entities; the initial embedding matrix of the relations is... ,in, For the dimension of relation embedding, The number of relations; Step 3.2: Calculate the triplet interaction attention weights; Step 3.3: Generate entity embedding representations based on structural information enhancement using an interactive aggregator and a multi-head graph attention mechanism; Step 4: Jointly learn the text augmentation embedding representation and the structural augmentation embedding representation; Step 4.1: For the text-enhanced embeddings of the head and tail entities generated in Step 2, and the head and tail entity embeddings based on structural information enhancement generated in Step 3, a scoring function based on Mixed Interaction Knowledge Translating Embedding (MI-TransE) is used to achieve knowledge representation learning of multi-dimensional information. Specifically, based on the idea of ​​the TransE model, the text enhancement embedding h of the head entity generated in step 2 is performed. Text Text enhancement embedding of tail entities t Text A scoring function f1 based on the translation embedding TransE (Knowledge Translating Embedding) is constructed, as shown in formula (12); for the head entity embedding h generated in step 3 Stru Tail entity embedding t Stru Construct a scoring function f2 based on TransE, as shown in formula (13); for the head entity embedding h generated in step 2 Text Embedded with the tail entity generated in step 3 Stru Construct a scoring function f3 based on TransE, as shown in formula (14); for the head entity embedding h generated in step 3 Stru Embedded with the tail entity generated in step 2 Text Construct a scoring function f4 based on TransE, as shown in formula (15); ,(12) ,(13) ,(14) ,(15) Step 4.2: Construct the scoring function; The MI-TransE scoring function f is composed of the four scoring functions f1, f2, f3, and f4 from step 4.1, as shown in formula (16): .(16) Step 5: Determine the authenticity of the triples and output the classification result of the triples; Using the scoring function in step 4.2, the entity ID and relation ID in the triple are extracted. The entity embedding based on text information enhancement generated in step 2.3 and entity embedding based on structural information enhancement generated in step 3.3 are used to score the triple and calculate the score to determine the authenticity of the triple.

2. The triplet classification method based on multivariate information embedding according to claim 1, characterized in that: Step 1 specifically includes: Knowledge graph is defined as Here, E represents the entity set, R represents the relation set, and (h,r,t) is a triple, where h represents the head entity, r represents the relation, and t represents the tail entity; assuming the descriptive text of the entities in the triple includes sentences... The descriptive text of the relations in a triple includes sentences. ; Here, the text information sequence of an entity refers to the token sequence after removing stop words from the descriptive text sentence of the entity; the text information sequence ST(e) of entity e is defined as follows: (1) in, This refers to the first token, the second token, ..., the nth token in the description text of entity e. e One token; The text information sequence of a relation refers to the sequence of tokens after removing stop words from the descriptive text sentence of the relation; the ST(r) of the text information sequence of a relation is defined as follows: (2) in, The first token, the second token, ..., the nth token in the description text of relation r. r A token.

3. The triplet classification method based on multivariate information embedding according to claim 1, characterized in that: Step 2.1 specifically includes: First, embedding, segmentation embedding, and position embedding are added to each token in the entity's text information sequence; the entity's text information sequence is separated by the [SEP] tag, which is used to separate the sentence in which the token is located; embedding, segmentation embedding, and position embedding are added to each token in the relation's text information sequence. Then, the embedding representation of the triples is constructed as shown in Equation (3): (3) Among them, emb h This indicates the embedding of the header entity h. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the head entity h. h Embedding of individual tokens; Text sequence embedding, referred to as head entity; emb r Represents the embedding of relation r. Let represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of relation r. r Embedding of individual tokens; Text sequence embeddings referred to as relations; emb t Indicates the embedding of the tail entity t. Let N represent the embeddings of the first token, the second token, ..., the Nth token in the text information sequence of the tail entity t. t Embedding of individual tokens; Text sequence embedding, referred to as tail entity; Finally, the text sequence embeddings of the head entity, the relation, and the tail entity in each triple are input into the pre-trained model BERT.

4. The triplet classification method based on multivariate information embedding according to claim 1, characterized in that: Step 2.3 specifically includes: For the embedding of the head entity, relation, and tail entity in step 2.2, after linear mapping processing, text-enhanced embeddings of the head entity, relation, and tail entity are generated; specifically, for the embedding of the head entity h, emb h Embedded relation r in emb r And the embedding of the tail entity t in emb t After linear mapping, a text-enhanced embedding representation of the head entity h is generated. Text-enhanced embedding representation of tail entity t and the text-enhanced embedding representation of relation r The generation methods are shown in formulas (4), (5) and (6): ,(4) ,(5) ,(6) in, It is a parameter matrix. For bias vectors, For the embedding dimension of entities and relationships, Generate embedding dimensions for the pre-trained BERT model. It is a non-linear activation function, and the non-linear activation function used is the Sigmoid function.

5. The triplet classification method based on multivariate information embedding according to claim 1, characterized in that: Step 3.2 specifically includes: Step 3.2.1: Initialize the embedding representation of the head entity, relation, and tail entity of the concatenated triple, and input it into the LeakyReLU function through a linear transformation to obtain the weight values. The method for setting the weight values ​​is shown in formula (7): ,(7) Where || represents the merge operation. The linear transformation parameter matrix, For entities Initialization embedding, For relationship Initialization embedding, For entities Initialization embedding, For the training parameter matrix, It is a non-linear activation function, and the non-linear activation function used is the LeakyReLU function; Step 3.2.2: Normalize the weight values ​​calculated in Step 3.2.1 using the Softmax function to obtain the triplet interaction attention weights; Triple interaction attention weights The calculation method is shown in formula (8): (8) Among them, W b and W tr It is a parameter matrix, where E is the entity set and R is the relation set.

6. The triplet classification method based on multivariate information embedding according to claim 1, characterized in that: Step 3.3 specifically includes: Step 3.3.1: Multiply the triplet interaction attention weights from Step 3.2 with the embedding representation vectors of the head and tail entity nodes to obtain the updated embedding representation vector for each entity node; Each entity node The updated embedding representation vector The calculation method is shown in formula (9): ,(9) in, It is a non-linear activation function, and the non-linear activation function used is the LeakyReLU function; Step 3.3.2: Generate interactive embedding representations of entity nodes using the interaction aggregator; First, for the entity node embedding representation emb generated in step 2.1 e Step 3.3.1 generates the entity node embedding representation. Weighted calculations and Hadamard product calculations are performed separately. The results of the two calculations are then fused after a linear transformation to obtain the interactive embedding representation of the entity nodes. The specific calculation method is shown in formula (10): ,(10) in, and For the training parameter matrix, and This represents a linear transformation operation. Represents the Hadama product; Step 3.3.3: Generate entity embedding representations based on structural information enhancement using a multi-head attention mechanism; First, for each attention head in multi-head attention, the interaction embedding representation of the entity is obtained through step 3.3.2, and the interaction embedding representations of the entities from all attention heads are concatenated. Then, by taking the average value, the entity node embedding representation of each layer is obtained, and the calculation method is shown in formula (11): ,(11) in, The number of multi-headed attention, No. The interaction embedding representation of entity nodes of each attention head; after iterative operation in the attention network layer, the one-hop neighbor information of the entity is aggregated; as the number of network layers increases, the multi-hop neighbor information of the entity is aggregated. The output is the last layer of the multi-head graph attention network, serving as an entity embedding representation based on structural information enhancement.