A knowledge representation learning method based on graph attention network
Through the knowledge representation learning method based on graph attention network, combined with social networks and visual features, and using topic tags to fusion of static knowledge bases, the problem of reducing the relevance of knowledge questions and answers caused by dynamic changes in entity meaning is solved, and the accurate extraction of entity-derived meanings and timely update of answers is achieved.
Patent Information
- Application Number
- CN202211601860.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-12-14
AI Technical Summary
In the big data environment, dynamic changes in entity meaning lead to a decrease in correlation between answers and questions in knowledge questions and answers, and it is difficult for existing methods to accurately identify the derived meaning of entities.
The knowledge representation learning method based on graph attention network is adopted, combined with the timing of social networks and the visual characteristics of entity changes, and through topic tags as intermediate media, static knowledge bases and time series are used to construct a text-visual similarity dynamic matching model to mine the derivative meaning of entity changes.
It realizes the timely and effective extraction of the derived meaning of the entity when the entity's meaning changes, and improves the accuracy of the results of knowledge questions and answers.
Smart Images

Figure CN115936119B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge representation learning technology, and in particular to a knowledge representation learning method based on a graph attention network. Background Art
[0002] With the development of information technology, the various information generated by the Internet has exploded, and many large-scale knowledge bases have emerged. Knowledge bases regard specific things or abstract concepts in social life as entities, and use relationships to describe the connections between entities. Among them, knowledge representation is a key issue throughout the entire process of knowledge acquisition, knowledge base construction and knowledge-driven application. Knowledge representation learning is based on distributed representation, and converts problems such as approximate semantic computing and reasoning queries into vector calculations in low-dimensional vector spaces. The learned entity and relationship vectors can be applied to a variety of knowledge-driven application tasks, among which knowledge representation learning is widely used in knowledge question answering, and knowledge question answering uses triples in knowledge graphs to answer questions. Knowledge representation learning can map the entities and relationships of natural language questions to the vertices and edges of knowledge graphs. However, the entity names represented in triples can have multiple meanings in multiple fields, which will cause A large number of candidate answers leads to a decrease in the correlation between the answer and the question, that is, the answer is not related to the question. The study found that a knowledge representation learning method based on graph convolutional neural network learns the vector representation of the node by aggregating the information of the node's neighboring node group. The convolution operation in the graph convolutional neural network usually uses a function operation to aggregate the information of the neighboring node group to generate a vector representation of a node. At the same time, the local attention mechanism is used to perform the knowledge question answering task on the knowledge graph, and the random walk algorithm is used to extract the global node relevance score of the node by integrating global information, so as to improve the knowledge representation learning. However, in the big data environment, the meaning of the entity is in dynamic change, especially in social networks, there will be a phenomenon that the existing entity semantics are given cross-domain derivative meanings. Therefore, how to identify the derivative meanings of these entities in knowledge representation learning is of great significance to improving the accuracy of the knowledge question answering results. Summary of the Invention
[0003] The purpose of the present invention is to provide a knowledge representation learning method based on a graph attention network. Based on the temporal and sudden nature of social networks and combined with the visual features of entity changes, the text features of entity changes are fused and associated with the visual features across domains. Topic tags are selected as intermediate media, a static knowledge base is integrated, and a text-visual similarity dynamic matching model is constructed based on time series. The key information of entity changes is integrated from different perspectives to further mine the derived meanings of entity changes. This ensures that the knowledge representation learning model can extract the derived meanings of entities in a timely and effective manner when the meaning of entities changes, which can effectively solve the problems in the background technology.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A knowledge representation learning method based on graph attention network includes the following analysis steps:
[0006] S1: Input the question text into the embedding layer, extract the entity names in the question text, output the triple standard graph of the question according to the knowledge graph, define a knowledge graph G = (E, R) in the knowledge base, and triple S = {(h, r, t)}, where E represents the entity set in the knowledge graph, R represents the set of relations in the knowledge graph, h represents the head entity in the triple, t represents the tail entity in the triple, and r represents the relationship between the head and tail entities in the triple. At the same time, input the social network dataset and link the relevant topic tags in the social network dataset according to the entity name in the question. For a label node, it includes text attributes, image attributes and time attributes;
[0007] S2: Compare and calculate the similarity between the relevant topic tags and the entity name, select the topic tag with the highest similarity as the analysis object that conforms to the entity semantics in the social network, and map the feature X of the topic tag in the embedding layer based on the time attribute of the tag node = (V T , V P ,t),V T The text feature set representing the topic tag, V P represents the image feature set of the topic tag, t represents the time distribution of the topic tag, the features in the tag node are converted into a d0-dimensional vector, and the text features and image features of the topic tag are fused to extract the feature vector of the topic tag;
[0008] S3: Input the feature vector of the topic tag into the classifier to generate the semantic segmentation result Y1 and calculate the classification loss function;
[0009] S4: Analyze the entity semantics of the triple based on the static knowledge base, introduce the adjacent node information based on the attention mechanism to perform local feature analysis, and at the same time incorporate the global information of the knowledge graph into the local features to obtain the semantic result information Y2 of the entity in the context of the global information of the knowledge base;
[0010] S5: Feedback the entity semantic segmentation result Y1 extracted based on the label node into the triple, update the entity information in the triple, analyze the entity semantics of the updated triple, and obtain the updated semantic result information Y3;
[0011] S6: Perform a correlation comparison analysis on the semantic result information Y2 and the semantic result information Y3 with the question itself, select the entity semantic with the highest correlation with the question itself as the analysis object, and calculate the comparison loss function at the same time;
[0012] S7: Select the weighted sum of the topic tag classification loss function and the triple entity semantic analysis comparison loss function as the total loss function for knowledge representation learning;
[0013] S8: Based on the total loss function of knowledge representation learning, the entity semantics with the highest relevance are incorporated into the knowledge question answering training model to obtain the answer to the question.
[0014] As a further solution of the present invention: the topic tag with the highest similarity in S2 is selected by defining a related topic tag set La = {La i}, entity name set h = {h i}, the target topic tag is z={z i}, select the semantic similarity between the target topic and the entity name in the relevant topic tags
[0015] La i ∩z represents the node La of the related topic tag set i The common set with the target topic set, p(i|z) represents the label La i The probability of i corresponding to z, add label node La i With z i The street weight w(La i , z i ) Calculate the semantic consistency S between the label and the entity, that is,
[0016] S=Sim(z|La i , h i )+w(La i , z i ), select the topic tags with high consistency scores with entity semantics as the analysis objects that conform to entity semantics in social networks.
[0017] As a further solution of the present invention: the text features and image features of the topic tags are fused in S2 to extract the feature vector of the topic tags. The correlation between the text features and the image features is analyzed under the guidance of the time distribution t of the topic tags. The text features Vt and the image features Vp are input to the attention layer, and the fused feature vector of the topic tags is obtained by generating the text and image under the guidance of the time distribution t with the help of the softmax function.
[0018] Xi={Vti,Vpi}∈R, represents the attention distribution guided by the time distribution t, σ represents the weight parameter of the text feature Vt and the image feature Vp in the attention layer, Wp represents the weight of the text feature Vt and the image feature Vp in the attention layer, and bp represents the offset value of the text feature Vt and the image feature Vp in the attention layer.
[0019] As a further solution of the present invention: the semantic segmentation result Y1 in S3 is generated by combining the fusion feature vector X of the topic label i Input to a fully connected layer, where the softmax activation function is used to perform semantic classification prediction on the nodes of each feature vector, that is, the classification prediction probability Represents the eigenvector matrix X i The transposed matrix, W f Represents the parameter matrix of the classification training model, f is the number of categories contained in the training data set, and the semantic segmentation result Y1 is output according to the classification prediction probability, corresponding to the classification loss function p ij represents the distribution probability of node i in the jth dimension, f i Represents the true classification label of node i.
[0020] As a further solution of the present invention: the local feature analysis of the entity semantics of the triple in S4 is to use the softmax activation function to evaluate the local feature attention value H of the triple, and input the triple feature relationship e i Represents the head entity in the triple, e j Represents the tail entity in the triple, r k Represents the head entity e in the triple i With the tail entity e j The relationship between
[0021] The adjacency matrix represents the triple vector relationship matrix, and the LaekyReLU activation function is introduced to perform linear correction on the connection relationship of the triples. represents the l-th layer linear transformation matrix in the attention layer, represents the l-th layer linear weight matrix in the attention layer, Indicates e i 、r k 、e j In the output embedding of the L-1th layer of the attention layer, ‖ represents the concatenation between features.
[0022] As a further solution of the present invention: In S4, a global feature attention network is introduced into the local attention mechanism, and based on the global random walk algorithm, the tail entity e is introduced in the first layer of the attention layer. j The output embedding value of Select to incorporate local feature H into global entity aggregation, then
[0023] σ represents the Sigmoid activation function, Represents the head entity e in the global walk algorithm i The global entity importance of H represents the local feature attention value of the triple. Used to calculate triple feature relationships The linear transformation matrix of the entity is introduced, and a projection matrix W' is introduced to retain the initial information of the entity to obtain the final entity embedding represents the initial embedding entity vector, Represents the embedded entity vector at the lth layer of the attention layer, selecting the final entity embedding The corresponding semantics is taken as the semantic result Y2 obtained by analyzing the triple content.
[0024] As a further solution of the present invention: S5 is a feedback loop path, which uses the entity semantic segmentation result Y1 as the updated head entity of the triple, re-analyzes the entity semantics of the triple with the updated head entity, and outputs the corresponding updated entity embedding tail entity by fusing local features and global background. The final feedback entity embedding vector is obtained by combining the head entity and the tail entity, and the semantics corresponding to the final feedback entity vector is used as the semantic result information Y3 output by the feedback network.
[0025] As a further solution of the present invention: the comparative analysis of the relevance between the semantic result and the question itself in S6 is to determine the semantic relevance between the semantic result and the question itself by calculating the semantic distance between the semantic result and the question itself. The smaller the semantic distance, the greater the semantic relevance.
[0026] Where Y = {Y2, Y3}, α represents the adjustment parameter. By introducing the adjustment parameter, the semantic distance between the semantic result information Y2 and the semantic result information Y3 and the question itself P is calculated.
[0027] D0(Y, P) represents the link distance between the semantic result Y and the question itself P, D L (Y, P) represents the category distance between the semantic result Y and the question itself P, and the corresponding contrast loss function
[0028]
[0029] ∑ (h,r,t)∈R ∑ (h′,r,t′)∈R ′max(0, f(h, r, t)+γ-f(h′, r, t′) is used to calculate the model training loss function for triple semantic analysis. Used to calculate the comparison loss function of the relevance between the output semantics and the question.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] Based on the temporal and sudden nature of social networks, combined with the visual features of entity changes, the text features of entity changes are fused and associated with the visual features across domains. Topic tags are selected as the intermediate medium, and a static knowledge base is integrated to build a text-visual similarity dynamic matching model based on time series. The key information of entity changes is integrated from different perspectives to explore the derived meanings of entity changes. This enables the knowledge representation learning model to extract the derived meanings of entities in a timely and effective manner when the meaning of entities changes. To a certain extent, it solves the problem that the knowledge representation learning model in knowledge question and answering is not accurate enough in grasping the semantic changes of entities. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 A flowchart of a knowledge representation learning method based on graph attention network;
[0034] Figure 2 A structural diagram of a knowledge representation learning method based on graph attention network. DETAILED DESCRIPTION
[0035] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] Example 1:
[0037] See also Figure 1-Figure 2 In an embodiment of the present invention, a knowledge representation learning method based on a graph attention network includes the following analysis steps:
[0038] S1: Input the question text into the embedding layer, extract the entity names in the question text, output the triple standard graph of the question according to the knowledge graph, define a knowledge graph G = (E, R) in the knowledge base, and triple S = {(h, r, t)}, where E represents the entity set in the knowledge graph, R represents the set of relations in the knowledge graph, h represents the head entity in the triple, t represents the tail entity in the triple, and r represents the relationship between the head and tail entities in the triple. At the same time, input the social network dataset and link the relevant topic tags in the social network dataset according to the entity name in the question. For a label node, it includes text attributes, image attributes and time attributes;
[0039] S2: Compare and calculate the similarity between the relevant topic tags and the entity name, select the topic tag with the highest similarity as the analysis object that conforms to the entity semantics in the social network, and map the feature X of the topic tag in the embedding layer based on the time attribute of the tag node = (V T , V P ,t),V T The text feature set representing the topic tag, V P represents the image feature set of the topic tag, t represents the time distribution of the topic tag, the features in the tag node are converted into a d0-dimensional vector, and the text features and image features of the topic tag are fused to extract the feature vector of the topic tag;
[0040] S21: Select the topic tag with the highest similarity by defining the related topic tag set La = {La i}, entity name set h = {h i}, the target topic tag is z={z i}, select the semantic similarity between the target topic and the entity name in the relevant topic tags , La i ∩z represents the node La of the related topic tag set i The common set with the target topic set, p(i|z) represents the label La i The probability of i corresponding to z, add label node La i With z i The street weight w(La i , z i ) Calculate the semantic consistency S between the label and the entity, that is, S = Sim(z|La i , h i )+w(La i , z i ), select the topic tags with high consistency scores with entity semantics as the analysis objects that conform to entity semantics in social networks;
[0041] S22: Fuse the text features and image features of the topic tag to extract the feature vector of the topic tag. Under the guidance of the time distribution t of the topic tag, analyze the correlation between the text features and the image features, input the text features Vt and the image features Vp into the attention layer, and use the softmax function to generate the fusion feature vector of the topic tag under the guidance of the time distribution t. Xi={Vti,Vpi}∈R, represents the attention distribution guided by the time distribution t, σ represents the weight parameter of the text feature Vt and the image feature Vp in the attention layer, Wp represents the weight of the text feature Vt and the image feature Vp in the attention layer, and bp represents the offset value of the text feature Vt and the image feature Vp in the attention layer.
[0042] S3: Input the feature vector of the topic tag into the classifier, and then i Input to a fully connected layer, where the softmax activation function is used to perform semantic classification prediction on the nodes of each feature vector, that is, the classification prediction probability Represents the eigenvector matrix X i The transposed matrix, W f Represents the parameter matrix of the classification training model, f is the number of categories contained in the training data set, outputs the semantic segmentation result Y1 according to the classification prediction probability, and calculates the classification loss function at the same time. p ij represents the distribution probability of node i in the jth dimension, f i represents the true classification label of node i;
[0043] S4: Analyze the entity semantics of the triple based on the static knowledge base, introduce the adjacent node information based on the attention mechanism to perform local feature analysis, and at the same time incorporate the global information of the knowledge graph into the local features to obtain the semantic result information Y2 of the entity in the context of the global information of the knowledge base;
[0044] S5: Feedback the entity semantic segmentation result Y1 extracted based on the label node into the triple, update the entity information in the triple, analyze the entity semantics of the updated triple, and obtain the updated semantic result information Y3;
[0045] S6: Perform a correlation comparison analysis on the semantic result information Y2 and the semantic result information Y3 with the question itself, select the entity semantic with the highest correlation with the question itself as the analysis object, and calculate the comparison loss function at the same time;
[0046] S7: Select the weighted sum of the topic tag classification loss function and the triple entity semantic analysis comparison loss function as the total loss function for knowledge representation learning;
[0047] S8: Based on the total loss function of knowledge representation learning, the most relevant entity semantics are incorporated into the knowledge question answering training model to obtain the answer to the question.
[0048] By adopting the above technical solutions: based on the temporal and sudden nature of social networks, combined with the visual features of entity changes, the text features of entity changes are fused and associated with the visual features across domains, topic tags are selected as intermediate media, and a static knowledge base is integrated. A text-visual similarity dynamic matching model is constructed based on time series. The key information of entity changes is integrated from different perspectives to explore the derived meanings of entity changes. This enables the knowledge representation learning model to extract the derived meanings of entities in a timely and effective manner when the meaning of entities changes. To a certain extent, it solves the problem of the knowledge representation learning model in knowledge question and answering not being able to accurately grasp the semantic changes of entities.
[0049] Example 2:
[0050] See also Figure 1-Figure 2 In an embodiment of the present invention, a knowledge representation learning method based on a graph attention network includes the following analysis steps:
[0051] S1: Input the question text into the embedding layer, extract the entity names in the question text, output the triple standard graph of the question according to the knowledge graph, define a knowledge graph G = (E, R) in the knowledge base, and triple S = {(h, r, t)}, where E represents the entity set in the knowledge graph, R represents the set of relations in the knowledge graph, h represents the head entity in the triple, t represents the tail entity in the triple, and r represents the relationship between the head and tail entities in the triple. At the same time, input the social network dataset and link the relevant topic tags in the social network dataset according to the entity name in the question. For a label node, it includes text attributes, image attributes and time attributes;
[0052] S2: Compare and calculate the similarity between the relevant topic tags and the entity name, select the topic tag with the highest similarity as the analysis object that conforms to the entity semantics in the social network, and map the feature X of the topic tag in the embedding layer based on the time attribute of the tag node = (V T , V P ,t),V T The text feature set representing the topic tag, V P represents the image feature set of the topic tag, t represents the time distribution of the topic tag, the features in the tag node are converted into a d0-dimensional vector, and the text features and image features of the topic tag are fused to extract the feature vector of the topic tag;
[0053] S3: Input the feature vector of the topic tag into the classifier to generate the semantic segmentation result Y1 and calculate the classification loss function;
[0054] S4: Analyze the entity semantics of the triple based on the static knowledge base, introduce the adjacent node information based on the attention mechanism to perform local feature analysis, and at the same time incorporate the global information of the knowledge graph into the local features to obtain the semantic result information Y2 of the entity in the context of the global information of the knowledge base;
[0055] S41: Perform local feature analysis on the entity semantics of the triple, using the softmax activation function to evaluate the local feature attention value H of the triple, and input the triple feature relationship e i Represents the head entity in the triple, e j Represents the tail entity in the triple, r k Represents the head entity e in the triple i With the tail entity e j The relationship between The adjacency matrix represents the triple vector relationship matrix, and the LaekyReLU activation function is introduced to perform linear correction on the connection relationship of the triples. represents the l-th layer linear transformation matrix in the attention layer, represents the l-th layer linear weight matrix in the attention layer, Indicates e i 、r k 、e j In the output embedding of the L-1th layer of the attention layer, ‖ represents the cascade between features;
[0056] S42: Introduce the global feature attention network into the local attention mechanism, and based on the global random walk algorithm, introduce the tail entity e in the lth layer of the attention layer j The output embedding value of Select to incorporate local feature H into global entity aggregation, then
[0057] σ represents the Sigmoid activation function, Represents the head entity e in the global walk algorithm i The global entity importance of H represents the local feature attention value of the triple. Used to calculate triple feature relationships The linear transformation matrix of the entity is introduced, and a projection matrix W' is introduced to retain the initial information of the entity to obtain the final entity embedding represents the initial embedding entity vector, Represents the embedded entity vector at the lth layer of the attention layer, selecting the final entity embedding The corresponding semantics is taken as the semantic result Y2 obtained by analyzing the triple content.
[0058] S5: Feedback the entity semantic segmentation result Y1 extracted based on the label node into the triple, use a feedback loop path to use the entity semantic segmentation result Y1 as the updated head entity of the triple, re-analyze the entity semantics of the triple with the updated head entity, output the corresponding updated entity embedding tail entity by fusing local features and global background, and obtain the final feedback entity embedding vector by combining the head entity and the tail entity. The semantics corresponding to the final feedback entity vector is used as the semantic result information Y3 output by the feedback network;
[0059] S6: Perform a correlation comparison analysis on the semantic result information Y2 and the semantic result information Y3 with the question itself. The correlation comparison analysis is to determine the semantic correlation between the semantic result and the question itself by calculating the semantic distance between the semantic result and the question itself. The smaller the semantic distance, the greater the semantic correlation.
[0060] Where Y = {Y2, Y3}, α represents the adjustment parameter, and the semantic distance between the semantic result information Y2 and the semantic result information Y3 and the question itself P is calculated by introducing the adjustment parameter. D0(Y, P) represents the link distance between the semantic result Y and the question itself P. L (Y, P) represents the category distance between the semantic result Y and the question itself P, and the corresponding contrast loss function
[0061]
[0062] ∑ (h,r,t)∈R ∑ (h′,r,t′) ∈R′max(0,f(h,r,t)+γ-f(h′,r,t′) is used to calculate the model training loss function for triple semantic analysis, Comparative loss function used to calculate the relevance between output semantics and questions;
[0063] S7: Select the weighted sum of the topic tag classification loss function and the triple entity semantic analysis comparison loss function as the total loss function for knowledge representation learning;
[0064] S8: Based on the total loss function of knowledge representation learning, the entity semantics with the highest relevance are incorporated into the knowledge question answering training model to obtain the answer to the question.
[0065] By adopting the above technical solution: integrating the global attention network based on the local attention mechanism, mining the triple entity features in the global context, and combining the entity semantic analysis based on topic tags of the social network platform, a feedback loop path for entity semantic update is constructed, which can timely grasp the dynamic meaning of entity changes and update the answers corresponding to questions in time according to the dynamic changes of entity semantics, thereby improving the accuracy of dynamic answers to a certain extent.
[0066] The above is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solutions and inventive concepts of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A knowledge representation learning method based on graph attention network, characterized by: The analysis steps include: S1: Input the question text into the embedding layer, extract the entity names in the question text, output the triple standard graph of the question according to the knowledge graph, define a knowledge graph G = (E, R) in the knowledge base, and triple S = {(h, r, t)}, where E represents the entity set in the knowledge graph, R represents the set of relations in the knowledge graph, h represents the head entity in the triple, t represents the tail entity in the triple, and r represents the relationship between the head and tail entities in the triple. At the same time, input the social network dataset and link the relevant topic tags in the social network dataset according to the entity name in the question. For a label node, it includes text attributes, image attributes and time attributes; S2: Compare and calculate the similarity between the relevant topic tags and the entity name, select the topic tag with the highest similarity as the analysis object that conforms to the entity semantics in the social network, and map the feature X of the topic tag in the embedding layer based on the time attribute of the tag node = (V T , V P ,t),V T The text feature set representing the topic tag, V P represents the image feature set of the topic tag, t represents the time distribution of the topic tag, the features in the tag node are converted into a d0-dimensional vector, and the text features and image features of the topic tag are fused to extract the feature vector of the topic tag; S3: Input the feature vector of the topic tag into the classifier to generate the semantic segmentation result Y1 and calculate the classification loss function; S4: Analyze the entity semantics of the triple based on the static knowledge base, introduce the adjacent node information based on the attention mechanism to perform local feature analysis, and at the same time incorporate the global information of the knowledge graph into the local features to obtain the semantic result information Y2 of the entity in the context of the global information of the knowledge base; S5: Feedback the entity semantic segmentation result Y1 extracted based on the label node into the triple, update the entity information in the triple, analyze the entity semantics of the updated triple, and obtain the updated semantic result information Y3; S6: Perform a correlation comparison analysis on the semantic result information Y2 and the semantic result information Y3 with the question itself, select the entity semantic with the highest correlation with the question itself as the analysis object, and calculate the comparison loss function at the same time; S7: Select the weighted sum of the topic tag classification loss function and the triple entity semantic analysis comparison loss function as the total loss function for knowledge representation learning; S8: Based on the total loss function of knowledge representation learning, the entity semantics with the highest relevance are incorporated into the knowledge question answering training model to obtain the answer to the question.
2. A knowledge representation learning method based on graph attention network according to claim 1, characterized in that: The topic tag with the highest similarity in S2 is selected by defining a related topic tag set La={La i }, entity name set h = {h i }, the target topic tag is z={z i }, select the semantic similarity between the target topic and the entity name in the relevant topic tags La i ∩z represents the node La of the related topic tag set i The common set with the target topic set, p(i|z) represents the label La i The probability of i corresponding to z, add label node La i With z i The street weight w(La i , z i ) Calculate the semantic consistency S between the label and the entity, that is, S = Sin(z|La i , h i )+w(La i , z i ), select the topic tags with high consistency scores with entity semantics as the analysis objects that conform to entity semantics in social networks.
3. A knowledge representation learning method based on graph attention network according to claim 1, characterized in that: The text features and image features of the topic tags are fused in S2 to extract the feature vector of the topic tags. The correlation between the text features and the image features is analyzed under the guidance of the time distribution t of the topic tags. The text features Vt and the image features Vp are input to the attention layer, and the fusion feature vector of the topic tags is obtained by using the softmax function. Xi={Vti,Vpi}∈R, represents the attention distribution guided by the time distribution t, σ represents the weight parameter of the text feature Vt and the image feature Vp in the attention layer, Wp represents the weight of the text feature Vt and the image feature Vp in the attention layer, and bp represents the offset value of the text feature Vt and the image feature Vp in the attention layer.
4. A knowledge representation learning method based on graph attention network according to claim 1, characterized in that: The semantic segmentation result Y1 in S3 is generated by combining the fusion feature vector X of the topic label i Input to a fully connected layer, where the softmax activation function is used to perform semantic classification prediction on the nodes of each feature vector, that is, the classification prediction probability Represents the eigenvector matrix X i The transposed matrix, W f Represents the parameter matrix of the classification training model, f is the number of categories contained in the training data set, and the semantic segmentation result Y1 is output according to the classification prediction probability, corresponding to the classification loss function p ij represents the distribution probability of node i in the jth dimension, f i Represents the true classification label of node i.
5. The knowledge representation learning method based on graph attention network according to claim 1 is characterized in that In S4, the entity semantics of the triple is analyzed for local features, which uses the softmax activation function to evaluate the local feature attention value H of the triple, and the input triple feature relationship e i Represents the head entity in the triple, e j Represents the tail entity in the triple, r k Represents the head entity e in the triple i With the tail entity e j The relationship between The adjacency matrix represents the triple vector relationship matrix, and the LaekyReLU activation function is introduced to perform linear correction on the connection relationship of the triples. represents the l-th layer linear transformation matrix in the attention layer, represents the l-th layer linear weight matrix in the attention layer, Indicates e i 、r k 、e j In the output embedding of the L-1th layer of the attention layer, ‖ represents the concatenation between features.
6. A knowledge representation learning method based on graph attention network according to claim 1, characterized in that In S4, a global feature attention network is introduced into the local attention mechanism. Based on the global random walk algorithm, the tail entity e is introduced in the first layer of the attention layer. j The output embedding value of Select to incorporate local feature H into global entity aggregation, then σ represents the Sigmoid activation function, Represents the head entity e in the global walk algorithm i The global entity importance of H represents the local feature attention value of the triple. Used to calculate triple feature relationships The linear transformation matrix of the entity is introduced, and a projection matrix W' is introduced to retain the initial information of the entity to obtain the final entity embedding represents the initial embedding entity vector, Represents the embedded entity vector at the lth layer of the attention layer, selecting the final entity embedding The corresponding semantics is taken as the semantic result Y2 obtained by analyzing the triple content.
7. A knowledge representation learning method based on graph attention network according to claim 1, characterized in that: The S5 is a feedback loop path, which uses the entity semantic segmentation result Y1 as the updated head entity of the triple, re-analyzes the entity semantics of the triple with the updated head entity, and outputs the corresponding updated entity embedding tail entity by fusing local features and global background. The final feedback entity embedding vector is obtained by combining the head entity and the tail entity, and the semantics corresponding to the final feedback entity vector is used as the semantic result information Y3 output by the feedback network.
8. The knowledge representation learning method based on graph attention network according to claim 1 is characterized in that The comparative analysis of the relevance between the semantic result and the question itself in S6 is to determine the semantic relevance between the semantic result and the question itself by calculating the semantic distance between the semantic result and the question itself. The smaller the semantic distance, the greater the semantic relevance. Where Y = {Y2, Y3}, α represents the adjustment parameter, and the semantic distance between the semantic result information Y2 and the semantic result information Y3 and the question itself P is calculated by introducing the adjustment parameter. D0(Y, P) represents the link distance between the semantic result Y and the question itself P. L (Y, P) represents the category distance between the semantic result Y and the question itself P, and the corresponding contrast loss function ∑ (h,r,t)∈R ∑ (h′,r,t′)∈R′ max(0, f(h, r, t)+γ-f(h′, r, t′)) is used to calculate the model training loss function for triple semantic analysis. Used to calculate the comparison loss function of the relevance between the output semantics and the question.
Citation Information
Patent Citations
Relation selection method based on BERT twinborn attention network and fusion image embedding features
CN114238645A
Method of generating questions by combining triple and entity type in knowledge base
WO2022041294A1