An ultra-relation knowledge graph representation method and system based on dynamic fusion of structure and text information
By using techniques such as graph convolutional neural networks and pre-trained language models, the structure and text information of the hyper-relationship knowledge graph are dynamically fused, which solves the problem that existing methods fail to effectively utilize text information, achieves richer entity and relation representations, and improves the efficiency and accuracy of knowledge graph completion.
Patent Information
- Application Number
- CN202411358418.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Existing hyperrelationship knowledge graph representation methods fail to effectively integrate rich textual information, resulting in insufficient representation of entities and relationships.
By employing graph convolutional neural networks, pre-trained language models, and Transformer technology, combined with contrastive learning, structural and textual information from hyperrelationship knowledge graphs is dynamically fused to generate richer entity and relation representations.
By fully integrating structural and textual knowledge, the representation quality of entities and relationships is improved, thereby increasing the efficiency and accuracy of knowledge graph completion.
Smart Images

Figure CN119323248B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of knowledge graph representation, and particularly relates to a super-relation knowledge graph representation method and system based on dynamic fusion of structure and text information. BACKGROUND
[0002] In recent years, artificial intelligence technology has made major breakthroughs in machine translation, search engines, facial recognition, autonomous driving and other fields, and has profoundly changed human social life. The generation of massive data has provided a solid foundation for the vigorous development of artificial intelligence technology. Although massive data contains rich knowledge, most of the data exists in unstructured form, which brings difficulties to human understanding and application of massive knowledge, and also brings great challenges to efficient analysis and processing of computers. To obtain a large amount of knowledge convenient for computer processing, knowledge graphs have emerged as the times require. Knowledge graph is a structured semantic knowledge base that stores a large number of facts. These facts are composed in the form of triples (head entity, relation, tail entity). Among them, the entity can be a place, a person, an organization, etc., and the entities are connected to each other through relations, and ultimately form a heterogeneous directed graph. At present, a large number of representative knowledge graphs have emerged, such as YAGO, Freebase, Wikidata, etc. The number of triples in them can be as high as several billion.
[0003] However, even if massive facts have been stored in existing knowledge graphs, limited by the incompleteness of knowledge sources and the inadequacy of knowledge extraction technology, there are still a large number of missing facts. For example, in the knowledge graph Freebase, about 93.8% of the person entities lack birthplace information, and 78.5% of the person entities lack nationality information. Knowledge graph completion aims to infer missing facts from existing facts, so the field of knowledge graph completion has received more widespread attention. With the rapid development of machine learning technology, knowledge graph representation learning has become an effective method for the task of knowledge graph completion. This method represents entities and relations in the graph as low-dimensional dense vectors, while using a scoring function to evaluate the validity of the facts. With the continuous deepening of research, the field of knowledge graph representation learning has also been further refined, and representation learning based on super-relation knowledge graph has thus emerged. Super-relation knowledge graph allows adding several "relation-entity" pairs to the traditional triple fact to eliminate ambiguity and enhance the validity of the fact. Among them, the traditional triple is called the main triple, and the additional "relation-entity" key-value pair is called the qualifier.
[0004] The m-TransH model proposed in 2016 combines the relationship in the relationship and the relationship in the qualifier to obtain an abstract relationship, and then projects the entity onto the relationship hyperplane. The NaLP model proposed in 2019 regards the hyper-relation fact as a set of key-value pairs, encodes the key-value pairs using a convolutional neural network, and then measures the compatibility between the key and the value using a multi-layer perceptron. The HINGE model proposed in 2020 first represents the hyper-relation fact in the form of a main triple and a qualifier, measures the effectiveness of the main triple and the compatibility between the main triple and each qualifier using a convolutional neural network to obtain the effectiveness of the fact. The StarE model proposed in 2020 uses a message passing network (CompGCN) as an encoder to obtain the embedded representation of the entity and the relationship, and then feeds it into a Transformer decoder to obtain the effectiveness of the fact. The Hy-Transformer model proposed in 2021 replaces the CompGCN encoder in the StarE model with a layer normalization and dropout module to achieve better prediction performance. The ShrinkE model proposed in 2023 models the main triple as a spatial span from a point to a box, and models the qualifier as a geometric shrinkage of the box, thereby narrowing down the possible answer set and effectively simulating the reasoning mode in the graph atlas.
[0005] Since the above models do not consider the rich text information in the hyper-relation knowledge graph, however, efficient use of these text information can enrich the representation of entities and relationships in the graph. Therefore, the above models cannot produce effective representations for entities with limited structural knowledge. SUMMARY
[0006] The purpose of the present application is to address the shortcomings of existing hyper-relation knowledge graph representation methods, i.e., not considering the rich text information in the hyper-relation knowledge graph, using graph convolutional neural networks, pre-training language models, Transformers, and contrastive learning techniques, fully integrating the structure and text knowledge in the hyper-relation knowledge graph to generate more rich representations of entities and relationships, and designing a hyper-relation knowledge graph representation method based on dynamic fusion of structure and text information.
[0007] To achieve the above purpose, the present application provides the following scheme:
[0008] The present application provides a hyper-relation knowledge graph representation method based on dynamic fusion of structure and text information, which comprises the following steps:
[0009] Step 1: Obtain a hyper-relation knowledge graph dataset, preprocess the dataset, and divide it into a training set and a test set;
[0010] Step 2: Construct a hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information;
[0011] Step 3: Train the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2 using the training set data divided in step 1.
[0012] Step 4: Perform link prediction on the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information trained in step 3 using the test set data divided in step 1 to obtain predicted entity results.
[0013] Further, there is a preferred embodiment, and the above step 1 is specifically:
[0014] Step 1.1: Obtain a hyper-relational data set, and for each hyper-relational fact, the present application adds its inverse relation fact to the data set;
[0015] Step 1.2: Obtain text description information of all entities and relations in the hyper-relational data set;
[0016] Step 1.3: Divide the data set into a training set and a test set.
[0017] Further, there is a preferred embodiment, and the above step 2 is specifically:
[0018] Step 2.1: Obtain embedding representations of entities and relations using a graph convolutional neural network;
[0019] Step 2.2: Obtain embedding representations of structure soft prompt words by passing the embedding representations of entities and relations through a multi-layer perception machine;
[0020] Step 2.3: Use structure soft prompt word fine-tuning to fully fuse the structure and text information of entities and relations in the hyper-relational knowledge graph, and enrich the representations of entities and relations;
[0021] Step 2.4: Input the representations of entities and relations into a traditional knowledge graph embedding model ConvE model to obtain entity prediction results;
[0022] Step 2.5: Use the InfoNCE Loss loss function to reduce the representation deviation between the predicted entities and the correct entities by taking the correct entities in the prediction results as positive samples and other entities as negative samples.
[0023] Further, there is a preferred embodiment, and the above step 3 is specifically:
[0024] Step 3.1: Input the training set data divided in step 1 into the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2 to obtain entity prediction results;
[0025] Step 3.2: Input the entity prediction results obtained in step 3.1 into a cross-entropy loss function;
[0026] Step 3.3: Minimizing a joint loss function comprising a cross-entropy loss function and the InfoNCE Loss loss function in step 2.5 to train the model.
[0027] Further, there is a preferred embodiment, and the above step 4 is specifically:
[0028] Step 4.1: inputting the training set data divided in step 1 into the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2;
[0029] Step 4.2: obtaining entity prediction results.
[0030] The hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information can be fully realized by computer software, and accordingly, the present application also provides a hyper-relational knowledge graph representation system based on dynamic fusion of structure and text information, which comprises:
[0031] A storage device for obtaining a hyper-relational knowledge graph dataset, preprocessing the dataset, and dividing the dataset into a training set and a test set;
[0032] A storage device for obtaining embedding representation of entities and relationships using a graph convolutional neural network;
[0033] A storage device for constructing a hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information;
[0034] A storage device for training the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information using training set data;
[0035] A storage device for performing link prediction on the trained hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information using test set data to obtain predicted entity results.
[0036] The present application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is run by a processor to perform the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information according to any one of the above.
[0037] The present application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor performs the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information according to any one of the above.
[0038] The present application has the following advantages:
[0039] 1. To solve the problem of the existing hyper-relational knowledge graph representation method, i.e. not considering the rich text information in the hyper-relational knowledge graph. The present application provides a hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information. The text information of entities and relations is encoded by using a pre-trained language model. In order to avoid overfitting of the pre-trained language model to the text information, the present application uses a graph convolutional neural network to extract the structural knowledge in the graph, and uses the structural knowledge to generate a structural soft prompt word, which is input into the pre-trained language model together with the text information of entities and relations to fully fuse the structure and text knowledge of the model, and finally obtain more rich entity and relation representations.
[0040] Further, compared with the prior art, the present application has the beneficial effect of providing a method of fully fusing the structure and text knowledge in the hyper-relational knowledge graph, thereby generating more rich entity and relation embedding representations. In addition, the present application also fully considers the efficiency of negative sample sampling in the training process, and proposes a negative sampling method based on contrastive learning, which improves the training efficiency and model performance.
[0041] The present application is applicable to the knowledge graph representation technology in the field of knowledge graph completion. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the specific embodiments or prior art of the present application, the drawings needed in the specific embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0043] Figure 1 is a flowchart of the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information described in the present application;
[0044] Figure 2 is a model diagram of the structure aggregation encoding module described in the present application;
[0045] Figure 3 is a model diagram of the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information described in the present application. DETAILED DESCRIPTION
[0046] The specific embodiments of the present application will be further described in detail below with reference to the accompanying drawings. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present application, and these changes and improvements are within the scope of protection of the present application.
[0047] Embodiment one, see Figure 1 The present embodiment provides a super-relation knowledge graph representation method based on dynamic fusion of structure and text information, which is used to solve the shortcomings of existing super-relation knowledge graph representation methods, i.e., without considering the rich text information in the super-relation knowledge graph. By using graph convolutional neural network, pre-training language model, Transformer and contrastive learning technology, the structure and text knowledge in the super-relation knowledge graph are fully fused to generate more rich entity and relation representation, and the super-relation knowledge graph representation method includes the following steps:
[0048] As Figure 1 shown:
[0049] Step 1: Obtain a super-relation knowledge graph dataset, preprocess the dataset, and divide it into a training set and a test set;
[0050] Step 2: Construct a super-relation knowledge graph representation model based on dynamic fusion of structure and text information;
[0051] Step 3: Use the training set data divided in step 1 to train the super-relation knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2;
[0052] Step 4: Use the test set data divided in step 1 to perform link prediction on the super-relation knowledge graph representation model based on dynamic fusion of structure and text information trained in step 3, and obtain a predicted entity result.
[0053] The super-relation knowledge graph representation method based on dynamic fusion of structure and text information provided by the present embodiment encodes the text information of entities and relations by using a pre-training language model, and in order to avoid the overfitting problem of the pre-training language model to the text information, the present application uses a graph convolutional neural network to extract the structure knowledge in the graph, and uses the structure knowledge to generate a structure soft prompt word, which is input into the pre-training language model together with the text information of entities and relations to fully fuse the structure and text knowledge of the model, and finally obtain more rich entity and relation representation.
[0054] Embodiment two, the present embodiment is an example of step 1 in the super-relation knowledge graph representation method based on dynamic fusion of structure and text information described in embodiment one;
[0055] Step 1: Obtain the hyper-relation knowledge graph dataset, preprocess the dataset, and divide it into a training set and a test set;
[0056] Specifically, the following steps are included:
[0057] Step 1.1: Obtain the hyper-relation dataset. For each hyper-relation fact, the embodiment adds its inverse relation fact to the dataset;
[0058] Step 1.2: Obtain the text description information of all entities and relations in the hyper-relation dataset;
[0059] Step 1.3: Divide the dataset into a training set and a test set.
[0060] Embodiment Three, see Figure 2 This embodiment is an example of Step 2 in the hyper-relation knowledge graph representation method based on dynamic fusion of structure and text information described in Embodiment One;
[0061] Step 2: Construct a hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information;
[0062] Specifically, the following steps are included:
[0063] Step 2.1: Use a graph convolutional neural network to obtain the embedding representation of entities and relations;
[0064] First, the embedding representation of entities and relations in the hyper-relation knowledge graph is randomly initialized, and then the embedding representation of the qualifier is obtained by fusing the representation of all entities and relations in the qualifier of the hyper-relation fact:
[0065]
[0066] where h q represents the embedding representation of all qualifiers corresponding to the hyper-relation fact, h qv is the entity representation in the qualifier, and h qr is the relation representation in the qualifier, where W Q is a shared weight, and Q iurv represents the set of all qualifiers of the current hyper-relation fact. Then, the relation representation of the main triple in the hyper-relation fact and the qualifier representation are calculated by weighting to obtain the aggregated relation representation:
[0067] h rq = αh r + (1-α)h q
[0068] where h rqdenotes the representation of the relation after the qualifier is aggregated. rq by the relation representation h r and the qualifier representation h q The weighted sum of the two is obtained. To prevent setting a as a hyperparameter, the present embodiment sets a as a learnable parameter, which controls the proportion of the relation's own information and the qualifier information in the update of the relation. Finally, the own representation of the node is fused with the aggregated relation representation to obtain the representation of the node, and the representations of the neighbor nodes of the node are obtained, the representations of the neighbor nodes are fused using the graph convolutional neural network, and the representation of the target node is updated, and the relation representation is updated:
[0069]
[0070] where N(v) denotes the neighbor node set of node v, W λ(r) is related to the direction of the edge (relation), and corresponds to three shared parameter matrices for in-edge, out-edge and self-edge respectively. In-edge means that information can flow in both directions, not just along the direction of the edge, but also in the opposite direction. Self-edge means that each node should also have an edge from itself to itself, so that the original state of the node can be preserved when aggregating the information of its neighbor nodes. As shown in the structure aggregation encoding module enhances the representation of the relation by merging multiple additional qualifier representations, and in addition, this method has no restrictions on the order of input and the number of qualifiers. Figure 2
[0071] Step 2.2: The embedded representations of entities and relations are input into a multi-layer perceptron to obtain the embedded representation of the structural soft prompt word;
[0072] In order to make the structural soft prompt word contain the structural knowledge in the hyper-relation knowledge graph, the representations of entities and relations obtained in the last step are input into a multi-layer perceptron:
[0073] S = W out ·(σ(W in ·x))
[0074] where W in and W out denote the parameter matrices in the multi-layer perceptron, and σ denotes a nonlinear activation function. The embedded representation of the structural soft prompt word is denoted by S. The output of the multi-layer perceptron is obtained, and this output is used as the embedded representation S of the structural soft prompt word. Then S is uniformly distributed to the first position of the input of the L-layer Transformer layer in the pre-trained language model:
[0075] S = distribute(F(E e ,E r ))
[0076] where distribute() denotes the uniform distribution of the structural soft prompts S to the head positions of the L-layer Transformer layer input of the pre-trained language model, E e denotes the embedding representation of an entity, E r denotes the embedding representation of a relation.
[0077] Step 2.3: Use structural soft prompts to fine-tune the structural and textual information of entities and relations in the hyper-relation knowledge graph, enrich the representation of entities and relations;
[0078] The structural soft prompts are a set of trainable vector sequences that are added to the input head of the pre-trained language model with frozen parameters. Inputting the structural soft prompts together with the textual description information of each element of the hyper-relation fact into the pre-trained language model with frozen parameters can effectively avoid the overfitting problem of textual information caused by fine-tuning the pre-trained language model. This embodiment first organizes the structural soft prompts and the textual description information of each element in the hyper-relation fact into a sequence as the input of the pre-trained language model. S trainable vector sequences are added before the input of each layer of the Transformer. This embodiment defines the jth layer of the structural soft prompt as The hidden state of the ith position in the jth layer is defined as follows:
[0079]
[0080] where w i is the word embedding vector in the input, and Trans() is the forward function of the Transformer model, which acts on the entire sequence. Then the structure and text knowledge of the hyper-relation knowledge graph is fused using the self-attention mechanism of the Transformer model in the pre-trained language model. During training, the parameters of the pre-trained language model remain unchanged, and only the embedding representation of the structural soft prompt is updated. During the Trans() process, the structural and semantic knowledge in the graph is fully fused. Initially, the structural soft prompt only contains the structural knowledge in the hyper-relation knowledge graph. However, with the application of the self-attention mechanism in the Transformer, the structural soft prompt constantly integrates semantic knowledge from the text information. Finally, the structural soft prompt not only contains structural knowledge, but also contains semantic knowledge.
[0081] Step 2.4: Input the representation of entities and relations into the traditional knowledge graph embedding model ConvE model to obtain the entity prediction result;
[0082] The output of the last layer of the Transformer in this embodiment is the hidden layer state of the structural soft prompt word, which is used as the representation of the entity and the relationship. The representation of the entity and the relationship is then input into a traditional knowledge graph embedding model, ConvE model, to obtain the scoring results of all entities, and the entity with the highest score is taken as the result of entity prediction. In the ConvE model, the vectors of the head entity and the relationship are stacked and then organized into a two-dimensional tensor. A two-dimensional convolution kernel is used for convolution to obtain a feature vector, which is then projected into a space with the same dimension as the representation of the entity and the relationship through a fully connected layer, and matched with the representation of the candidate target entity in an inner product layer.
[0083] Step 2.5: The correct entity in the prediction result is taken as a positive sample, and other entities are taken as negative samples. An InfoNCE Loss loss function is used to reduce the representation deviation between the predicted entity and the correct entity.
[0084] In this embodiment, the predicted entity of a sample in the same batch is taken as an anchor point, and the corresponding correct entity is taken as a positive sample. The head entity and the predicted entity of other samples in the same batch are taken as negative samples. Then, InfoNCE Loss is used as part of the joint loss function to reduce the representation deviation between the predicted entity and the correct entity.
[0085] In this embodiment, InfoNCE loss function is used:
[0086]
[0087] where |N| represents the size of the batch, and there are |N| head entities and |N-1| predicted entities as negative samples. γ>0 encourages the model to increase the score of the correct fact (h, r, t, Q). The temperature coefficient τ allows the model to adjust the relative importance of the negative samples. A smaller τ makes the loss function more focused on hard negative samples, but increases the risk of overfitting to label noise. In order to avoid setting τ as a hyperparameter, this embodiment sets as a learnable parameter.
[0088] In order to make the structural soft prompt word contain the structural knowledge in the hyper-relation knowledge graph, the representation of the entity and the relationship is input into a multi-layer perceptron, and the output of the multi-layer perceptron is obtained as the embedding representation of the structural soft prompt word.
[0089] In order to effectively avoid the problem of overfitting to text information caused by fine-tuning the pre-trained language model, the structural soft prompt word and the text description information of each element of the hyper-relation fact are input into the pre-trained language model with frozen parameters.
[0090] Embodiment four, this embodiment is to illustrate step 3 in the method for representing a hyper-relational knowledge graph based on dynamic fusion of structure and text information according to embodiment three;
[0091] Step 3: constructing a hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information;
[0092] Specifically comprising the following steps:
[0093] Step 3.1: inputting the training set data divided in step 1 into the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2 to obtain entity prediction results;
[0094] Step 3.2: inputting the entity prediction results obtained in step 3.1 into a cross-entropy loss function;
[0095] Step 3.3: minimizing a joint loss function comprising the cross-entropy loss function and the InfoNCE Loss loss function in step 2.5 to train the model.
[0096] In this embodiment, the loss function is designed as a joint loss function:
[0097] L = L ConvE + L EIBS
[0098] Wherein, L ConvE is the loss function of the ConvE model, i.e. the cross-entropy loss function:
[0099]
[0100] Wherein, p is the probability distribution of the predicted entity in the set of all entities, and y is the label, i.e. 1 if it is the correct answer, otherwise 0. However, since the one-hot label limits each prediction task to a single answer, but in reality it may not be the case, therefore this embodiment uses label smoothing to alleviate this limitation. This strategy enables this embodiment to narrow the representation gap between the predicted entity and the correct entity, while widening the representation gap with other entities.
[0101] By continuously optimizing the loss function, all parameters of the model are updated.
[0102] Embodiment five, this embodiment is to illustrate step 4 in the method for representing a hyper-relational knowledge graph based on dynamic fusion of structure and text information according to embodiment one;
[0103] Step 4: using the test set data divided in step 1 to perform link prediction on the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information trained in step 3 to obtain predicted entity results.
[0104] Specifically comprising the following steps:
[0105] Step 4.1: input the training set data divided in step 1 into the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2;
[0106] Step 4.2: obtain the entity prediction result.
[0107] Embodiment six, see Figure 3 This embodiment is described, and this embodiment provides a system based on the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information according to the first embodiment, the system comprises:
[0108] A storage device for obtaining a hyper-relational knowledge graph dataset, preprocessing the dataset, and dividing the dataset into a training set and a test set;
[0109] A storage device for obtaining embedding representation of entities and relationships using a graph convolutional neural network;
[0110] A storage device for constructing a hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information;
[0111] A storage device for training the hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information using training set data;
[0112] A storage device for performing link prediction on the trained hyper-relational knowledge graph representation model based on dynamic fusion of structure and text information using test set data, and obtaining a predicted entity result.
[0113] Embodiment seven, this embodiment provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is run by a processor to execute the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information according to any one of the first embodiment to the fifth embodiment.
[0114] Embodiment eight, this embodiment provides a computer device, the device comprises a memory and a processor, the memory stores a computer program, when the processor runs the computer program stored in the memory, the processor executes the hyper-relational knowledge graph representation method based on dynamic fusion of structure and text information according to any one of the first embodiment to the fifth embodiment.
[0115] The computer device or system provided by the embodiment includes a processor and a memory, wherein the processor and the memory can be connected through a bus or other manners, the memory is a non-transitory computer readable storage medium, and can be used to store a non-transitory software program, a non-transitory computer executable program and a module, and corresponding program instructions / module. The processor executes various functions and data processing of the processor by running the non-transitory software program, instructions and modules stored in the memory, so as to realize the method for dynamically fusing the super-relation knowledge graph based on structure and text information.
[0116] The memory can include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required by a function. The data storage area can store data created by the processor and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged with respect to the processor, and these remote memories can be connected to the processor through a network. Examples of the network include but are not limited to the Internet, an intranet, an extranet, a mobile communication network, and a combination thereof.
[0117] One or more modules are stored in the memory, and when the processor executes, the method steps in the embodiment are executed. Thus, the method and device of the application and the flow can realize the inventive purpose of the application. The above computer device specific details can be understood by referring to the corresponding related description and effects in the embodiment, which will not be described here.
[0118] Those skilled in the art can understand that all or part of the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a computer readable storage medium. When the program is executed, it can include the flow of the above-mentioned embodiment methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD), etc. The storage medium can also include a combination of the above-mentioned kinds of memories.
[0119] The above merely describes the embodiments of the present application, and is not limited to the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A method for representing an ultra-relation knowledge graph based on dynamic fusion of structure and text information, characterized in that, The method comprises the following steps: Step 1: obtain a hyper-relation knowledge graph dataset, preprocess the dataset, and divide the dataset into a training set and a test set; Step 2: construct a hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information; Step 2 specifically comprises: Step 2.1: obtain embedding representations of entities and relations using a graph convolutional neural network; Step 2.2: obtain embedding representations of structure soft prompt words by passing the embedding representations of entities and relations through a multilayer perceptron; Step 2.3: use structure soft prompt words to fine-tune the structure and text information of entities and relations in the hyper-relation knowledge graph, and enrich the representations of entities and relations; Step 2.4: input the representations of entities and relations into a traditional knowledge graph embedding model ConvE model to obtain entity prediction results; Step 2.5: use the correct entities in the prediction results as positive samples and other entities as negative samples, and use an InfoNCELoss loss function to reduce the representation deviation between the predicted entities and the correct entities; Step 3: train the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2 using the training set data divided in step 1; Step 3 specifically comprises: Step 3.1: input the training set data divided in step 1 into the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2 to obtain entity prediction results; Step 3.2: input the entity prediction results obtained in step 3.1 into a cross-entropy loss function; Step 3.3: minimize the joint loss function containing the cross-entropy loss function and the InfoNCE Loss loss function in step 2.5 to train the model; Step 4: perform link prediction on the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information trained in step 3 using the test set data divided in step 1 to obtain predicted entity results; Step 4 specifically comprises: Step 4.1: input the training set data divided in step 1 into the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information constructed in step 2; Step 4.2: obtain entity prediction results. 2.The method of claim 1, wherein, Step 1 specifically comprises: Step 1.1: obtain a hyper-relation dataset, and for each hyper-relation fact, add its inverse relation fact to the dataset; Step 1.2: obtain text description information of all entities and relations in the hyper-relation dataset; Step 1.3: divide the dataset into a training set and a test set.
3. A hyper-relational knowledge graph representation system based on dynamic fusion of structure and text information, characterized in that, The system comprises: a storage device for obtaining a hyper-relation knowledge graph dataset, preprocessing the dataset, and dividing the dataset into a training set and a test set; a storage device for constructing a hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information; specifically comprising: obtaining embedding representations of entities and relations using a graph convolutional neural network; obtaining embedding representations of structure soft prompt words by passing the embedding representations of entities and relations through a multilayer perceptron; using structure soft prompt words to fine-tune the structure and text information of entities and relations in the hyper-relation knowledge graph, and enrich the representations of entities and relations; Input the representation of the entity and the relationship into a traditional knowledge graph embedding model ConvE model to obtain an entity prediction result; Correct entities in the prediction result are taken as positive samples and other entities are taken as negative samples, and an InfoNCE Loss loss function is used to reduce the representation deviation between the prediction entities and the correct entities; The storage device is used for training the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information using training set data. Specifically, The divided training set data is input into the hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information to obtain an entity prediction result; The obtained entity prediction result is input into a cross-entropy loss function; A joint loss function containing the cross-entropy loss function and the InfoNCE Loss loss function is minimized to train the model; The storage device is used for performing link prediction on the trained hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information using test set data to obtain a prediction entity result. Specifically, The divided training set data is input into the constructed hyper-relation knowledge graph representation model based on dynamic fusion of structure and text information; An entity prediction result is obtained.
4. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is run by the processor to execute the hyper-relation knowledge graph representation method based on dynamic fusion of structure and text information according to any one of claims 1-2.
5. A computer device, comprising: The device includes a memory and a processor, and the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the hyper-relation knowledge graph representation method based on dynamic fusion of structure and text information according to any one of claims 1-2.
Citation Information
Patent Citations
Knowledge graph embedding method based on graph convolution contrast learning and XLNet
CN115936115A
Multi-modal knowledge graph establishment method and application
CN117131933A