Entity linking method and apparatus, electronic device, and computer-readable storage medium
By identifying and fusing entity text features and graph features in a knowledge graph, the problem of low entity link accuracy in existing technologies is solved, and higher entity link accuracy is achieved.
Patent Information
- Application Number
- CN202210454355.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-04-27
AI Technical Summary
Existing entity linking methods, when implementing entity linking through text links, suffer from limited and coarse entity text features, resulting in low accuracy of entity linking.
The knowledge subgraphs corresponding to candidate entities are selected from the preset knowledge graph, the graph topology information is identified, and graph features are extracted. The entity text features and graph features are fused to obtain fused tensor features. Based on the fused tensor features, the target entities are selected from the candidate entities and linked.
By identifying and fusing graph topology information, the accuracy of graph features is improved, thereby enhancing the accuracy of entity linking.
Smart Images

Figure CN117033643B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to an entity linking method and device, electronic equipment and computer readable storage medium. BACKGROUND
[0002] Entity linking (EL) technology is a hot spot in the field of natural language processing in recent years, and plays a very important role in scenarios such as knowledge graph construction. Specifically, entity linking (also known as entity linking) is a technology that maps entities appearing in a to-be-recognized text to a given knowledge graph, which is used to correspond the to-be-recognized entity with the entity existing in the knowledge graph to complete natural language tasks such as question answering, semantic search, information extraction, etc. The existing entity linking method often realizes entity linking through text linking.
[0003] In the research and practice process of the prior art, the present application found that the text linking method mainly extracts the text features on both sides to determine whether they are the same entity. The text features extracted on the knowledge graph side are single and rough, and cannot fully represent the feature information existing in the knowledge graph, thus resulting in low accuracy of entity linking. SUMMARY
[0004] The embodiment of the present application provides an entity linking method, device, electronic equipment and computer readable storage medium, which can improve the accuracy of entity linking.
[0005] An entity linking method comprises:
[0006] Obtaining entity information of a to-be-linked entity, and extracting entity text features from the entity information;
[0007] Filtering out a knowledge sub-graph corresponding to each candidate entity in a preset knowledge graph, and identifying graph topology structure information in the knowledge sub-graph, the graph topology structure information being used to indicate structure information between nodes in the knowledge sub-graph;
[0008] Extracting graph features corresponding to the candidate entity from the graph topology structure information;
[0009] Fusing the entity text features and the graph features to obtain fused tensor features;
[0010] Based on the fused tensor features, filtering out a target entity corresponding to the to-be-linked entity from the candidate entity, and linking the to-be-linked entity to the target entity.
[0011] Correspondingly, the embodiment of the present application provides an entity linking device, comprising:
[0012] An acquisition unit is configured to acquire entity information of an entity to be linked, and extract entity text features from the entity information;
[0013] An identification unit is configured to filter a knowledge sub-graph corresponding to each candidate entity from a preset knowledge graph, and identify graph topology structure information from the knowledge sub-graph, the graph topology structure information being used to indicate structural information between nodes in the knowledge sub-graph;
[0014] An extraction unit is configured to extract graph features corresponding to the candidate entity from the graph topology structure information;
[0015] A fusion unit is configured to fuse the entity text features and the graph features to obtain fused tensor features;
[0016] A linking unit is configured to filter a target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and link the entity to be linked to the target entity.
[0017] Optionally, in some embodiments, the extraction unit can be specifically configured to extract node information of each node in the knowledge sub-graph and edge information between the nodes from the graph topology structure information; and perform semantic feature extraction on the node information and the edge information to obtain the graph features corresponding to the candidate entity.
[0018] Optionally, in some embodiments, the extraction unit can be specifically configured to perform semantic feature extraction on the node information to obtain node features, and perform semantic feature extraction on the edge information to obtain edge features; and fuse the node features and the edge features to obtain the graph features corresponding to the candidate entity.
[0019] Optionally, in some embodiments, the extraction unit can be specifically configured to perform average pooling processing on the node features to obtain pooled node features, and perform average pooling processing on the edge features to obtain pooled edge features; and fuse the pooled node features and the pooled edge features to obtain the graph features corresponding to the candidate entity.
[0020] Optionally, in some embodiments, the fusion unit can be specifically configured to acquire entity dimension information of the entity text features and graph dimension information of the graph features; determine tensor fusion parameters based on the entity dimension information and the graph dimension information; and perform tensor fusion on the entity text features and the graph features according to the tensor fusion parameters to obtain the fused tensor features.
[0021] Optionally, in some embodiments, the fusion unit can be specifically configured to obtain preset output parameters in the tensor fusion process, and extract output dimension information from the preset output parameters; fuse the output dimension information, entity dimension information and graph dimension information to obtain tensor fusion dimension information; and construct tensor fusion parameters in the tensor fusion process based on the tensor fusion dimension information.
[0022] Optionally, in some embodiments, the fusion unit can be specifically configured to fuse the tensor fusion parameters, entity text features and graph features to obtain initial fused tensor features; obtain preset bias information, and add the preset bias information to the initial fused tensor features to obtain fused tensor features.
[0023] Optionally, in some embodiments, the linking unit can be specifically configured to extract associated features from the fused tensor features by using a trained entity detection model, the associated features being used to indicate an association relationship between the entity to be linked and the candidate entity; determine the association relationship between the entity to be linked and the candidate entity based on the associated features; and filter out candidate entities with the same entity association relationship from the candidate entities to obtain a target entity corresponding to the entity to be linked.
[0024] Optionally, in some embodiments, the entity linking apparatus can further include a training unit, which can be specifically configured to obtain entity sample information, the entity sample information including sample entity information of a sample entity, sub-graph information of a candidate sample entity, and a labeled association relationship between the sample entity and the candidate sample entity; predict an association relationship between the sample entity and the candidate sample entity by using a preset entity detection model according to the sample entity information and the sub-graph information to obtain a predicted association relationship; and converge the preset entity detection model based on the predicted association relationship and the labeled association relationship to obtain a trained entity detection model.
[0025] Optionally, in some embodiments, the identification unit can be specifically configured to identify at least one candidate entity in a preset knowledge graph, and filter out a candidate node having a preset distance from the candidate entity in the preset knowledge graph; extract relationship information between the candidate node and the candidate entity in the preset knowledge graph; and construct a knowledge sub-graph corresponding to the candidate entity based on the relationship information, the candidate entity and the candidate node.
[0026] Optionally, in some embodiments, the identifying unit can be specifically configured to identify the association information between the candidate entities and the candidate nodes in the knowledge sub-graph, and create a graph network corresponding to the knowledge sub-graph based on the nodes and the association information, and extract the graph topology structure information in the graph network.
[0027] Optionally, in some embodiments, the obtaining unit can be specifically configured to perform text feature extraction on the text information and the entity object information to obtain text features corresponding to the text information and entity object features corresponding to the entity object information, fuse the text features and the entity object features to obtain fused text features, and screen text classification features from the fused text features, and take the text classification features as the entity text features.
[0028] Optionally, in some embodiments, the entity linking device can further include an updating unit, which can be specifically configured to screen the knowledge sub-graph of the target entity from the knowledge sub-graph to obtain a target knowledge sub-graph, identify the current entity information of the target entity in the target knowledge sub-graph, and update the entity information of the entity to be linked based on the current entity information to obtain updated entity information.
[0029] In addition, an electronic device is also provided in the embodiments of the present application, which includes a processor and a memory, the memory stores an application program, and the processor is configured to run the application program in the memory to implement the entity linking method provided in the embodiments of the present application.
[0030] In addition, a computer readable storage medium is also provided in the embodiments of the present application, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the entity linking methods provided in the embodiments of the present application.
[0031] After obtaining the entity information of the entity to be linked and extracting the entity text features from the entity information, the embodiments of the present application screen the knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph, identify the graph topology structure information in the knowledge sub-graph, extract the graph features corresponding to the candidate entity from the graph topology structure information, fuse the entity text features and the graph features to obtain fused tensor features, screen the target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and link the entity to be linked to the target entity. Since the graph topology structure information can be identified in the knowledge sub-graph, the graph features can be extracted from the graph topology structure information, the graph features implicitly contain the graph topology information in the knowledge sub-graph, and thus the accuracy of the graph features is improved, and therefore the accuracy of the entity linking is improved. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of a scenario for the entity linking method provided in an embodiment of the present invention;
[0034] Figure 2 This is a flowchart illustrating the entity linking method provided in an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the structure of the knowledge sub-spectrum provided in an embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram of the process of associating an entity to be linked with a target entity according to an embodiment of the present invention;
[0037] Figure 5 This is a schematic diagram of the basic model architecture of the entity detection model provided in the embodiments of the present invention;
[0038] Figure 6 This is another schematic diagram of the entity linking process provided in the embodiments of the present invention;
[0039] Figure 7 This is a schematic diagram of the structure of the physical linking device provided in an embodiment of the present invention;
[0040] Figure 8 This is another structural schematic diagram of the physical linking device provided in an embodiment of the present invention;
[0041] Figure 9 This is another structural schematic diagram of the physical linking device provided in an embodiment of the present invention;
[0042] Figure 10 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] Embodiments of the present application provide an entity linking method, device, electronic equipment and computer readable storage medium. Wherein, the entity linking device can be integrated in the electronic equipment, which can be a server, a terminal or the like.
[0045] Wherein, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited in the present application.
[0046] For example, referring to Figure 1 For example, referring to
[0047] Wherein, it can be understood that in the specific embodiments of the present application, the entity information related to the object or the object information in the knowledge graph and the like need to be licensed or agreed when the following embodiments of the present application are applied to specific products or technologies, and the collection, use and processing of the related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0048] The following will be described in detail. It should be noted that the order of the following embodiments is not limited as the preferred order of the embodiments.
[0049] The present embodiment will be described from the perspective of the entity linking device, which can be integrated in the electronic equipment, which can be a server, a terminal or the like. Wherein, the terminal can include a tablet computer, a notebook computer, a personal computer (PC), a wearable device, a virtual reality device or other smart devices that can be linked to entities, etc.
[0050] An entity linking method comprises:
[0051] Obtaining entity information of an entity to be linked, and extracting entity text features from the entity information, screening a knowledge sub-graph corresponding to each candidate entity from a preset knowledge graph, and identifying graph topology structure information in the knowledge sub-graph, the graph topology structure information being used to indicate structural information between nodes in the knowledge sub-graph, extracting graph features corresponding to the candidate entity from the graph topology structure information, fusing the entity text features and the graph features to obtain fused tensor features, screening a target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and linking the entity to be linked to the target entity.
[0052] As shown in Figure 2 , the specific process of the entity linking method is as follows:
[0053] 101. Obtain entity information of an entity to be linked, and extract entity text features from the entity information.
[0054] The entity information can be content information in which the entity to be linked is located, for example, when the entity to be linked is Zhang X, the entity information of the entity to be linked can be a content title, content text or other text information containing Zhang X, such as "Zhang X attended the cultural exchange meeting in XX city tonight" and the like.
[0055] The entity text features can be text feature information contained in the entity information.
[0056] The way of obtaining the entity information of the entity to be linked can be various, and can be as follows:
[0057] For example, the entity information of the entity to be linked uploaded by the user through the terminal can be directly obtained, or the text content can be obtained, at least one entity to be linked is identified in the text content, and the entity information corresponding to the entity to be linked is extracted in the text content.
[0058] After obtaining the entity information of the entity to be linked, the entity text features can be extracted from the entity information. The entity information can include text information and entity object information. The text information can be understood as the text in the entity information, and the entity object information can be understood as the object information in the entity information for representing the entity to be linked. For example, taking the entity information "Zhang X attended the cultural exchange meeting in XX city tonight" as an example, the text information (content_m) can be "Zhang X attended the cultural exchange meeting in XX city tonight", and the entity object information can be the entity to be linked (mention") "Zhang X".
[0059] The manner of extracting entity text features can be various. For example, a text feature extraction network of a trained entity detection model can be used to extract features of text information and entity object information respectively to obtain text features corresponding to the text information and entity object features corresponding to the entity object information. The text features and the entity object features are fused to obtain fused text features. Text classification features are selected from the fused text features, and the text classification features are taken as entity text features.
[0060] The text feature extraction network can be a pre-trained BERT network (a kind of text encoding network) or other text encoding network. Taking the pre-trained BERT network as an example, the information of the query candidate entity mention can be encoded by the BERT network. The encoding process can be shown in formula (1):
[0061] T emb =BERT(mention+content)(1)
[0062] wherein T emb is an entity text feature, mention is a to-be-linked entity, content is text information, and T emb may be a CLS-Token corresponding encoding vector.
[0063] 102. In the preset knowledge graph, the knowledge sub-graph corresponding to each candidate entity is screened out, and the graph topology structure information is identified in the knowledge sub-graph.
[0064] The preset content knowledge graph can be understood as a pre-set content-related knowledge graph. The knowledge graph is a knowledge base containing entities and relationships, and is commonly represented by triplets (head entity, relationship, tail entity). The knowledge graph has the advantages of containing semantic relationships of related entities, diverse relationship composition, and good interpretability, and has been widely used in search, recommendation, and question answering in recent years.
[0065] The knowledge sub-graph is a sub-graph corresponding to the candidate entity in the preset knowledge graph. A basic knowledge sub-graph can be shown in formula (2). A sub-graph is constructed around two entities id1 and id2. The elements in the knowledge sub-graph can be shown as follows: Figure 3
[0066] (1) Entity: id1, id2
[0067] (2) Relationship: work industry, place of birth, etc.
[0068] (3) Attribute: photo, poster, name, type.
[0069] The graph topology information is used to indicate structural information between nodes in the knowledge sub-graph.
[0070] The manner of screening the knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph can be various, and can be specifically as follows:
[0071] For example, at least one candidate entity is identified in the preset knowledge graph, and a candidate node having a preset distance from the candidate entity is screened in the preset knowledge graph. Relationship information between the candidate node and the candidate entity is extracted in the preset knowledge graph. Based on the relationship information, the candidate entity and the candidate node, a knowledge sub-graph corresponding to the candidate entity is constructed.
[0072] The preset knowledge graph can include a plurality of nodes, and the candidate entity can also be one of the plurality of nodes. The manner of screening the candidate node having a preset distance from the candidate entity in the preset knowledge graph can be various, such as screening the node having a distance of one hop or two hops from the candidate entity as the candidate node in the preset knowledge graph.
[0073] After the knowledge sub-graph corresponding to the candidate entity is constructed, the manner of identifying the graph topology information in the knowledge sub-graph can be various, such as taking the candidate entity and the candidate node in the knowledge sub-graph as nodes, identifying the association information between the nodes in the knowledge sub-graph, creating a graph network corresponding to the knowledge sub-graph based on the nodes and the association information, and extracting the graph topology information in the graph network.
[0074] 103. Extracting a graph feature corresponding to the candidate entity in the graph topology information.
[0075] The graph feature is used to represent graph information in the graph network corresponding to the knowledge sub-graph.
[0076] The manner of extracting the graph feature corresponding to the candidate entity in the graph topology information can be various, and can be specifically as follows:
[0077] For example, the node information of each node in the knowledge sub-graph and the edge information between the nodes can be extracted in the graph topology information. The node information and the edge information are subjected to semantic feature extraction to obtain the graph feature corresponding to the candidate entity.
[0078] The manner of subjecting the node information and the edge information to semantic feature extraction can be various, such as subjecting the node information to semantic feature extraction to obtain node features, subjecting the edge information to semantic feature extraction to obtain edge features, and fusing the node features and the edge features to obtain the graph feature corresponding to the candidate entity.
[0079] The semantic feature extraction manner of the node information and the edge information can be various. For example, a semantic feature extraction network of a trained entity detection model can be used to extract semantic features of the node information and the edge information, so as to obtain node features and edge features.
[0080] The network structure of the semantic feature extraction network can be various. For example, the semantic feature extraction network can be a GCN (graph convolutional network) or other semantic feature extraction network. Taking the GCN as an example, the GCN takes a graph topology structure as input, and finally converges to obtain semantic vectors of nodes and edges in each graph. Therefore, the final node and edge vectors all contain the final graph topology information, which can be specifically shown in formula (2):
[0081] Nodei|Sidej=GCN(sub_graph)(2)
[0082] In the formula, Nodei represents the node feature, Sidej represents the edge feature, and sub_graph represents the graph topology structure information.
[0083] After the node features and the edge features are extracted, the node features and the edge features can be fused. The fusion manner can be various. For example, the node features can be subjected to average pooling processing to obtain pooled node features, the edge features can be subjected to average pooling processing to obtain pooled edge features, and the pooled node features and the pooled edge features can be fused to obtain a graph feature corresponding to the candidate entity, which can be specifically shown in formula (3):
[0084] G emb =avgpooling(Nodei|Sidej)(3)
[0085] In the formula, G emb represents the graph feature, Nodei represents the node feature, and Sidej represents the edge feature.
[0086] 104. The entity text feature and the graph feature are fused to obtain a fused tensor feature.
[0087] In the formula, the fused tensor feature can be a fusion feature obtained by tensor fusion of the entity text feature and the graph feature.
[0088] The manner of fusing the entity text feature and the graph feature can be various, which can be specifically as follows:
[0089] For example, entity dimension information of the entity text feature and graph dimension information of the graph feature can be obtained, tensor fusion parameters can be determined based on the entity dimension information and the graph dimension information, and the entity text feature and the graph feature can be tensor fused according to the tensor fusion parameters to obtain the fused tensor feature.
[0090] The tensor fusion parameter can be understood as a fusion parameter required for tensor fusion. Based on the entity dimension information and the graph dimension information, the tensor fusion parameter can be determined in multiple ways. For example, a preset output parameter in a tensor fusion process is obtained, and output dimension information is extracted from the preset output parameter. The output dimension information, the entity dimension information, and the graph dimension information are fused to obtain tensor fusion dimension information. Based on the tensor fusion dimension information, the tensor fusion parameter in the tensor fusion process is constructed.
[0091] The preset output parameter can be understood as parameter information of a preset feature output after tensor fusion. The output dimension information can be dimension information of a tensor fusion feature output after tensor fusion. The output dimension information, the entity dimension information, and the graph dimension information can be fused in multiple ways. For example, the entity dimension (T emb dimension) in the entity dimension information is m*1, the graph dimension (G emb dimension) in the graph dimension information is n*1, and the output dimension d is fused to obtain tensor fusion dimension information as m*n*d.
[0092] After the tensor fusion parameter is constructed, the entity text feature and the graph feature can be fused according to the tensor fusion parameter. The fusion can be performed in multiple ways. For example, the tensor fusion parameter, the entity text feature, and the graph feature are fused to obtain an initial fused tensor feature. A preset bias information is obtained, and the preset bias information is added to the initial fused tensor feature to obtain a fused tensor feature.
[0093] The preset bias information can be understood as a preset bias constant. The dimension of the bias constant can be the output dimension d. The preset bias information can be added to the initial fused tensor feature in multiple ways. For example, the initial fused tensor feature can be directly added to the preset bias information to obtain the fused tensor feature. Specifically, the fused tensor feature can be represented by formula (4):
[0094] fusion=T em *W[1∶d]*G emb +b
[0095] Wherein, fusion is the fused tensor feature, T em is the entity text feature, G emb is the graph feature, W[1∶d] is the tensor fusion parameter, and b is the preset bias information.
[0096] In the feature vector example, tensor fusion is based on vector bidirectional multiplication xBy, which is considered to enhance the multiplication between vectors to the second-order interaction, thereby strengthening the information interaction between the knowledge sub-graphs on the side of the entity to be linked and the side of the candidate entity.
[0097] 105、Based on the fused tensor feature, a target entity corresponding to the entity to be linked is selected from the candidate entities, and the entity to be linked is linked to the target entity.
[0098] Among them, based on the fused tensor feature, the target entity corresponding to the entity to be linked can be selected in various ways, which can be as follows:
[0099] For example, the trained entity detection model can be used to extract the association feature from the fused tensor feature, based on the association feature, the association relationship between the entity to be linked and the candidate entity is determined, the candidate entity with the same entity is selected from the candidate entity, and the target entity corresponding to the entity to be linked is obtained.
[0100] Among them, the association feature is used to indicate the association relationship between the entity to be linked and the candidate entity. Based on the association feature, the association relationship between the entity to be linked and the candidate entity can be determined in various ways, such as using the classification network of the trained entity detection model to distinguish the association feature. Here, the discrimination can be understood as a binary classification, which determines whether the entity to be linked and the candidate entity are consistent, thereby obtaining the association relationship between the entity to be linked and the candidate entity. Therefore, the association relationship can include the same entity and different entities between the entity to be linked and the candidate entity.
[0101] Optionally, the trained entity detection model can be set according to actual application. In addition, it should be noted that the trained entity detection model can be pre-set by maintenance personnel, or it can be trained by the entity linking device itself, that is, before the step of "using the trained entity detection model to extract the association feature from the fused tensor feature", the entity linking method can further include:
[0102] Obtain entity sample information, the entity sample information includes sample entity information of a sample entity, sub-graph information of a candidate sample entity, and labeled association relationship between the sample entity and the candidate sample entity, predict the association relationship between the sample entity and the candidate sample entity based on the sample entity information and the sub-graph information using a preset entity detection model, obtain a predicted association relationship, and based on the predicted association relationship and the labeled association relationship, the preset entity detection model is converged to obtain a trained entity detection model.
[0103] The entity sample information can be the entity information corresponding to the sample entities selected from the training dataset. Taking the candidate entity "Zhang X" as an example, the format of the entity sample information can be as follows:
[0104] Sample = [{"mention":"Zhang X","content_m":"Zhang X attended the cultural exchange meeting in XX city tonight"},{"id":"id1","name":"Zhang X","Occupation":"Singer"...},[{"label":1}]].
[0105] After obtaining entity sample information, a pre-defined entity detection model can be used to predict the association between sample entities and candidate sample entities. There are several ways to do this. For example, the text feature extraction network of the pre-defined entity detection model can be used to extract text features from the sample entity information to obtain sample entity text features. The sample graph topology information can be identified in the sub-graph information. The graph convolutional network of the pre-defined entity detection model can be used to extract the sample graph features corresponding to the candidate sample entities from the sample graph topology information. The sample entity text features and sample graph features can be fused using tensors to obtain sample tensor features. Based on the sample tensor features, the classification network of the pre-defined entity detection model can be used to predict the association between sample entities and candidate sample entities to obtain the predicted association.
[0106] After predicting the association between sample entities and candidate sample entities, the preset entity detection model can be converged based on the predicted association and the labeled association. There are several ways to converge, such as determining the loss information corresponding to the preset entity detection model based on the predicted association and the labeled association, and updating the network parameters of the preset entity detection model based on the loss information to obtain the trained entity detection model.
[0107] There are several ways to determine the loss information corresponding to the preset entity detection model based on the predicted association relationship and the labeled association relationship. For example, the negative log cross-entropy loss function can be used to calculate the loss information between the predicted association relationship and the labeled association relationship, thereby obtaining the loss information corresponding to the preset entity detection model.
[0108] After filtering out the target entities corresponding to the linked entities, the entity to be linked can be linked to the target entity. There are several ways to link to the target entity. For example, the entity to be linked can be directly associated with the target entity, or the entity identifier information of the target entity can be obtained and added to the entity information of the entity to be linked to link the entity to the target entity.
[0109] Optionally, after the to-be-linked entity is linked with the target entity, the entity of the to-be-linked entity can also be updated, and the updating manner can be various, such as a target knowledge sub-graph can be screened out from the knowledge sub-graph, a target knowledge sub-graph is obtained, current entity information of the target entity is identified in the target knowledge sub-graph, the entity information of the to-be-linked entity is updated based on the current entity information, and updated entity information is obtained.
[0110] Wherein, updating the entity information of the to-be-linked entity or linking the to-be-linked entity with the target entity can be regarded as knowledge enhancement of the to-be-linked entity, such as an article describes that Zhang X attended a movie release conference, we can easily obtain that the Zhang X refers to the film star Zhang X based on the content of the article. However, an article assumes that Zhang X refers to a professor at XX University, at this time, entity linking is needed, and it is needed to determine which entity in the graph the Zhang X in the article refers to. Still taking Figure 3 as an example, the target of entity chain pointing is to uniquely associate the candidate entity mentioned in the query or the article with the entity in the graph, which can be applied to graph entity disambiguation and chain pointing scenarios, and the specific association process can be as shown in Figure 4 .
[0111] Wherein, in the entity linking process, the scheme respectively introduces a graph convolutional network GCN to encode the topology information of the graph side, proposes to use a tensor fusion method to strengthen the interaction between the two sides of information, and the basic model architecture of the entity detection model is as shown in Figure 5 . The BERT network is used to extract the text features of the entity information, so as to obtain the encoding vector corresponding to the CLS-Token as the final entity text feature, the GCN network is used to encode the sub-graph information, the GCN takes the graph topology structure as the input, and finally converges to obtain the semantic vector of each node and the edge between the nodes in the graph, so that the final node and edge vector all contain the final graph topology information. The graph representation vector is obtained based on the avgpooling method, and the graph representation vector is taken as the graph feature corresponding to the candidate entity. The tensor fusion method is introduced to fuse the entity text feature and the graph feature to obtain a fusion vector fusion, the fusion vector fusion is taken as the fused tensor feature, and the fused tensor feature is input into the final discrimination module. Here, binary classification is performed, that is, whether the entities on both sides are consistent is determined, and when the entities on both sides are consistent, the to-be-linked entity is linked with the target entity.
[0112] As can be seen from the above, in this embodiment, after obtaining the entity information of the entity to be linked and extracting the entity text features from the entity information, the knowledge subgraph corresponding to each candidate entity is selected in the preset knowledge graph, and the graph topology information is identified in the knowledge subgraph. Then, the graph features corresponding to the candidate entity are extracted from the graph topology information, and the entity text features and graph features are fused to obtain fused tensor features. Then, based on the fused tensor features, the target entity corresponding to the entity to be linked is selected from the candidate entities, and the entity to be linked is linked to the target entity. Since this scheme can identify the graph topology information in the knowledge subgraph and extract features from the graph topology information to obtain graph features, the extracted graph features implicitly contain the graph topology information in the knowledge subgraph, thereby improving the accuracy of the graph features. Therefore, the accuracy of entity linking can be improved.
[0113] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.
[0114] In this embodiment, the physical linking device will be specifically integrated into an electronic device, with the electronic device being a server, as an example for explanation.
[0115] (i) The server trains the preset entity detection model.
[0116] The server can obtain entity sample information, which includes the sample entity information, the sub-graph information of the candidate sample entities, and the annotation associations between the sample entities and the candidate sample entities. Taking the candidate entity "Zhang X" as an example, the format of the entity sample information can be as follows:
[0117] Sample = [{"mention":"Zhang X","content_m":"Zhang X attended the cultural exchange meeting in XX city tonight"},{"id":"id1","name":"Zhang X","Occupation":"Singer"...},[{"label":1}]].
[0118] The server uses a text feature extraction network of a pre-defined entity detection model to extract text features from sample entity information, obtaining sample entity text features. It then identifies sample graph topology information in the sub-graph information and uses a graph convolutional network of the pre-defined entity detection model to extract sample graph features corresponding to candidate sample entities from the sample graph topology information. The sample entity text features and sample graph features are then fused using tensors to obtain sample tensor features. Based on the sample tensor features, a classification network of the pre-defined entity detection model is used to predict the association relationship between sample entities and candidate sample entities, thus obtaining the predicted association relationship.
[0119] The server can calculate the loss information between the predicted association and the labeled association by using a negative logarithmic cross-entropy loss function, so as to obtain the loss information corresponding to the preset entity detection model. Based on the loss information, the network parameters of the preset entity detection model are updated to obtain the trained entity detection model.
[0120] (ii) The server links the entity to be linked to the target entity by using the trained entity detection model.
[0121] The trained entity detection model can include a text feature extraction network, a graph feature extraction network, and a classification network (a binary classifier), and the specific process can be as follows:
[0122] As shown in FIG. 1, an entity linking method is provided, and the specific process is as follows: Figure 6
[0123] 201. The server obtains entity information of an entity to be linked.
[0124] For example, the server can directly obtain the entity information of the entity to be linked uploaded by the user through the terminal, or can also obtain the text content, identify at least one entity to be linked in the text content, and extract the entity information corresponding to the entity to be linked in the text content.
[0125] 202. The server extracts entity text features from the entity information.
[0126] For example, the server can encode the information of the query candidate entity mention (entity information) by using the BERT network of the trained entity detection model. The encoding process can be as shown in formula (1), to obtain the text features corresponding to the text information and the entity object features corresponding to the entity object information. The text features and the entity object features are fused to obtain the fused text features. The encoding vector corresponding to CLS-Token in the fused text features is selected as the text classification feature, and the text classification feature is taken as the entity text feature.
[0127] 203. The server screens a knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph.
[0128] For example, the server identifies at least one candidate entity in the preset knowledge graph, screens the nodes within one hop or two hops from the candidate entity as candidate nodes in the preset knowledge graph, extracts the relationship information between the candidate nodes and the candidate entity in the preset knowledge graph, and constructs the knowledge sub-graph corresponding to the candidate entity based on the relationship information, the candidate entity, and the candidate node.
[0129] 204. The server identifies graph topology structure information in the knowledge sub-graph.
[0130] For example, the server can take the candidate entity and the candidate node in the knowledge sub-graph as a node, identify the association information between the nodes in the knowledge sub-graph, create a graph network corresponding to the knowledge sub-graph based on the node and the association information, and extract the graph topology structure information in the graph network.
[0131] 205. The server extracts the graph feature corresponding to the candidate entity from the graph topology structure information.
[0132] For example, the server can use the semantic feature extraction network (GCN) of the trained entity detection model to perform semantic feature extraction on the node information and the edge information. The GCN takes the graph topology structure as input, and finally converges to obtain the semantic vector of each node and the edge between the nodes. Therefore, the final node and edge vector contains the final graph topology information, which can be represented as formula (2), so as to obtain the node feature and the edge feature. The node feature is subjected to average pooling processing to obtain the pooled node feature, and the edge feature is subjected to average pooling processing to obtain the pooled edge feature. The pooled node feature and the pooled edge feature are fused to obtain the graph feature corresponding to the candidate entity, which can be represented as formula (3).
[0133] 206. The server fuses the entity text feature and the graph feature to obtain a fused tensor feature.
[0134] For example, the server can obtain entity dimension information of the entity text feature and graph dimension information of the graph feature, obtain a preset output parameter in the tensor fusion process, and extract output dimension information in the preset output parameter. The entity dimension (T emb dimension) in the entity dimension information is m*1, the graph dimension (G emb dimension) in the graph dimension information is n*1, and the output dimension d is fused to obtain tensor fusion dimension information m*n*d. The tensor fusion parameter, the entity text feature and the graph feature are fused to obtain an initial fused tensor feature. The preset bias information is obtained, and the initial fused tensor feature is directly added to the preset bias information to obtain the fused tensor feature, which can be represented as formula (4).
[0135] 207. The server filters out a target entity corresponding to the to-be-linked entity from the candidate entity based on the fused tensor feature.
[0136] For example, the server can extract the associated features from the fused tensor features by using the post-training entity detection model, and can use the classification network of the post-training entity detection model to distinguish the associated features. The distinguishing can be understood as a binary classification, that is, determining whether the to-be-linked entity and the candidate entity are consistent, so as to obtain the association relationship between the to-be-linked entity and the candidate entity. Therefore, the association relationship can include that the to-be-linked entity and the candidate entity are the same entity and that the to-be-linked entity and the candidate entity are different entities. The candidate entity with the same entity is filtered from the candidate entity, and the target entity corresponding to the to-be-linked entity is obtained.
[0137] 208、The server links the to-be-linked entity to the target entity.
[0138] For example, the server can directly associate the to-be-linked entity and the target entity, or can also obtain the entity identifier information of the target entity, add the entity identifier information to the entity information of the to-be-linked entity based on the entity identifier information, and link the to-be-linked entity and the target entity.
[0139] Optionally, after the server links the to-be-linked entity to the target entity, the entity of the to-be-linked entity can also be updated. The updating mode can be various, for example, the server can filter the target knowledge sub-graph from the knowledge sub-graph, obtain the target knowledge sub-graph, identify the current entity information of the target entity in the target knowledge sub-graph, update the entity information of the to-be-linked entity based on the current entity information, and obtain the updated entity information.
[0140] As can be seen from the above, after the server obtains the entity information of the to-be-linked entity and extracts the entity text features from the entity information, the server filters the knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph, identifies the graph topology structure information in the knowledge sub-graph, extracts the graph features corresponding to the candidate entity from the graph topology structure information, fuses the entity text features and the graph features, obtains the fused tensor features, filters the target entity corresponding to the to-be-linked entity from the candidate entity based on the fused tensor features, and links the to-be-linked entity to the target entity. Since the scheme can identify the graph topology structure information in the knowledge sub-graph and extract the graph features from the graph topology structure information, the extracted graph features implicitly contain the graph topology information in the knowledge sub-graph, thereby improving the accuracy of the graph features, and thus the accuracy of the entity linking can be improved.
[0141] In order to better implement the above method, an embodiment of the present application further provides an entity linking device, which can be integrated in an electronic device, such as a server or a terminal, etc. The terminal can include a tablet computer, a notebook computer, and / or a personal computer, etc.
[0142] For example, as shown in Figure 7 The entity linking apparatus can include an acquisition unit 301, an identification unit 302, an extraction unit 303, a fusion unit 304, and a linking unit 305, as follows:
[0143] (1) The acquisition unit 301;
[0144] The acquisition unit 301 is configured to acquire entity information of an entity to be linked, and extract entity text features from the entity information.
[0145] For example, the acquisition unit 301 can be specifically configured to acquire entity information of an entity to be linked uploaded by a user through a terminal, or can also acquire text content, identify at least one entity to be linked in the text content, and extract entity information corresponding to the entity to be linked in the text content. A text feature extraction network of a trained entity detection model is used to extract features of the text information and the entity object information respectively, to obtain text features corresponding to the text information and entity object features corresponding to the entity object information, fuse the text features and the entity object features to obtain fused text features, screen text classification features from the fused text features, and use the text classification features as entity text features.
[0146] (2) The identification unit 302;
[0147] The identification unit 302 is configured to screen a knowledge sub-graph corresponding to each candidate entity from a preset knowledge graph, and identify graph topology structure information in the knowledge sub-graph, the graph topology structure information being used to indicate structural information between nodes in the knowledge sub-graph.
[0148] For example, the identification unit 302 can be specifically configured to identify at least one candidate entity from the preset knowledge graph, screen a candidate node having a preset distance from the candidate entity from the preset knowledge graph, extract relationship information between the candidate node and the candidate entity from the preset knowledge graph, construct a knowledge sub-graph corresponding to the candidate entity based on the relationship information, the candidate entity, and the candidate node, use the candidate entity and the candidate node in the knowledge sub-graph as nodes, identify association information between the nodes in the knowledge sub-graph, create a graph network corresponding to the knowledge sub-graph based on the nodes and the association information, and extract graph topology structure information from the graph network.
[0149] (3) The extraction unit 303;
[0150] The extraction unit 303 is configured to extract graph feature information corresponding to the candidate entity from the graph topology structure information.
[0151] For example, the extraction unit 303 can be specifically configured to extract node information of each node in the knowledge sub-graph and edge information between nodes in the graph topology information, perform semantic feature extraction on the node information to obtain node features, perform semantic feature extraction on the edge information to obtain edge features, fuse the node features and the edge features to obtain graph features corresponding to the candidate entity.
[0152] (4) the fusion unit 304;
[0153] The fusion unit 304 is configured to fuse the entity text features and the graph features to obtain fused tensor features.
[0154] For example, the fusion unit 304 can be specifically configured to obtain entity dimension information of the entity text features and graph dimension information of the graph features, determine tensor fusion parameters based on the entity dimension information and the graph dimension information, fuse the tensor fusion parameters, the entity text features and the graph features to obtain initial fused tensor features, obtain preset bias information, and add the preset bias information to the initial fused tensor features to obtain the fused tensor features.
[0155] (5) the linking unit 305;
[0156] The linking unit 305 is configured to filter out a target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and link the entity to be linked to the target entity.
[0157] For example, the linking unit 305 can be specifically configured to extract association features from the fused tensor features by using the trained entity detection model, determine an association relationship between the entity to be linked and the candidate entities based on the association features, filter out candidate entities with the same entity as the association relationship from the candidate entities to obtain the target entity corresponding to the entity to be linked, and associate the entity to be linked with the target entity, or obtain entity identifier information of the target entity, and add the entity identifier information to entity information of the entity to be linked based on the entity identifier information to link the entity to be linked with the target entity.
[0158] Optionally, the entity linking apparatus can further include a training unit 306, as shown in Figure 8 The training unit 306 can be specifically configured as follows:
[0159] The training unit 306 is configured to train a preset entity detection model to obtain a trained entity detection model.
[0160] For example, the training unit 306 can be specifically configured to obtain entity sample information, the entity sample information including sample entity information of a sample entity, sub-graph information of a candidate sample entity, and a labeled correlation relationship between the sample entity and the candidate sample entity, predict a correlation relationship between the sample entity and the candidate sample entity by using a preset entity detection model according to the sample entity information and the sub-graph information, obtain a predicted correlation relationship, and converge the preset entity detection model based on the predicted correlation relationship and the labeled correlation relationship, to obtain a trained entity detection model.
[0161] Optionally, the entity linking apparatus further includes an updating unit 307, as shown in Figure 9 Specifically, the updating unit 307 can be configured as follows:
[0162] The updating unit 307 is configured to update the entity information of the entity to be linked based on the knowledge sub-graph of the target entity.
[0163] For example, the updating unit 307 can be specifically configured to filter out a knowledge sub-graph corresponding to the target entity from the knowledge sub-graphs, to obtain a target knowledge sub-graph, identify current entity information of the target entity in the target knowledge sub-graph, and update the entity information of the entity to be linked based on the current entity information, to obtain updated entity information.
[0164] In implementation, each of the units can be implemented as an independent entity, or can be combined as the same or several entities, and the specific implementation of each of the units can be referred to the method embodiments above, which will not be repeated here.
[0165] As can be seen from the above, after the obtaining unit 301 obtains the entity information of the entity to be linked and extracts the entity text features from the entity information, the identifying unit 302 filters out a knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph, and identifies graph topology structure information in the knowledge sub-graph, then the extracting unit 303 extracts graph features corresponding to the candidate entity from the graph topology structure information, the fusing unit 304 fuses the entity text features and the graph features to obtain fused tensor features, and then the linking unit 305 filters out a target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and links the entity to be linked to the target entity; since this scheme can identify the graph topology structure information in the knowledge sub-graph, and extract the graph features from the graph topology structure information to obtain the graph features, the graph features extracted implicitly include the graph topology information in the knowledge sub-graph, thereby improving the accuracy of the graph features, and thus the accuracy of the entity linking can be improved.
[0166] The embodiment of the present application further provides an electronic device, as shown in Figure 10 which shows a structural schematic diagram of the electronic device related to the embodiment of the present application, and specifically:
[0167] The electronic device can include a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, a power supply 403, and an input unit 404, etc. Those skilled in the art can understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and can include more or fewer components than shown, or combine certain components, or different component arrangements. Among them: Figure 10
[0168] The processor 401 is the control center of the electronic device, which connects various parts of the entire electronic device through various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402. Optionally, the processor 401 can include one or more processing cores; preferably, the processor 401 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 401.
[0169] The memory 402 can be used to store software programs and modules, and the processor 401 executes various function applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 402 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 402 can also include a memory controller to provide access for the processor 401 to the memory 402.
[0170] The electronic device also includes a power supply 403 for powering various components, and preferably the power supply 403 can be logically connected to the processor 401 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption management, etc. through the power management system. The power supply 403 can also include one or more direct or alternating current power supplies, a recharging system, a power supply failure detection circuit, a power supply converter or inverter, a power supply state indicator, etc. any component.
[0171] The electronic device can further include an input unit 404 which can be used to receive inputted digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0172] Although not shown, the electronic device can further include a display unit or the like, which will not be described herein. In particular in the present embodiment, the processor 401 in the electronic device will load the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and run the application program stored in the memory 402 by the processor 401, thereby realizing various functions, such as the following:
[0173] The entity information of the entity to be linked is obtained, and entity text features are extracted from the entity information. A knowledge sub-graph corresponding to each candidate entity is screened out in a preset knowledge graph, and graph topology structure information is identified in the knowledge sub-graph. The graph topology structure information is used to indicate the structure information between nodes in the knowledge sub-graph. Graph feature corresponding to the candidate entity is extracted from the graph topology structure information. The entity text features and the graph feature are fused to obtain fused tensor features. Based on the fused tensor features, a target entity corresponding to the entity to be linked is screened out from the candidate entities, and the entity to be linked is linked to the target entity.
[0174] For example, the electronic device obtains entity information of a to-be-linked entity uploaded by a user through a terminal, or can also obtain text content, identifies at least one to-be-linked entity in the text content, and extracts entity information corresponding to the to-be-linked entity in the text content. The text feature extraction network of the trained entity detection model is used to respectively extract features of the text information and the entity object information, to obtain text features corresponding to the text information and entity object features corresponding to the entity object information, to fuse the text features and the entity object features to obtain fused text features, to screen text classification features from the fused text features, and to use the text classification features as entity text features. At least one candidate entity is identified in the preset knowledge graph, candidate nodes having a preset distance from the candidate entity are screened in the preset knowledge graph, relationship information between the candidate nodes and the candidate entity is extracted in the preset knowledge graph, a knowledge subgraph corresponding to the candidate entity is constructed based on the relationship information, the candidate entity and the candidate nodes, the candidate entity and the candidate nodes in the knowledge subgraph are used as nodes, and association information between the nodes in the knowledge subgraph is identified, a graph network corresponding to the knowledge subgraph is created based on the nodes and the association information, and graph topology structure information is extracted in the graph network. Node information of each node in the knowledge subgraph and edge information between the nodes are extracted in the graph topology structure information, semantic feature extraction is performed on the node information to obtain node features, semantic feature extraction is performed on the edge information to obtain edge features, the node features and the edge features are fused to obtain graph feature corresponding to the candidate entity. Entity dimension information of the entity text features and graph dimension information of the graph feature are obtained, the tensor fusion parameters are determined based on the entity dimension information and the graph dimension information, the tensor fusion parameters, the entity text features and the graph feature are fused to obtain initial fused tensor features, preset bias information is obtained, and the preset bias information is added to the initial fused tensor features to obtain fused tensor features. The associated features are extracted in the fused tensor features by using the trained entity detection model, the association relationship between the to-be-linked entity and the candidate entity is determined based on the associated features, the candidate entity having the same entity as the association relationship is screened from the candidate entity to obtain a target entity corresponding to the to-be-linked entity, the to-be-linked entity and the target entity are associated, or the entity identifier information of the target entity can also be obtained, and the entity identifier information is added to the entity information of the to-be-linked entity to link the to-be-linked entity and the target entity.
[0175] The specific implementation of each operation can refer to the foregoing embodiments, which will not be repeated here.
[0176] From the above, the embodiment of the present application obtains the entity information of the entity to be linked, extracts the entity text features in the entity information, screens the knowledge sub-graph corresponding to each candidate entity in the preset knowledge graph, identifies the graph topology structure information in the knowledge sub-graph, extracts the graph features corresponding to the candidate entity in the graph topology structure information, fuses the entity text features and the graph features, obtains the fused tensor features, screens the target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and links the entity to be linked to the target entity. Since the scheme can identify the graph topology structure information in the knowledge sub-graph, extract the graph features from the graph topology structure information, and make the extracted graph features contain the graph topology information in the knowledge sub-graph, the accuracy of the graph features is improved, and thus the accuracy of the entity linking is improved.
[0177] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or controlled by instructions related to hardware, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0178] Therefore, the embodiment of the present application provides a computer readable storage medium, which stores a plurality of instructions capable of being loaded by a processor to execute the steps in any one of the entity linking methods provided by the embodiment of the present application. For example, the instructions can execute the following steps:
[0179] Obtain the entity information of the entity to be linked, extract the entity text features in the entity information, screen the knowledge sub-graph corresponding to each candidate entity in the preset knowledge graph, identify the graph topology structure information in the knowledge sub-graph, extract the graph features corresponding to the candidate entity in the graph topology structure information, fuse the entity text features and the graph features, obtain the fused tensor features, screen the target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and link the entity to be linked to the target entity.
[0180] For example, the entity information of the entity to be linked uploaded by the user through the terminal is acquired, or the text content can also be acquired, at least one entity to be linked is identified in the text content, and the entity information corresponding to the entity to be linked is extracted in the text content. The text feature extraction network of the trained entity detection model is used to perform feature extraction on the text information and the entity object information respectively to obtain text features corresponding to the text information and entity object features corresponding to the entity object information. The text features and the entity object features are fused to obtain fused text features, text classification features are screened out in the fused text features, and the text classification features are taken as entity text features. At least one candidate entity is identified in the preset knowledge graph, candidate nodes existing at a preset distance from the candidate entity are screened out in the preset knowledge graph, relationship information between the candidate nodes and the candidate entity is extracted in the preset knowledge graph, a knowledge subgraph corresponding to the candidate entity is constructed based on the relationship information, the candidate entity and the candidate nodes, the candidate entity and the candidate nodes in the knowledge subgraph are taken as nodes, and association information between the nodes is identified in the knowledge subgraph. The graph network corresponding to the knowledge subgraph is created based on the nodes and the association information, and graph topology structure information is extracted in the graph network. The node information of each node in the knowledge subgraph and the edge information between the nodes are extracted in the graph topology structure information, semantic feature extraction is performed on the node information to obtain node features, semantic feature extraction is performed on the edge information to obtain edge features, the node features and the edge features are fused to obtain graph feature corresponding to the candidate entity. The entity dimension information of the entity text features and the graph dimension information of the graph features are acquired, the tensor fusion parameters are determined based on the entity dimension information and the graph dimension information, the tensor fusion parameters, the entity text features and the graph features are fused to obtain initial fused tensor features, the preset bias information is acquired, and the preset bias information is added to the initial fused tensor features to obtain fused tensor features. The association features are extracted in the fused tensor features by using the trained entity detection model, the association relationship between the entity to be linked and the candidate entity is determined based on the association features, the candidate entity with the same entity in the association relationship is screened out in the candidate entity to obtain the target entity corresponding to the entity to be linked, the association between the entity to be linked and the target entity is linked, or the entity identifier information of the target entity can also be acquired, and the entity identifier information is added to the entity information of the entity to be linked based on the entity identifier information to link the entity to be linked and the target entity.
[0181] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here.
[0182] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0183] Since the instructions stored in the computer readable storage medium can execute the steps in any of the entity linking methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the entity linking methods provided by the embodiments of the present application can be achieved. For details, refer to the foregoing embodiments, which will not be repeated here.
[0184] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in any of the various optional implementations of the entity linking aspect or the entity chain aspect.
[0185] The above describes in detail the entity linking method, device, electronic device and computer readable storage medium provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for linking entities, characterized in that, include: Obtain the entity information of the entity to be linked, and extract the entity text features from the entity information; The step of obtaining the entity information of the entity to be linked includes: Obtain text content, identify at least one entity to be linked in the text content, and extract entity information corresponding to each entity to be linked from the text content; In the preset knowledge graph, a knowledge subgraph corresponding to each candidate entity is selected, and graph topology information is identified in the knowledge subgraph. The graph topology information is used to indicate the structural information between nodes in the knowledge subgraph. Extracting the graph features corresponding to the candidate entities from the graph topology information includes: The node information of each node and the edge information between the nodes are extracted from the graph topology information. Semantic features are extracted from the node information and edge information to obtain the graph features corresponding to the candidate entity; the entity text features and graph features are fused to obtain the fused tensor features. Based on the fused tensor features, a target entity corresponding to the entity to be linked is selected from the candidate entities, and the entity to be linked is linked to the target entity. The association between the target entity and the entity to be linked is that they are the same entity.
2. The entity linking method according to claim 1, characterized in that, The step of extracting features from the node information and edge information to obtain the graph features corresponding to the candidate entity includes: Semantic features are extracted from the node information to obtain node features, and semantic features are extracted from the edge information to obtain edge features; The node features and edge features are fused to obtain the graph features corresponding to the candidate entity.
3. The entity linking method according to claim 2, characterized in that, The process of fusing the node features and edge features to obtain the graph features corresponding to the candidate entity includes: The node features are subjected to average pooling to obtain pooled node features; The edge features are subjected to average pooling to obtain pooled edge features; The pooled node features and pooled edge features are fused to obtain the graph features corresponding to the candidate entity.
4. The entity linking method according to any one of claims 1 to 3, characterized in that, The process of fusing the entity text features and graph features to obtain the fused tensor features includes: Obtain the entity dimension information of the entity text features and the graph dimension information of the graph features; Based on the entity dimension information and the graph dimension information, the tensor fusion parameters are determined; Based on the tensor fusion parameters, the entity text features and the graph features are fused using tensors to obtain the fused tensor features.
5. The entity linking method according to claim 2, characterized in that, The step of determining tensor fusion parameters based on the entity dimension information and the graph dimension information includes: Obtain preset output parameters during the tensor fusion process, and extract output dimension information from the preset output parameters; The output dimension information, entity dimension information, and graph dimension information are fused to obtain tensor fusion dimension information; Based on the tensor fusion dimension information, tensor fusion parameters are constructed in the tensor fusion process.
6. The entity linking method according to claim 4, characterized in that, The step of performing tensor fusion on the entity text features and graph features according to the tensor fusion parameters to obtain fused tensor features includes: The tensor fusion parameters, entity text features, and graph features are fused to obtain the initial fused tensor features; Obtain preset bias information and add the preset bias information to the initial fused tensor feature to obtain the fused tensor feature.
7. The entity linking method according to any one of claims 1 to 3, characterized in that, The step of filtering out the target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features includes: The trained entity detection model is used to extract association features from the fused tensor features. The association features are used to indicate the association relationship between the entity to be linked and the candidate entity. Based on the association features, the association relationship between the entity to be linked and the candidate entity is determined; Candidate entities that are related to the same entity are selected from the candidate entities to obtain the target entity corresponding to the entity to be linked.
8. The entity linking method according to claim 7, characterized in that, Before the trained entity detection model extracts the association features from the fused tensor features, the method further includes: Obtain entity sample information, which includes sample entity information of the sample entity, sub-graph information of the candidate sample entity, and annotation association relationship between the sample entity and the candidate sample entity; Based on the sample entity information and sub-map information, a preset entity detection model is used to predict the association relationship between the sample entity and the candidate sample entity, and the predicted association relationship is obtained. Based on the predicted and labeled associations, the preset entity detection model is converged to obtain the trained entity detection model.
9. The entity linking method according to any one of claims 1 to 3, characterized in that, The step of filtering out the knowledge sub-graph corresponding to each candidate entity from the preset knowledge graph includes: Identify at least one candidate entity in a preset knowledge graph, and filter out candidate nodes that have a preset distance from the candidate entity in the preset knowledge graph; The relationship information between the candidate nodes and the candidate entities is extracted from the preset knowledge graph. Based on the relationship information, candidate entities, and candidate nodes, knowledge corresponding to the candidate entities is constructed.
10. The entity linking method according to claim 9, characterized in that, The process of identifying graph topology information in the knowledge subgraph includes: The candidate entities and candidate nodes in the knowledge subgraph are used as nodes, and the association information between the nodes is identified in the knowledge subgraph. Based on the nodes and association information, a graph network corresponding to the knowledge subgraph is created, and graph topology information is extracted from the graph network.
11. The entity linking method according to any one of claims 1 to 3, characterized in that, The entity information includes text information and entity object information. Extracting entity text features from the entity information includes: Text features are extracted from text information and entity object information to obtain the text features corresponding to the text information and the entity object features corresponding to the entity object information; The text features and entity object features are fused to obtain the fused text features; Text classification features are selected from the fused text features and used as the entity text features.
12. The entity linking method according to any one of claims 1 to 3, characterized in that, After linking the entity to be linked to the target entity, the method further includes: The target knowledge subgraph is obtained by filtering out the target entity's knowledge subgraph from the knowledge subgraph. Identify the current entity information of the target entity in the target knowledge sub-graph; Based on the current entity information, the entity information of the entity to be linked is updated to obtain the updated entity information.
13. A physical linking device, characterized in that, include: The acquisition unit is used to acquire entity information of the entity to be linked and extract entity text features from the entity information; The step of obtaining the entity information of the entity to be linked includes: Obtain text content, identify at least one entity to be linked in the text content, and extract entity information corresponding to each entity to be linked from the text content; The identification unit is used to filter out the knowledge subgraph corresponding to each candidate entity in the preset knowledge graph, and identify the graph topology information in the knowledge subgraph, wherein the graph topology information is used to indicate the structural information between nodes in the knowledge subgraph. The extraction unit is used to extract the graph features corresponding to the candidate entities from the graph topology information, including: The node information of each node and the edge information between the nodes are extracted from the graph topology information. Semantic features are extracted from the node information and edge information to obtain the graph features corresponding to the candidate entities; The fusion unit is used to fuse the entity text features and graph features to obtain fused tensor features; The linking unit is used to filter out the target entity corresponding to the entity to be linked from the candidate entities based on the fused tensor features, and link the entity to be linked to the target entity, wherein the association between the target entity and the entity to be linked is that they are the same entity.
14. An electronic device, characterized in that, It includes a processor and a memory, the memory storing an application program, and the processor running the application program within the memory to perform the steps in the entity linking method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the entity linking method according to any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the entity linking method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Data processing method and device, equipment, storage medium and computer program product
CN113641797A
Retrieval method and device based on knowledge graph, electronic equipment and storage medium
CN113761219A