Entity linking method and system based on dynamic time steps
By constructing a mapping entity association graph through dynamic time steps and extracting global topic consistency features using graph neural networks and self-attention mechanisms, the problems of naming diversity and ambiguity in entity links are solved, and the accuracy of entity links is improved.
Patent Information
- Application Number
- CN202211054245.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-08-30
AI Technical Summary
Existing technologies struggle to effectively address naming diversity and entity ambiguity in entity linking tasks, particularly in determining global topical consistency among entity mentions within the same document to achieve correct entity linking.
A dynamic time-step approach is used to construct a mapping entity association graph. In each time step, candidate entities related to the topic are selected as mapping entities. Global topic consistency features are extracted through graph neural networks and self-attention mechanisms, thereby improving the accuracy of entity linking.
By using a dynamic time step approach, we can more accurately select mapping entities that are relevant to the topic, improve the accuracy of entity linking, and ensure the correct matching of entity mentions with entities in the knowledge base.
Smart Images

Figure CN115392463B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and particularly relates to an entity linking method and system based on dynamic time steps. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art known to those skilled in the art.
[0003] Entity linking is a task in natural language processing, which links the entity mentions in the network text to the corresponding entities in the knowledge base. The biggest challenge in the entity linking task is how to solve the diversity of names and the ambiguity of entities. For example, when we talk about apples, sometimes we mean the fruit apple, and sometimes we mean the company apple. In a text, we cannot judge the ambiguity of the entity mention by the surface meaning of the entity mention. Only by modeling the current context or the entire document can we judge the ambiguity of the entity mention. Therefore, more and more entity linking tasks consider the global theme consistency between entity mentions in the same document. However, how to determine the global theme consistency between entity mentions to correctly link the entity mentions to the entities in the knowledge base is still a problem to be solved. SUMMARY
[0004] In order to solve the above problems, the present application provides an entity linking method and system based on dynamic time steps, which uses a dynamic time step method to construct a mapping entity association graph. In each time step, a candidate entity related to the theme is selected as a mapping entity of the mapping entity association graph to extract correct global theme consistency features from the mapping entity association graph, thereby improving the accuracy of entity linking.
[0005] In order to achieve the above purpose, the present application mainly includes the following aspects:
[0006] In a first aspect, the present application provides an entity linking method based on dynamic time steps, comprising:
[0007] Obtaining a plurality of entity mentions related to a theme in a document to be analyzed;
[0008] Obtaining candidate entities of each entity mention from a knowledge base, using a dynamic time step method to construct a mapping entity association graph, and extracting global theme consistency features from the mapping entity association graph; wherein the mapping entity association graph comprises a plurality of interconnected mapping entities; in each time step, selecting a target candidate entity related to the theme from the candidate entities of the entity mention as a mapping entity;
[0009] According to the global theme consistency feature, a target entity mentioned by each entity is obtained from the candidate entity, and each entity mention is associated with the corresponding target entity.
[0010] In a possible implementation, before the obtaining of the plurality of entity mentions in the document to be analyzed, the method further includes: obtaining a first representation vector corresponding to the document to be analyzed, and a second representation vector corresponding to each entity mention in the document to be analyzed; and determining the plurality of entity mentions of the associated theme in the document to be analyzed according to a cosine similarity between the first representation vector and the second representation vector.
[0011] In a possible implementation, the method for constructing the mapping entity association graph includes:
[0012] The prior probability corresponding to the candidate entity is obtained, and a first target candidate entity with the maximum prior probability in the candidate entity is selected as the mapping entity of the mapping entity association graph; wherein the prior probability is pre-stored, and the candidate entity and the prior probability correspond to each other;
[0013] At the time step, the mapping entity association graph is input into a graph neural network to output a corresponding theme vector, and a target entity mention at the current time step is selected without replacement from a plurality of entity mentions except for the entity mention in which the first target candidate entity is located, a second target candidate entity is selected as the mapping entity of the mapping entity association graph from candidate entities of the target entity mention according to the theme vector, the mapping entities in the mapping entity association graph are connected to each other, and the mapping entity association graph is updated.
[0014] The above process is repeated until there is no target entity mention in the entity mention.
[0015] In a possible implementation, the graph neural network obtains a representation of each mapping entity in the mapping entity association graph, and adds the representation of each mapping entity to obtain the theme vector.
[0016] In a possible implementation, the selecting of the second candidate entity as the mapping entity of the mapping entity association graph from the candidate entities of the target entity mention according to the theme vector includes:
[0017] A representation vector corresponding to the candidate entity of the target entity mention is obtained.
[0018] A cosine similarity between the theme vector and the representation vector corresponding to each candidate entity is calculated to obtain a similarity score of each candidate entity.
[0019] The second candidate entity with the highest similarity score is selected from the candidate entities as the mapping entity of the mapping entity association graph.
[0020] In a possible implementation, the extracting the global topic consistency feature from the mapping entity association graph comprises:
[0021] The representation vectors of the mapping entities in the mapping entity association graph are obtained, and a splicing operation is performed to obtain a matrix of a specific dimension; the obtained matrix is input into a multi-head self-attention mechanism to output a new tensor; and the global topic consistency feature of the to-be-analyzed document is determined according to the new tensor.
[0022] In a possible implementation, the target entity mentioned by each entity mention in the to-be-analyzed document is determined according to the similarity between the global topic consistency feature and the candidate entity.
[0023] In a second aspect, an embodiment of the present application provides an entity linking system based on dynamic time steps, comprising:
[0024] An acquisition module is configured to acquire a plurality of entity mentions of an associated topic in a to-be-analyzed document.
[0025] A feature extraction module is configured to acquire candidate entities of each entity mention from a knowledge base, construct a mapping entity association graph by using a dynamic time step method, and extract a global topic consistency feature from the mapping entity association graph; wherein the mapping entity association graph comprises a plurality of connected mapping entities; and in each time step, a target candidate entity related to the topic is selected from the candidate entities of the entity mention as a mapping entity.
[0026] An entity linking module is configured to acquire a target entity of each entity mention from the candidate entities according to the global topic consistency feature, and associate each entity mention with the corresponding target entity.
[0027] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, and the machine readable instructions are executed by the processor to perform the steps of the entity linking method based on dynamic time steps as described in the first aspect and any possible implementation of the first aspect.
[0028] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the entity linking method based on dynamic time steps as described in the first aspect and any possible implementation of the first aspect.
[0029] Based on the above technical solutions, the present application has the following advantages:
[0030] The application proposes a method of constructing a mapping entity correlation graph by using dynamic time steps. In each time step, candidate entities related to a theme are selected as mapping entities of the mapping entity correlation graph, correct global theme consistency features are extracted from the mapping entity correlation graph, and target entities mentioned by each entity are obtained from the candidate entities according to the global theme consistency features, so that the precision of entity linking can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0031] The accompanying drawings, which form a part of this specification, are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification. The embodiments of these drawings are set to explain the application, and do not constitute an improper limitation on the application.
[0032] Figure 1 is a flowchart of the entity linking method based on dynamic time steps provided by the embodiment one of the application;
[0033] Figure 2 is a flowchart of the dynamic time step for obtaining global theme consistency features of the document to be analyzed provided by the embodiment one of the application. DETAILED DESCRIPTION
[0034] The application will be further described below in conjunction with the drawings and embodiments.
[0035] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs.
[0036] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a feature, step, operation, device, component and / or combination thereof.
[0037] Embodiment one
[0038] Global theme consistency is based on the assumption that entity mentions appearing in the same document at the same time are usually locally coherent entities. Global theme consistency extraction is divided into three steps: the first step is to select entity mentions of the same theme; the second step is to select entities that may be related to the theme as mapping entities from candidate entities under the currently selected entity mentions; and the third step is to calculate each candidate entity with each mapping entity to obtain global consistency features of the candidate entity.
[0039] In order to correctly link entity references in the text to entities in the knowledge base, the following problems need to be solved in this process: (1) how to determine entity references in the same document that are related to the current topic; (2) how to select the mapping entity from the candidate entities of entity references; (3) how to use the obtained topic vector to calculate the global score of each candidate entity.
[0040] This invention employs a dynamic time-step method to construct the mapping entity association graph. Dynamic time-step refers to using a dynamic method to select candidate entities that may be relevant to the topic as mapping entities at each step. The advantage of this dynamic approach is that after each step through the graph neural network, mapping entities more relevant to the current topic can be selected.
[0041] Please see Figure 1 This invention provides an entity linking method based on dynamic time steps, specifically including the following steps:
[0042] S101: Obtain multiple entity mentions of related topics in the document to be analyzed.
[0043] In practice, the input document D to be analyzed is obtained. After removing stop words from document D, each remaining word is embedded to obtain the embedding vector of each word in the same embedding space. The embedding of the entire document D is used as the input to BERT, which stands for Bidirectional Encoder Representation from Transformers. The [CLS] vector from the output of BERT is used as the first representation vector of document D.
[0044] Extract entity mentions from document D to be analyzed, and obtain the second representation vector corresponding to each entity mention. Based on the cosine similarity between the first and second representation vectors, determine multiple entity mentions related to the topic in document D. Specifically, calculate the cosine similarity between the first representation vector and the representation vector of each entity mention in document D to obtain the similarity score between each entity mention and the entire document D. A similarity threshold is manually set. If the similarity score is higher than the threshold, it is determined that the entity mention is related to the current topic, and the entity mention is added to a set M, M = {m1, m2, m3, ..., m...}. n}, where m represents entity mentions and n represents the number of entity mentions.
[0045] S102: Obtain candidate entities of each entity mention from the knowledge base, construct a mapping entity correlation graph using a dynamic time step method, and extract global topic consistency features from the mapping entity correlation graph; wherein the mapping entity correlation graph comprises a plurality of interconnected mapping entities; in each time step, select a target candidate entity related to the topic from the candidate entities of the entity mention as a mapping entity.
[0046] In a specific implementation, as shown in Figure 2 , it is assumed that there are 4 entity mentions in the set M, i.e. n = 4, and each entity mention has 3 candidate entities. The mapping entity correlation graph for extracting global topic consistency features is constructed by the following steps:
[0047] Step 1021: Obtain the prior probability corresponding to the candidate entity, and select the first target candidate entity with the highest prior probability as the mapping entity (i.e. node) of the mapping entity correlation graph; wherein the prior probability is pre-stored, and the candidate entity and the prior probability are one-to-one corresponding.
[0048] In a specific implementation, the prior probability can be obtained according to historical experience. For example, when we ask "How tall is Yao Ming?", the probability is that we are asking about <basketball player Yao Ming>, not other unknown "Yao Ming". Although the context does not contain the information of basketball player at all, in most cases, according to the highest prior probability from "Yao Ming" to <basketball player Yao Ming>, selecting it as the entity for query will be a good answer.
[0049] In order to avoid selecting the candidate entity of the same entity mention as the mapping entity, which affects the accuracy of subsequent global topic consistency feature extraction, the feature mention in which the first target candidate entity is located is removed, such as the first target candidate entity being Here, * represents the *th candidate entity of the candidate entity m1.
[0050] Step 1022: Enter the time step, input the mapping entity correlation graph into the graph neural network to output the corresponding topic vector, and select the target entity mention of the current time step from the plurality of entity mentions without replacement except the entity mention in which the first target candidate entity is located, select the second target candidate entity from the candidate entities of the target entity mention according to the topic vector as the mapping entity of the mapping entity correlation graph, connect the mapping entities in the mapping entity correlation graph to each other, and update the mapping entity correlation graph.
[0051] In a specific implementation, at the first time step, the obtained mapping entity association graph is taken as input, a representation of each node of the current mapping entity association graph is obtained using a graph convolutional network (GCN), and then the representations of each node are added to obtain a topic vector of the current time step graph. A cosine similarity calculation is performed between the obtained topic vector and the representation vector of each candidate entity mentioned by the next target entity in the set M to obtain a similarity score of each candidate entity, and the second candidate entity with the highest similarity score is selected as the mapping entity mentioned by the target entity. Here, the target entity mention at the current time step can be selected according to the arrangement order of the entity mentions in the set M, for example, at the first time step, the entity mention m2 is selected as the target entity mention, and the candidate entities of m2 are and The cosine similarity between the topic vector v1 and each candidate entity of m2 is calculated, and the candidate entity with the highest similarity score is taken as the mapping entity. Similarly, the entity mention in which the second candidate entity is located is removed from the entity mention set M of the current document.
[0052] The mapping entity is inserted into the mapping entity association graph as a new node, and the new node is connected to each of the previous nodes to form a new mapping entity association graph, and the next time step is entered.
[0053] Step 1023: repeat the above process until there is no target entity mention in the entity mention.
[0054] Optionally, the extracting the global topic consistency feature from the mapping entity association graph comprises:
[0055] The representation vectors of the mapping entities in the mapping entity association graph are obtained and are subjected to a splicing operation to obtain a matrix of a specific dimension; the obtained matrix is input into a multi-head self-attention mechanism to output a new tensor; and the global topic consistency feature of the document to be analyzed is determined according to the new tensor.
[0056] In a specific implementation, the representation vectors of all nodes (mapping entities) are subjected to a splicing operation to obtain a matrix of nxd dimensions. n is the number of nodes in the graph, and d is the embedding dimension. The multi-head self-attention mechanism is used, the input is the current spliced matrix, and the output is a tensor of n×h×d, where h is the number of heads of the multi-head attention.
[0057] For the new tensor, the maximum value in the second dimension is taken, that is, a new matrix nxd is obtained, and the final global topic consistency feature vector of the current document D is obtained by adding the rows.
[0058] S103: obtaining a target entity of each entity mention from the candidate entities according to the global topic consistency feature, and associating each entity mention with the corresponding target entity. Optionally, the target entity of each entity mention in the document to be analyzed is determined according to the similarity of the global topic consistency feature and the candidate entity.
[0059] In a specific implementation, the obtained global topic consistency feature vector is subjected to cosine similarity calculation with the embedding vector of each candidate entity of each entity mention in the current document D, to obtain a similarity score of each candidate entity, and the candidate entity with the largest similarity score is selected as the final target entity of the entity mention.
[0060] Embodiment Two
[0061] The embodiment also provides an entity linking system based on dynamic time steps, comprising:
[0062] An acquisition module is configured to acquire a plurality of entity mentions of an associated topic in a document to be analyzed.
[0063] A feature extraction module is configured to acquire candidate entities of each entity mention from a knowledge base, construct a mapping entity association graph by using a dynamic time step method, and extract a global topic consistency feature from the mapping entity association graph. The mapping entity association graph comprises a plurality of mapping entities connected to each other, and in each time step, a target candidate entity related to the topic is selected from the candidate entities of each entity mention as a mapping entity.
[0064] An entity linking module is configured to obtain a target entity of each entity mention from the candidate entities according to the global topic consistency feature, and associate each entity mention with the corresponding target entity.
[0065] The entity linking system based on dynamic time steps provided by the embodiment is used to implement the aforementioned entity linking method based on dynamic time steps, and thus the specific implementation of the entity linking system based on dynamic time steps can be seen in the embodiment part of the entity linking method based on dynamic time steps in the foregoing, which will not be described here again.
[0066] Embodiment Three
[0067] The embodiment of the present application also provides a computer device, which comprises a processor, a memory and a bus.
[0068] The memory stores machine readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus. When the machine readable instructions are executed by the processor, the above-mentioned Figure 1 and Figure 2The steps of the entity linking method based on dynamic time steps in the method embodiments are specifically implemented as described in the method embodiments, which will not be repeated here.
[0069] Embodiment Four
[0070] Based on the same inventive concept, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the entity linking method based on dynamic time steps described in the above method embodiments are executed.
[0071] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiments of the method can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc.
[0072] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A dynamic time step based entity linking method, characterized in that, The method comprises the following steps: obtaining a plurality of entity mentions of a related topic in a document to be analyzed; obtaining candidate entities of each entity mention from a knowledge base, constructing a mapping entity association graph by using a dynamic time step method, and extracting global topic consistency features from the mapping entity association graph; wherein the mapping entity association graph comprises a plurality of interconnected mapping entities; in each time step, selecting a target candidate entity related to the topic from the candidate entities of the entity mention as a mapping entity; the method for constructing the mapping entity association graph comprises: obtaining a prior probability corresponding to each candidate entity, and selecting a first target candidate entity with the maximum prior probability from the candidate entities as a mapping entity of the mapping entity association graph; wherein the prior probability is pre-stored, and each candidate entity corresponds to a prior probability; entering a time step, inputting the mapping entity association graph into a graph neural network to output a corresponding topic vector, and selecting a target entity mention of the current time step from a plurality of entity mentions excluding the entity mention where the first target candidate entity is located, selecting a second target candidate entity from the candidate entities of the target entity mention according to the topic vector as a mapping entity of the mapping entity association graph, connecting the mapping entities in the mapping entity association graph to each other, and updating the mapping entity association graph; repeating the above process until there is no target entity mention in the entity mention; obtaining a target entity of each entity mention from the candidate entities according to the global topic consistency features, and associating each entity mention with the corresponding target entity.
2. The dynamic time step based entity linking method of claim 1, wherein, Before the step of obtaining a plurality of entity mentions of a related topic in a document to be analyzed, the method further comprises the steps of: obtaining a first representation vector corresponding to the document to be analyzed, and a second representation vector corresponding to each entity mention in the document to be analyzed; and determining the plurality of entity mentions of the related topic in the document to be analyzed according to the cosine similarity between the first representation vector and the second representation vector. 3.The dynamic time step based entity linking method of claim 1, wherein, The graph neural network obtains a representation of each mapping entity in the mapping entity association graph, and adds the representations of each mapping entity to obtain a topic vector.
4. The dynamic time step based entity linking method of claim 1, wherein, The step of selecting a second candidate entity from the candidate entities of the target entity mention as a mapping entity of the mapping entity association graph according to the topic vector comprises the steps of: obtaining a representation vector corresponding to each candidate entity of the target entity mention; calculating the cosine similarity between the topic vector and the representation vector corresponding to each candidate entity to obtain a similarity score of each candidate entity; selecting a second candidate entity with the highest similarity score from the candidate entities as a mapping entity of the mapping entity association graph.
5. The dynamic time step based entity linking method of claim 1, wherein, The step of extracting global topic consistency features from the mapping entity association graph comprises the steps of: obtaining a representation vector of each mapping entity in the mapping entity association graph, and performing a splicing operation to obtain a matrix of a specific dimension; inputting the obtained matrix into a multi-head self-attention mechanism to output a new tensor; and determining the global topic consistency features of the document to be analyzed according to the new tensor.
6. The dynamic time step based entity linking method of claim 1, wherein, Determine the target entity of each entity mention in the document to be analyzed according to the similarity between the global topic consistency features and the candidate entities.
7. A dynamic time step based entity linking system, characterized in that, The method comprises the following steps: An acquisition module is configured to acquire a plurality of entity mentions of an associated topic in a document to be analyzed; A feature extraction module is configured to acquire candidate entities of each entity mention from a knowledge base, construct a mapping entity association graph by using a dynamic time step method, and extract global topic consistency features from the mapping entity association graph; wherein the mapping entity association graph comprises a plurality of interconnected mapping entities; in each time step, a target candidate entity related to the topic is selected from the candidate entities of the entity mention as a mapping entity. The method for constructing the mapping entity association graph comprises: acquiring a prior probability corresponding to each candidate entity, and selecting a first target candidate entity with the maximum prior probability as a mapping entity of the mapping entity association graph; wherein the prior probability is pre-stored, and each candidate entity corresponds to a prior probability; in a time step, inputting the mapping entity association graph into a graph neural network to output a corresponding topic vector, and selecting a target entity mention of the current time step from a plurality of entity mentions excluding the entity mention where the first target candidate entity is located, selecting a second target candidate entity from the candidate entities of the target entity mention according to the topic vector as a mapping entity of the mapping entity association graph, connecting the mapping entities in the mapping entity association graph to each other, and updating the mapping entity association graph; repeating the above process until there is no target entity mention in the entity mention; An entity linking module is configured to acquire a target entity of each entity mention from the candidate entities according to the global topic consistency features, and associate each entity mention with the corresponding target entity.
8. A computer device, comprising: It comprises: a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, the machine readable instructions are executed by the processor to execute the steps of the dynamic time step based entity linking method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to execute the steps of the dynamic time step based entity linking method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Machine-generated text detection method based on self-information loss compensation
CN112580351A
Knowledge graph embedding model based on entity-relation association graph
CN113220897A