Method and device for mining target entities based on attention mechanism
By using the graph attention neural network and weighted web page ranking algorithm based on the attention mechanism in the knowledge graph, the problem of difficulty in mining important nodes in the existing technology is solved, and the accurate identification and importance assessment of important entities in the relationship are achieved. .
Patent Information
- Application Number
- CN202210261366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-16
AI Technical Summary
It is difficult to effectively mine important nodes in association relationships with existing technology. Especially in knowledge graphs, there is a lack of methods to utilize the attribute characteristics and relationship weights of nodes themselves, making it difficult to accurately determine the importance of target entities.
An attention mechanism-based method is used to determine the attention weight of the association between entities through a graph attention neural network, and combined with a weighted web page ranking algorithm, the score of the entity is calculated to determine the target entity.
It realizes the rapid and accurate determination of important nodes in the association relationship in the knowledge graph, improves the accuracy and interpretability of mining target entities, and can comprehensively consider the topology structure and node attributes.
Smart Images

Figure CN114626379B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of knowledge graphs, and in particular to a method and device for mining target entities based on an attention mechanism, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Relationships are everywhere in life, such as between people, between people and organizations, and between organizations. Many of the data people face in life are graph structures, such as electricity, transportation, social networks, and knowledge graphs. In these relationships, there are often weak nodes, which have a significant impact on the maintenance of the entire relationship. Weak nodes refer to nodes that have a greater influence on the relationship topology and functional value than other nodes in the graph network. For example, the paralysis of key weak nodes in the power network will cause large-scale power outages, and weak nodes in the virus transmission network will cause large-scale virus spread. Similarly, based on the professional field knowledge graph, we can understand the knowledge information of each entity itself and explicitly grasp the relationship between entities. However, for the entire field graph, determining the weak points in all nodes is very important for maintaining the structure and function of the entire knowledge system.
[0003] Most current methods only examine the topological structure of the association relationship itself. For example, the famous PageRank algorithm believes that if a node is pointed to by many important nodes, then the importance of the node is also high. Graph Convolution Network (GCN) extracts new high-dimensional implicit features based on the topological structure of the association relationship and the characteristics of the nodes to classify nodes or predict relationships. However, GCN is based on the spectral decomposition of the Laplacian matrix defined in an undirected graph, while common knowledge graphs all have directed edges.
[0004] In the prior art, the relationship weights adopted by weighted web page ranking algorithms rely on statistical rules or expert experience, and it is not possible to obtain reliable relationship weights. In addition, the relationship between nodes is sometimes not so reliable, and the relative importance of adjacent nodes may also vary. The method of obtaining the relationship weights between nodes in the prior art does not utilize the rich attribute characteristics of the nodes themselves, and the importance of the target node cannot be directly reflected in the topological structure. The model trained for a specific structure cannot be directly applied to graphs with different structures. Therefore, the prior art lacks an effective method for mining important nodes in the association relationship. Summary of the invention
[0005] In view of the above problems, the present disclosure provides a method and device for mining target entities based on an attention mechanism, an electronic device, a computer-readable storage medium, and a computer program product, which are used to quickly and accurately determine important nodes in an association relationship.
[0006] According to the first aspect of the present disclosure, a method for mining target entities based on an attention mechanism is provided, including: determining attribute feature vectors of multiple entities based on network data and professional data; determining association relationships between multiple entities based on the attribute feature vectors and definition data of multiple entities; determining attention weights of association relationships between multiple entities using a relationship weight learning model, the relationship weight learning model including a graph attention neural network; and determining a target entity among multiple entities using a weighted web page ranking algorithm based on the attention weights of the association relationships between multiple entities, the target entity being an entity that reflects the most structural and functional information about the association relationships among the multiple entities.
[0007] According to an embodiment of the present disclosure, the use of a relationship weight learning model to determine the attention weight of an association relationship between multiple entities includes: determining an adjacency matrix of the association relationship between multiple entities based on the association relationship, the adjacency matrix includes a matrix obtained according to the association relationship between a first entity and a second entity, the first entity is an entity currently processed by the relationship weight learning model, and the second entity includes all entities connected to the first entity; determining initial entity features based on the adjacency matrix of the first entity, the attribute feature vector of the first entity, and the attribute feature vector of the second entity; performing a linear transformation on the initial entity features to obtain a first linear transformation vector and a second linear transformation vector, the first linear transformation vector includes a linear transformation vector of the first entity, and the second linear transformation includes a linear transformation vector of the second entity; determining the attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector; and determining the attention weight of the association relationship between multiple entities based on the attention weight of the association relationship between the first entity and the second entity.
[0008] According to an embodiment of the present disclosure, determining the attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector includes: determining the initial attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector; determining the attention coefficient based on the initial attention weight; determining entity features of feature aggregation based on the attention coefficient and the second linear change vector; and determining the attention weight of the association relationship between the first entity and the second entity based on the entity features of feature aggregation, the first linear transformation vector and the second linear transformation vector.
[0009] According to an embodiment of the present disclosure, determining the initial attention weight of the association relationship between the first entity and the second entity includes: concatenating the preset linear variables in the first linear transformation vector and the second linear transformation vector to obtain a high-dimensional feature vector; and determining the initial attention weight based on the high-dimensional feature vector and the attention parameter.
[0010] According to an embodiment of the present disclosure, determining a target entity among multiple entities using a weighted web page ranking algorithm based on attention weights of association relationships among multiple entities includes: performing a vector transformation on the attention weights according to a preset order of association relationships among multiple entities to obtain an in-link matrix and an out-link matrix; calculating entity scores of multiple entities using a weighted web page ranking algorithm based on the in-link matrix and the out-link matrix to obtain multiple entities in a preset order; and determining a target entity among multiple entities based on the multiple entities in the preset order.
[0011] According to an embodiment of the present disclosure, wherein the definition data of an entity includes the concept, category, and association of the entity, determining the association relationship between multiple entities based on an attribute feature vector and the definition data of multiple entities includes: determining the semantic levels of the multiple entities based on the attribute feature vector and the concepts of the multiple entities; determining the association relationship in a preset form based on the semantic level and the categories of the multiple entities; and determining the association relationship between the multiple entities based on the association relationship in the preset form.
[0012] According to a second aspect of the present disclosure, a device for mining target entities based on an attention mechanism is provided, comprising: a first determination module, for determining attribute feature vectors of multiple entities based on network data and professional data; a second determination module, for determining association relationships between multiple entities based on the attribute feature vectors and definition data of the multiple entities; a third determination module, for determining attention weights of association relationships between multiple entities using a relationship weight learning model; and a mining module, for determining target entities among multiple entities using a weighted web page ranking algorithm based on the attention weights of association relationships between multiple entities, wherein the target entity is an entity that has the most structural and functional information reflecting the association relationship among the multiple entities.
[0013] According to a third aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned method of mining target entities based on the attention mechanism.
[0014] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored, and when the instructions are executed by a processor, the processor executes the above-mentioned method of mining target entities based on the attention mechanism.
[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the above-mentioned method of mining target entities based on the attention mechanism when the computer program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The system architecture of the method for mining target entities based on the attention mechanism according to an embodiment of the present disclosure is schematically shown;
[0017] Figure 2 A flowchart of a method for mining target entities based on an attention mechanism according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 3 A flowchart schematically illustrates a method for determining attention weights of association relationships between multiple entities according to an embodiment of the present disclosure;
[0019] Figure 4 A flowchart schematically illustrates a method for determining an attention weight of an association relationship between a first entity and a second entity according to an embodiment of the present disclosure;
[0020] Figure 5 A flowchart of a method for determining an initial attention weight according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 6 A flowchart of a method for determining a target entity according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 7 A flowchart schematically illustrates a method for determining association relationships between multiple entities according to an embodiment of the present disclosure;
[0023] Figure 8 A schematic diagram schematically illustrates an association relationship between multiple entities according to an embodiment of the present disclosure;
[0024] Fig. 9 A schematic diagram of determining a target entity according to an embodiment of the present disclosure is schematically shown;
[0025] Fig.10 A structural block diagram of a device for mining target entities based on an attention mechanism according to an embodiment of the present disclosure is schematically shown; and
[0026] Fig.11 A block diagram of an electronic device suitable for a method for mining target entities based on an attention mechanism according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] An embodiment of the present disclosure provides a method for mining target entities based on an attention mechanism, including: determining attribute feature vectors of multiple entities based on network data and professional data; determining association relationships between multiple entities based on the attribute feature vectors and definition data of multiple entities; determining attention weights of association relationships between multiple entities using a relationship weight learning model, the relationship weight learning model including a graph attention neural network; and determining target entities among multiple entities using a weighted web page ranking algorithm based on the attention weights of association relationships between multiple entities.
[0032] People introduced the attention mechanism into the graph convolutional neural network GCN and proposed the Graph Attention Network (GAT). GAT can fuse the features of the entity node itself, aggregate the features of adjacent nodes through the attention mechanism, and is not restricted by the entire graph structure, and has achieved good results in node classification and relationship prediction. Therefore, this application adopts GAT, and gets rid of the dependence on the Laplace matrix in GCN by calculating the attention coefficients of the current node and the adjacent nodes in the directed graph point by point. In addition, when aggregating the features of adjacent nodes, GAT uses the attention mechanism for weighted summation, so that the graph neural network can pay more attention to important nodes to reduce the impact of edge noise and ensure that more important relationships in multiple entities can obtain greater weights.
[0033] Considering that the weights used in the weighted web page ranking algorithm (PageRank algorithm) in the prior art are set according to expert experience or certain statistical rules, they are very dependent on subjective settings and there are no accurate weight setting rules. The obtained entity score (PageRank value) is correspondingly affected by the subjective rules set by the designer. This application combines the attention weights obtained by GAT into the weighted PageRank algorithm, and integrates the attention weights of each node feature through GAT, ensuring that the adopted weighted PageRank algorithm does not rely on the set weight rules, thereby improving the accuracy of mining the target entity.
[0034] Figure 1 The system architecture of the method for mining target entities based on the attention mechanism according to an embodiment of the present disclosure is schematically shown.
[0035] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0036] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 can be installed with various client applications for building association relationships.
[0037] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0038] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0039] It should be noted that the method for mining target entities based on the attention mechanism provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the device for mining target entities based on the attention mechanism provided in the embodiment of the present disclosure can generally be set in the server 105. The method for mining target entities based on the attention mechanism provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the device for mining target entities based on the attention mechanism provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0041] The following will be based on Figure 1 The system architecture described by Figure 2 to Figure 9 The application review method of the disclosed embodiment is described in detail.
[0042] Figure 2 A flowchart of a method for mining target entities based on an attention mechanism according to an embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the method includes operations S201 to S204.
[0044] In operation S201 , attribute feature vectors of a plurality of entities are determined based on network data and professional data.
[0045] According to the embodiments of the present disclosure, before mining the association relationship, data preparation is required to convert the association relationship into a suitable form of expression. Taking the knowledge graph as an example, for the professional field knowledge graph to be mined, it is necessary to obtain the specific meaning of the entity through network data and professional knowledge data, for example, obtain network data through Baidu search, Sogou search, and Wiki search, and determine professional data through books and professional field websites. After obtaining the professional data about the entity, for different entity types, the above network data and professional data are encoded into an F-dimensional feature vector, which is the attribute feature vector of the entity, where F is an integer greater than or equal to 2.
[0046] In operation S202, based on the attribute feature vector and the definition data of the multiple entities, the association relationship between the multiple entities is determined.
[0047] According to the embodiments of the present disclosure, in the association relationship, the definition of each entity is determined by its own attribute characteristics. For example, a person and a company have different attribute characteristics, and their definition data are also different. Based on the attribute feature vectors of multiple entities and their own definition data, the association relationship between multiple entities can be determined. For example, the association relationships obtained by knowledge graphs in different fields and structures are different.
[0048] In operation S203, the attention weights of the association relationships between the multiple entities are determined using a relationship weight learning model.
[0049] According to an embodiment of the present disclosure, the relationship weight learning model can learn the association relationship between multiple entities and analyze the importance of multiple association relationships. Although there are differences in association relationships in different fields, by using a pre-trained relationship weight learning model, different types of association relationships can be learned, and then the attention weights of the association relationships between multiple entities can be learned. Specifically, the relationship weight learning model includes a graph attention network (GraphAttention Network, GAT.
[0050] In operation S204, a target entity among the multiple entities is determined using a weighted web page ranking algorithm according to the attention weights of the association relationships between the multiple entities.
[0051] According to the embodiments of the present disclosure, the association relationship between entities can reflect the relationship between the two entities, but because each entity is also connected to other entities, the entire association network is formed layer by layer. Each entity can represent the structure and function information of all associations, but the amount of information represented by each entity is different. There are some important entities in the entire association relationship. Compared with other entities, these entities can represent more structure and function information of all associations, and affect the structure and function of the association network to a greater extent. These entities are the target entities we need to mine.
[0052] The attention weights of the relationships between multiple entities can reflect the importance of multiple relationships. After obtaining the attention weights of the relationships between multiple entities, the weighted web page ranking algorithm provided by Neo4j, namely the PageRank algorithm, can be used to calculate the scores of multiple entities based on the above attention weights, and then determine the target entity from multiple entities.
[0053] According to the embodiments of the present disclosure, the PageRank algorithm is an iterative algorithm, which initially assigns the same PageRank value to all nodes, and then iterates, distributing the node's own PageRank value to all nodes pointed to by the node on average in each step, and updating the PageRank value of each node to the sum of all PageRank values it obtains, and the algorithm ends after the PageRank value of each node reaches stability. The present application adopts a weighted PageRank algorithm, assigning different weights to each node, which is the attention weight obtained by using the above S204. By applying the attention weights of the association relationship between multiple entities in the weighted PageRank algorithm, on the basis of ensuring the acquisition of comprehensive information of multiple entities, the accuracy and reliability of the mining target entity are further guaranteed, and the interpretability of the entire mining method is improved.
[0054] This application uses a relationship weight learning model to learn the relationship weights that integrate the attribute features of the entities. Since the graph convolution of the attention mechanism is only performed on the entity node itself and the entity nodes that are adjacent to it and have an association relationship, that is, the adjacent entity nodes; the attention weights learned by the relationship weight learning model do not depend on the entire topological structure, but are only determined by the attribute features of the current entity node and the adjacent nodes, ensuring that the attribute information of all entity nodes is comprehensively considered, and more effectively mining the weak areas in the association relationship. Based on the weighted PageRank algorithm, the calculation of multiple entity nodes is completed, and the target entity that is very important to the entire association relationship structure is determined from multiple entities. The relationship weights learned by the topological structure and the graph attention network are comprehensively considered, and the association relationship to be examined is scored and ranked, which can accurately and quickly determine important target entities, while also increasing the interpretability of the entire determination method.
[0055] Figure 3 The flowchart of the method for determining the attention weight of the association relationship between multiple entities according to an embodiment of the present disclosure is schematically shown.
[0056] like Figure 3 As shown, the method includes operations S301 to S305.
[0057] In operation S301 , an adjacency matrix of association relationships between multiple entities is determined based on the association relationships.
[0058] According to an embodiment of the present disclosure, the adjacency matrix includes a matrix obtained according to the association relationship between the first entity and the second entity, the first entity is the entity currently processed by the relationship weight learning model, and the second entity includes all entities connected to the first entity. Specifically, the existence of an association relationship between the first entity and the second entity is represented as 1 in the adjacency matrix, and the absence of an association relationship is represented as 0. It should be noted that when multiple entities are associated with each other, each entity will have an impact on the first entity, even if an entity in the second entity has an indirect association relationship with the first entity, the entity will also have an impact on the first entity.
[0059] For example, take the association relationship formed by four entities A, B, C, and D as an example, where entity A is connected to entities B and C, entity A points to entity B, entity C points to entity A, entity D points to entity B, and there is no relationship between entity B and entity C. The adjacency matrix of this association relationship is [[0,1,0,0],[0,0,0,0],[1,0,0,0]],[0,1,0,0]], where [0,1,0,0] reflects the relationship between entity A and other entities, and 1 indicates that entity A points to entity B; [0,0,0,0] reflects the relationship between entity B and other entities, and entity B does not point to any entity; [1,0,0,0]] reflects the relationship between entity C and other entities, and 1 indicates that entity C points to entity A; [0,1,0,0] reflects the relationship between entity D and other entities, and 1 indicates that entity D points to entity B.
[0060] In operation S302, initial entity features are determined based on the adjacency matrix, the attribute feature vector of the first entity, and the attribute feature vector of the second entity.
[0061] According to the embodiment of the present disclosure, the adjacency matrix of the association relationship can characterize the association relationship between the first entity and the second entity. Each entity itself includes an F-dimensional attribute feature vector. The initial entity feature composed of all entities is H<N,F> , where N is the number of entity nodes, F is the attribute feature dimension of each entity node, and the initial entity feature can characterize the attribute feature vector and adjacency relationship of the entity. The initial entity feature is the input of the relationship weight learning model.
[0062] According to an embodiment of the present disclosure, the initial entity features of all entities in the association relationship are expressed as N represents the number of entity nodes, and the initial entity features processed by the current relationship weight learning model The input of the model is j m represents the mth adjacent entity connected to the i-th entity, Represents the initial entity features of the mth adjacent entity connected to the ith entity.
[0063] In operation S303, a linear transformation is performed on the initial entity feature to obtain a first linear transformation vector and a second linear transformation vector.
[0064] According to the embodiments of the present disclosure, by performing a linear transformation on the initial entity features of each input entity and mapping the feature dimension of each entity from F to F′, a high-dimensional feature can be obtained from the initial entity features, thereby enhancing the ability of the relationship weight learning model to express entity attribute features. Specifically, by using a self-learning shared weight matrix Perform a dot product operation with the entity feature vector of each entity to achieve linear change, and obtain the first linear change vector including the first entity and a second linear change vector including a plurality of second entities in,
[0065] According to the embodiments of the present disclosure, no specific initial setting value may be specified for the shared weight matrix. In the process of training the relationship weight learning model, the shared weight matrix may also change while adjusting other training parameters. For example, there are three second entities adjacent to the first entity. After the model training is completed, the shared weight matrix W learned by the model itself is [[-0.93, -0.63, ..., 0.12], ..., [0.65, -1.38, ..., -0.44]], and Wh i , The value of Wh i is [-0.93,-0.63,…,0.12], is [0.65,-1.38,…,-0.44].
[0066] In operation S304, an attention weight of an association relationship between the first entity and the second entity is determined based on the first linear transformation vector and the second linear transformation vector.
[0067] According to an embodiment of the present disclosure, an attention mechanism is introduced into the relationship weight learning model. By using the first linear transformation vector and the second linear transformation vector, the relationship weight learning model can learn the attention weight of the association relationship between two entities.
[0068] In operation S305 , attention weights of association relationships between a plurality of entities are determined based on the attention weights of the association relationships between the first entity and the second entity.
[0069] According to an embodiment of the present disclosure, after determining the attention weight of the association relationship between a first entity and a second entity adjacent to the first entity, the relationship weight learning model continues to analyze the next first entity until the attention weights of all association relationships between the entities are determined. The output of the attention layer of the model is All output entity features are represented as The number of output entities N remains unchanged, and the number of features of each entity becomes F′. Then softmax is used to calculate the output entity The category vector of .
[0070] Figure 4 A flowchart of a method for determining an attention weight of an association relationship between a first entity and a second entity according to an embodiment of the present disclosure is schematically shown.
[0071] like Figure 4 As shown, the method includes operations S401 to S404.
[0072] In operation S401 , an initial attention weight of an association relationship between a first entity and a second entity is determined based on a first linear transformation vector and a second linear transformation vector.
[0073] According to an embodiment of the present disclosure, the initial entity features are converted into high-dimensional features through linear transformation, and then the initial attention weight e of the association relationship between the first entity and the second entity can be obtained according to the high-dimensional features. ij , the initial attention weight can express the characteristics between the first entity i and the second entity j.
[0074] In operation S402, based on the initial attention weight, an attention coefficient is determined.
[0075] According to an embodiment of the present disclosure, when determining the initial attention weight e ij Afterwards, the original attention weight e is adjusted by softmax ij Normalize and get the attention coefficient α ij , so as to subsequently aggregate the features of multiple second entities adjacent to the first entity. Get the attention coefficient α ij The process meets:
[0076]
[0077] Among them, e ij represents the initial attention weight of entity j to entity i, represents all the second entities adjacent to entity i, e ik represents the attention weight of the kth second entity among the neighboring entity j on entity i.
[0078] In operation S403, entity features of feature aggregation are determined according to the attention coefficient and the second linear change vector.
[0079] According to an embodiment of the present disclosure, the attention coefficient α ij With the second linear change vector Perform weighted summation to aggregate entity features of the second entity adjacent to the first entity to obtain entity features for feature aggregation. The process of feature aggregation satisfies:
[0080]
[0081] According to an embodiment of the present disclosure, in the process of feature aggregation, the first entity performs feature aggregation with itself.
[0082] In operation S404, an attention weight of an association relationship between the first entity and the second entity is determined based on the entity features of the feature aggregation, the first linear transformation vector, and the second linear transformation vector.
[0083] According to the embodiment of the present disclosure, since the attention layer of the relationship weight learning model can have multiple layers, the entity features of the above-mentioned characteristic aggregation are aggregated. It can be used as the input of the next attention layer. The next attention layer updates the output entity features again according to the entity features of the feature aggregation, the first linear transformation vector and the second linear transformation vector, until the last attention layer outputs the final entity features, and the attention weight of the association relationship between the first entity and the second entity is obtained through the last attention layer. It should be noted that the weighted PageRank algorithm used in this application adopts the attention weights in the model, and the input and output of the model are only used as training data for training and optimizing the model.
[0084] According to an embodiment of the present disclosure, for example, the relationship weight learning model adopts two attention layers, and the entity features of each entity output by the first attention layer are used as the input of the second attention layer. After the last attention layer outputs the updated entity features, the category vector of each entity is calculated using softmax, and the attention weight e of the last attention layer is output. ij During the model training process, the model training parameters are adjusted through the graph labels to obtain a trained relationship weight learning model.
[0085] Figure 5 The flowchart of the method for determining the initial attention weight according to an embodiment of the present disclosure is schematically shown.
[0086] like Figure 5 As shown, the method includes operations S501-S502.
[0087] In operation S501, the first linear transformation vector and the preset linear variables in the second linear transformation vector are concatenated to obtain a high-dimensional feature vector.
[0088] According to an embodiment of the present disclosure, the first linear transformation vector and the second linear transformation vector are horizontally spliced to obtain a high-dimensional feature vector with a length of 2F Then, the activation function is used to obtain the attention weight of entity j to entity i, that is, the attention weight of the association relationship between the first entity and the second entity. It should be noted that concatenating the preset linear variables refers to: concatenating the first linear transformation vector and all the second linear transformation vectors horizontally. For example, when there are M second linear transformation vectors, M 2F high-dimensional feature vectors are obtained. M is an integer greater than or equal to 1.
[0089] In operation S502, an initial attention weight is determined based on the high-dimensional feature vector and the attention parameter.
[0090] According to an embodiment of the present disclosure, the first linear transformation vector and the second linear transformation vector are horizontally spliced to obtain a high-dimensional feature vector with a length of 2F. Afterwards, the learnable attention parameter vector Do a dot product operation with the high-dimensional feature vector of 2F above, and then use LeakyReLU as the activation function to calculate the nonlinear expression, map the high-dimensional feature vector to a real number, and get the original attention weight e of entity j to i. ij Specifically, the process of obtaining the original attention weight satisfies the formula:
[0091]
[0092] Figure 6 The flowchart of the method for determining a target entity according to an embodiment of the present disclosure is schematically shown.
[0093] like Figure 6 As shown, the method includes operations S601-S602.
[0094] In operation S601, according to a preset order of association relationships between multiple entities, a vector transformation is performed on the attention weights to obtain an in-link matrix and an out-link matrix.
[0095] According to the embodiments of the present disclosure, when converting the association relationship between multiple entities into a matrix representation, there are multiple conversion directions. After obtaining the attention weights of the association relationship between multiple entities, the attention weights are converted into an in-link matrix W according to the preset order of entering multiple entities. in ; According to the preset order of outputting multiple entities, the attention weights are converted into the out-link matrix W out .
[0096] In operation S602, entity scores of a plurality of entities are calculated using a weighted web page ranking algorithm according to an in-link matrix and an out-link matrix to obtain the plurality of entities in a preset order.
[0097] According to the embodiment of the present disclosure, based on the attention weighted in-link matrix and out-link matrix, the entity score is calculated using a weighted web page ranking algorithm, that is, the PageRank value of each entity is calculated using weighted PageRank, and then the PageRank value is calculated repeatedly and iteratively until the PageRank value converges to obtain the final PageRank value, so as to sort all entities. The process of calculating using weighted PageRank satisfies:
[0098]
[0099] Among them, PR(i) is the PageRank value of entity i, d is the decay factor, which indicates the jump probability between entities. is the set of adjacent entities connected to entity i, and PR(j) is the PageRank value of entity j.
[0100] In operation S603, a target entity among the multiple entities is determined according to the multiple entities in a preset order.
[0101] According to an embodiment of the present disclosure, after the PageRank values of all entities are obtained, all entities are arranged in a preset order. The entity with a larger PageRank value is the more important entity in the association relationship, which is the target entity for mining.
[0102] Figure 7 The flowchart of the method for determining the association relationship between multiple entities according to an embodiment of the present disclosure is schematically shown.
[0103] like Figure 7 As shown, the method includes operations S701 to S703.
[0104] In operation S701 , semantic levels of a plurality of entities are determined based on an attribute feature vector and concepts of the plurality of entities.
[0105] According to the embodiments of the present disclosure, the semantics of multiple entities will show obvious hierarchical distinction, and the semantic distinction of different levels is large. The semantic levels of the above multiple entities are determined according to the concepts of the multiple entities and the attribute features reflected by their attribute feature vectors, while ensuring that the semantic differences between brother concepts of the same level are as small as possible.
[0106] In operation S702, a preset association relationship is determined according to the semantic level and the categories of the plurality of entities.
[0107] According to an embodiment of the present disclosure, considering the standardization, consistency and extensibility of the current professional field, a preset form of association relationship is determined according to the semantic levels and categories of multiple entities.
[0108] Figure 8 The diagram schematically shows the association relationship between multiple entities according to an embodiment of the present disclosure.
[0109] like Figure 8As shown, taking the relationship between people and organizations as an example, the relationship is determined as a schema-based relationship. The entities include person entities Tom, Alex, and Bob, organization entities include org1 and org2, and other entities include c1, c2, c3, c4, c5, p1, p2, oth1, and oth2.
[0110] In operation S703, an association relationship between multiple entities is determined according to an association relationship in a preset form.
[0111] According to an embodiment of the present disclosure, after determining the preset forms in which multiple entities can exist, directed edges are added to different types of entities according to the relationships between the entities to determine the association relationships between the multiple entities. Each directed edge expresses that the starting entity has a certain relationship with the ending entity, and some entities contain multiple relationships, which together constitute a complex association relationship network. Specifically, the attribute characteristics and association relationships of the entities can be stored using the Neo4j graph database.
[0112] Fig. 9 A schematic diagram of determining a target entity according to an embodiment of the present disclosure is schematically shown.
[0113] According to the embodiment of the present disclosure, taking the character interest map as an example, the knowledge map includes 7 types of entities such as characters, regions, and companies. Each entity includes a 200-dimensional feature vector, and there are 758 entities in total. The feature vector of a character Tom is [0, 1, 0, ..., 1, 0, 1], and the feature vector of a company c1 is [0, 0, 0, ..., 0, 1, 0]. The entity initialization layer contains two parts of information. One is the adjacency matrix A[[1,0,…,1],…[0,0…,1]] constructed based on the association relationship. In the adjacency matrix, [1,0,…,1] represents the association relationship between the first position point and other entities, and [0,0…,1] represents the association relationship between the Nth position point and other entities. The other part is the attribute feature of the node itself H[[0,1,0,…,1,0,1],…[0,0,0,…,0,1,1]], [0,1,0,…,1,0,1] represents the attribute feature of the entity corresponding to the first position point, and [0,0,0,…,0,1,1] represents the attribute feature of the entity corresponding to the Nth position point. The attribute feature is 200-dimensional, and H is a 758*200 matrix. The input of the attention layer is: the entity feature h of the entity Tom i [0,1,0,…,1,0,1] and its adjacent entity c1 entity features Entity features of c2 C3 entity features
[0114] After performing a linear transformation on each entity using the shared weight matrix to obtain a high-dimensional feature vector, the attention weight is calculated. For example, taking the calculation of the attention weight of entity Tom and entity c1 as an example, Wh i and Perform horizontal splicing, do a dot product operation with the learned attention parameter vector a[1.88,-0.36,…,2.15], and then use LeakyReLU activation to obtain the initial attention weight of entity c1 to entity Tom The value is 0.33. Similarly, the initial attention weight of entity c2 to entity Tom can be calculated: The value is 2.52, the initial attention weight of entity c3 to entity Tom The value of is 3.18.
[0115] Use softmax to adjust the initial attention weight e ij Normalize to get the attention coefficient α ij , and then with Perform weighted summation to obtain the features after aggregation of c1, c2, and c3 When two attention layers are used for feature aggregation, softmax is used again to calculate the category vector of each entity [[0.13, 0.62, …, 0.02], …, [0.85, 0.08, …, 0.04]], and the attention weight e of the last attention layer is output. ij [[0.00,0.52,…,0.00],…,[2.42,0.08,…,3.19]].
[0116] Using the weighted PageRank calculation interface provided by Neo4j, e ij Update to the relationship between entity i and entity j, the decay factor d is set to 0.85, and the PageRank value converges after 20 iterations, and the ranking of all entities in the association relationship is obtained.<c3,Bob,c2,…oth1> , the order is from large to small. Therefore, the target entity in this association relationship is c3.
[0117] According to an embodiment of the present disclosure, the relationship weight learning model adopts the existing GCN training method to ensure that the relationship weight learning model can effectively classify nodes. The forward propagation formula is as follows:
[0118] Y=f(H;A)=softmax(h′) (5)
[0119] After the last attention layer outputs the entity features, softmax is used to output the category vector, and the cross entropy loss is calculated for each entity according to the true label. The loss is back-propagated to continuously reduce the loss and correct the network parameters of the attention layer. The model training is completed after the loss stabilizes.
[0120] This application uses a relationship weight learning model to implement a method for mining target entities based on an attention mechanism when an attention mechanism is introduced, solving the problem that it is difficult to comprehensively consider the multi-dimensional attributes of nodes in the association relationship and it is difficult to accurately set the relationship weight to mine important entity nodes. The topological structure and the relationship weights learned by the graph attention network are comprehensively considered, and the association relationships to be examined are scored and sorted, and important target entity nodes are accurately and quickly determined, while also increasing the interpretability of the entire determination method.
[0121] Fig.10 The structural block diagram of the device for mining target entities based on the attention mechanism according to an embodiment of the present disclosure is schematically shown.
[0122] like Fig.10 As shown, the device 1000 for mining target entities based on the attention mechanism of this embodiment includes a first determination module 1001, a second determination module 1002, a third determination module 1003, and a mining module 1004.
[0123] The first determination module 1001 is used to determine the attribute feature vectors of multiple entities based on the network data and the professional data. In one embodiment, the first determination module 1001 can be used to perform the operation S201 described above, which will not be described in detail here.
[0124] The second determination module 1002 is used to determine the association relationship between multiple entities based on the attribute feature vector and the definition data of multiple entities. In one embodiment, the second determination module 1002 can be used to perform the operation S202 described above, which will not be repeated here.
[0125] The third determination module 1003 is used to determine the attention weights of the association relationships between multiple entities using the relationship weight learning model. In one embodiment, the third determination module 1003 can be used to perform the operation S203 described above, which will not be repeated here.
[0126] The mining module 1004 is used to determine the target entity among the multiple entities using the PageRank algorithm according to the attention weights of the associations among the multiple entities, wherein the target entity is the entity that reflects the most structural and functional information of all the associations among the multiple entities. In one embodiment, the mining module 1004 can be used to perform the operation S204 described above, which will not be described in detail here.
[0127] According to an embodiment of the present disclosure, the third determination module 1003 includes a first determination submodule, a second determination submodule, a third determination submodule, a fourth determination submodule and a fifth determination submodule.
[0128] The first determination submodule is used to determine the adjacency matrix of the association relationship between the multiple entities based on the association relationship, the adjacency matrix includes a matrix obtained according to the association relationship between the first entity and the second entity, the first entity is the entity currently processed by the relationship weight learning model, and the second entity includes all entities connected to the first entity. In one embodiment, the first determination submodule can be used to perform the operation S301 described above, which will not be repeated here.
[0129] The second determination submodule is used to determine the initial entity features based on the adjacency matrix, the attribute feature vectors of the first entity and the second entity. In one embodiment, the second determination submodule can be used to perform the operation S302 described above, which will not be described in detail here.
[0130] The third determination submodule is used to perform a linear transformation on the initial entity feature to obtain a first linear transformation vector and a second linear transformation vector, wherein the first linear transformation vector includes a linear transformation vector of the first entity, and the second linear transformation includes a linear transformation vector of the second entity. In one embodiment, the third determination submodule can be used to perform the operation S303 described above, which will not be described in detail herein.
[0131] The fourth determination submodule is used to determine the attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector. In one embodiment, the fourth determination submodule can be used to perform the operation S304 described above, which will not be repeated here.
[0132] The fifth determination submodule is used to determine the attention weight of the association relationship between the multiple entities based on the attention weight of the association relationship between the first entity and the second entity. In one embodiment, the fifth determination submodule can be used to perform the operation S305 described above, which will not be repeated here.
[0133] According to an embodiment of the present disclosure, the fourth determining submodule includes a first determining unit, a second determining unit, a third determining unit, and a fourth determining unit.
[0134] The first determining unit is used to determine the initial attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector. In one embodiment, the first determining unit can be used to perform the operation S401 described above, which will not be repeated here.
[0135] The second determination unit is used to determine the attention coefficient based on the initial attention weight. In one embodiment, the second determination unit can be used to perform the operation S402 described above, which will not be repeated here.
[0136] The third determination unit is used to determine the entity feature of feature aggregation according to the attention coefficient and the second linear change vector. In one embodiment, the third determination unit can be used to perform the operation S403 described above, which will not be repeated here.
[0137] The fourth determination unit is used to determine the attention weight of the association relationship between the first entity and the second entity based on the entity features of the feature aggregation, the first linear transformation vector and the second linear transformation vector. In one embodiment, the fourth determination unit can be used to perform the operation S404 described above, which will not be repeated here.
[0138] According to an embodiment of the present disclosure, the first determining unit includes a first determining subunit and a second determining subunit.
[0139] The first determining subunit is used to concatenate the preset linear variables in the first linear transformation vector and the second linear transformation vector to obtain a high-dimensional feature vector. In one embodiment, the first determining subunit can be used to perform the operation S501 described above, which will not be described in detail here.
[0140] The second determination subunit is used to determine the initial attention weight based on the high-dimensional feature vector and the attention parameter. In one embodiment, the second determination subunit can be used to perform the operation S502 described above, which will not be repeated here.
[0141] According to an embodiment of the present disclosure, the mining module 1004 includes a transformation module, a calculation module, and an entity determination module.
[0142] The transformation module is used to perform vector transformation on the attention weights according to the preset order of association relationships between multiple entities to obtain an in-link matrix and an out-link matrix. In one embodiment, the transformation module can be used to perform the operation S601 described above, which will not be repeated here.
[0143] The calculation module is used to calculate entity scores of multiple entities using a web page ranking algorithm according to the in-link matrix and the out-link matrix to obtain the multiple entities in a preset order. In one embodiment, the calculation module can be used to perform the operation S602 described above, which will not be repeated here.
[0144] The entity determination module is used to determine a target entity among multiple entities according to multiple entities in a preset order. In one embodiment, the entity determination module can be used to perform the operation S603 described above, which will not be described in detail here.
[0145] According to an embodiment of the present disclosure, the second determination module 1002 includes a semantic determination module, a form determination module and an association relationship determination module.
[0146] The semantic determination module is used to determine the semantic levels of the multiple entities based on the attribute feature vectors and the concepts of the multiple entities. In one embodiment, the semantic determination module can be used to perform the operation S701 described above, which will not be described in detail here.
[0147] The form determination module is used to determine the association relationship of the preset form according to the semantic level and the categories of the multiple entities. In one embodiment, the form determination module can be used to perform the operation S702 described above, which will not be described in detail here.
[0148] The association relationship determination module is used to determine the association relationship between multiple entities according to the association relationship in a preset form. In one embodiment, the association relationship determination module can be used to perform the operation S703 described above, which will not be described in detail here.
[0149] Fig.11 A block diagram of an electronic device suitable for a method for mining target entities based on an attention mechanism according to an embodiment of the present disclosure is schematically shown.
[0150] like Fig.11 As shown, the electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 to a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include an onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0151] In RAM 1103, various programs and data required for the operation of electronic device 1100 are stored. Processor 1101, ROM 1102 and RAM 1103 are connected to each other through bus 1104. Processor 1101 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1102 and / or RAM 1103. It should be noted that the program can also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0152] According to an embodiment of the present disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to the bus 1104. The electronic device 1100 may further include one or more of the following components connected to the I / O interface 1105: an input portion 1106 including a keyboard, a mouse, etc.; an output portion 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1108 including a hard disk, etc.; and a communication portion 1109 including a network interface card such as a LAN card, a modem, etc. The communication portion 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage portion 1108 as needed.
[0153] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0154] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above and / or one or more memories other than ROM 1102 and RAM 1103.
[0155] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method for mining target entities based on the attention mechanism provided by the embodiment of the present disclosure.
[0156] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1101. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0157] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1109, and / or installed from a removable medium 1111. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0158] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the processor 1101, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0159] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0160] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0162] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for mining target entities based on an attention mechanism, comprising: Determine attribute feature vectors of multiple entities based on network data and professional data; Determining association relationships among the multiple entities based on the attribute feature vector and definition data of the multiple entities; Determining the attention weights of the association relationships between the multiple entities using a relationship weight learning model, wherein the relationship weight learning model includes a graph attention neural network; as well as According to the attention weights of the association relationships between the multiple entities, a target entity among the multiple entities is determined using a weighted web page ranking algorithm, wherein the target entity is the entity that reflects the most structural and functional information of all the association relationships among the multiple entities.
2. The method according to claim 1, wherein: The method of determining the attention weights of the association relationships between the multiple entities using the relationship weight learning model includes: Based on the association relationship, determine an adjacency matrix of the association relationship between the multiple entities, the adjacency matrix includes a matrix obtained according to the association relationship between a first entity and a second entity, the first entity is the entity currently processed by the relationship weight learning model, and the second entity includes all entities connected to the first entity; Determining initial entity features based on the adjacency matrix, the attribute feature vector of the first entity, and the attribute feature vector of the second entity; Performing a linear transformation on the initial entity feature to obtain a first linear transformation vector and a second linear transformation vector, wherein the first linear transformation vector includes a linear transformation vector of the first entity, and the second linear transformation includes a linear transformation vector of the second entity; Determining an attention weight of an association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector; and Based on the attention weight of the association relationship between the first entity and the second entity, the attention weight of the association relationship between the multiple entities is determined.
3. The method according to claim 2, wherein: Determining the attention weight of the association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector includes: Determining an initial attention weight of an association relationship between the first entity and the second entity based on the first linear transformation vector and the second linear transformation vector; Based on the initial attention weight, determining an attention coefficient; Determining entity features of feature aggregation according to the attention coefficient and the second linear change vector; and Based on the entity features of the feature aggregation, the first linear transformation vector and the second linear transformation vector, an attention weight of the association relationship between the first entity and the second entity is determined.
4. The method according to claim 3, wherein: Determining an initial attention weight of the association relationship between the first entity and the second entity includes: concatenating the first linear transformation vector and the preset linear variables in the second linear transformation vector to obtain a high-dimensional feature vector; and Based on the high-dimensional feature vector and the attention parameter, an initial attention weight is determined.
5. The method according to claim 1, wherein: Determining the target entity among the multiple entities by using a weighted web page ranking algorithm according to the attention weights of the association relationships between the multiple entities includes: According to a preset order of association relationships between the multiple entities, the attention weights are vector transformed to obtain an in-link matrix and an out-link matrix; Calculating entity scores of the plurality of entities using a weighted web page ranking algorithm according to the in-link matrix and the out-link matrix to obtain the plurality of entities in a preset order; and According to the multiple entities in the preset order, a target entity among the multiple entities is determined.
6. The method according to claim 1, wherein: The entity definition data includes the concept, category, and association of the entity, and the determining the association relationship between the multiple entities based on the attribute feature vector and the definition data of the multiple entities includes: Determining semantic levels of the multiple entities based on the attribute feature vector and the concepts of the multiple entities; Determining a preset form of association relationship according to the semantic level and the categories of the plurality of entities; and According to the preset form of the association relationship, the association relationship between the multiple entities is determined.
7. A device for mining a target entity based on an attention mechanism, comprising: A first determination module is used to determine attribute feature vectors of multiple entities based on network data and professional data; A second determining module, configured to determine the association relationship between the plurality of entities based on the attribute feature vector and the definition data of the plurality of entities; A third determination module is used to determine the attention weights of the association relationships between the multiple entities using a relationship weight learning model; as well as A mining module is used to determine a target entity among the multiple entities based on the attention weights of the association relationships between the multiple entities using a weighted web page ranking algorithm, wherein the target entity is the entity that has the most structural and functional information reflecting the association relationships among the multiple entities.
8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for determining entity service attributes
CN111737546A
Efficient learning method and device for large-scale heterogeneous graph node representation
CN113326884A
Associated user recognition method and device based on multilayer graph attention network
CN113628059A
