An entity linking method, device, storage medium and electronic device

By using a pre-trained entity linking model and fine-grained interaction feature representation and decision layer to determine the target linking entity, the problem of low entity linking efficiency in existing technologies is solved, and a more efficient entity linking process is achieved.

CN117171346BActive Publication Date: 2026-03-31ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing entity linking methods cannot store entity vector representations offline due to their intensive interaction methods, and online inference is time-consuming, affecting efficiency.

Method used

A pre-trained entity linking model is used to determine the similarity and difference between the feature representations of candidate entities and the text to be linked through fine-grained interaction feature representation. Combined with the decision layer, the probability of the target linked entity is determined, thereby improving the efficiency of entity linking.

Benefits of technology

While preserving fine-grained information in the text to be linked and the description text of candidate entities, it improves the efficiency of entity linking and reduces inference time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171346B_ABST
    Figure CN117171346B_ABST
Patent Text Reader

Abstract

The specification discloses an entity linking method, device, storage medium and electronic equipment. The entity linking method comprises: obtaining to-be-linked text, each entity mention contained in the to-be-linked text, determining a candidate entity corresponding to each entity mention contained in the to-be-linked text according to a pre-determined mapping relationship table between entity mentions and entities, inputting the to-be-linked text, each entity mention contained in the to-be-linked text and a pre-set description text of the candidate entity into a pre-trained entity linking model, determining a fine-grained interaction feature representation between a feature representation of the description text of each candidate entity and a feature representation of the to-be-linked text through the entity linking model, determining a probability that each candidate entity is a target linking entity, determining a target linking entity corresponding to the to-be-linked text from each candidate entity according to the probability, and performing a task according to the target linking entity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of natural language processing technology, and in particular to an entity linking method, apparatus, storage medium, and electronic device. Background Technology

[0002] With the development of natural language processing technology, entity linking has been widely used in tasks such as search engines, question answering, and knowledge graphs. The goal of entity linking is to associate entity references in the text to be linked with entities contained in a pre-defined knowledge base.

[0003] Typically, entity linking uses text-based matching methods. This involves determining the text similarity between the text to be linked and the entity descriptions mentioned in a pre-defined knowledge base, and then identifying the entities that the text to be linked can link to based on this similarity. Current entity linking methods often concatenate the text to be linked and the entity descriptions, using both as input to the encoding layer of a neural network model. This allows for the acquisition of fine-grained interaction information between the two texts at the interaction layer of the neural network model. However, this dense interaction approach makes it impossible to store entity vector representations offline, and online inference is time-consuming.

[0004] Therefore, how to improve the efficiency of entity links is an urgent problem to be solved. Summary of the Invention

[0005] This specification provides a physical linking method, apparatus, storage medium, and electronic device to partially solve the aforementioned problems existing in the prior art.

[0006] The following technical solution is adopted in this specification:

[0007] This specification provides a method for entity linking, including:

[0008] Get the text to be linked and the entity references contained in the text to be linked;

[0009] Based on a pre-determined mapping table between entity mentions and entities, determine the candidate entity corresponding to each entity mention contained in the text to be linked;

[0010] The text to be linked, the entity mentions contained in the text to be linked, and the pre-defined description text of the candidate entities are input into a pre-trained entity linking model to encode the text to be linked, thereby obtaining the feature representation of the text to be linked. For each candidate entity, a fine-grained interaction feature representation between the feature representation of the description text of the candidate entity and the feature representation of the text to be linked is determined, and the probability that the candidate entity is the target linking entity is determined based on the fine-grained interaction feature representation.

[0011] Based on the probability, the target link entity corresponding to the text to be linked is determined from each candidate entity, and the task is executed based on the target link entity.

[0012] Optionally, based on a pre-determined mapping table between entity mentions and entities, candidate entities corresponding to each entity mention contained in the text to be linked are determined, specifically including:

[0013] Based on a pre-determined mapping table between entity mentions and entities, entities with which each entity mention in the text to be linked has a mapping relationship are identified as first candidate entities; and

[0014] Based on the relevance between each entity mention contained in the text to be linked and the description text of each entity in the preset knowledge base, each second candidate entity is determined;

[0015] Based on the first candidate entity and the second candidate entity, determine the corresponding candidate entity for each entity mentioned in the text to be linked.

[0016] Optionally, training the entity linking model specifically includes:

[0017] Obtain the sample text set and the entity link model to be trained;

[0018] For each sample text in the sample text set, obtain the entity mentions contained in that sample text, and obtain the link entities corresponding to each entity mention in that sample text, as positive samples; and

[0019] Other entities, excluding the linked entities corresponding to the entity mentions in the sample text, are identified as negative samples in the descriptive texts that are similar to the entity mentions contained in the sample text.

[0020] The sample text, the entity mentions contained in the sample text, the description text of the positive sample, or the description text of the negative sample are input into the entity linking model to be trained, so as to encode the sample text through the entity linking model to be trained, obtain the feature representation of the sample text, and determine the sample fine-grained interaction feature representation between the feature representation of the description text of the positive sample or the negative sample and the feature representation of the sample text, and determine the probability that the positive sample or the negative sample is a linking entity of the sample text based on the sample fine-grained interaction feature representation;

[0021] The entity linking model to be trained is trained with the optimization objective of minimizing the deviation between the probability that the positive sample or the negative sample is a linking entity of the sample text and the annotation result of the positive sample or the negative sample.

[0022] Optionally, the entity linking model includes: a first feature extraction layer;

[0023] The text to be linked and the entity mentions contained in the text are input into a pre-trained entity linking model, specifically including:

[0024] The text to be linked and the entity mentions contained in the text to be linked are input into the first feature extraction layer of the entity linking model, so that the text to be linked is encoded by the first feature extraction layer to obtain the semantic feature representation of the text to be linked, and each field contained in the text to be linked is encoded by the first feature extraction layer to obtain the feature representation of each field of the text to be linked, which serves as the feature representation of each first field.

[0025] For each entity mention contained in the text to be linked, the first feature extraction layer determines the feature representation of the entity mention based on the field feature representation of the start position and the field feature representation of the end position of the entity mention in the text to be linked.

[0026] Optionally, the entity linking model includes: a second feature extraction layer;

[0027] The pre-defined descriptive text of the candidate entities is input into a pre-trained entity linking model, specifically including:

[0028] For each candidate entity, the pre-defined description text of the candidate entity is input into the second feature extraction layer of the pre-trained entity linking model, so that the description text is encoded by the second feature extraction layer to obtain the semantic feature representation of the description text, and each field contained in the description text is encoded to obtain the feature representation of each field of the description text, which serves as the feature representation of each second field.

[0029] Optionally, the entity linking model further includes: a first interaction layer and a second interaction layer;

[0030] For each candidate entity, a fine-grained interaction feature representation is determined between the feature representation of the pre-determined descriptive text of the candidate entity and the feature representation of the text to be linked, specifically including:

[0031] The first field feature representations and the second field feature representations are input into the first interaction layer to determine the similarity matrix between the first field feature representations and the second field feature representations; and

[0032] The first field feature representation and the second field feature representation are input into the second interaction layer to determine the difference matrix between the first field feature representation and the second field feature representation through the second interaction layer;

[0033] Based on the similarity matrix and the feature representations of each first field, a first fine-grained interaction feature representation of the text to be linked is determined, and based on the difference matrix and the feature representations of each first field, a second fine-grained interaction feature representation of the text to be linked is determined; and

[0034] Based on the similarity matrix and the feature representations of each second field, a first fine-grained interaction feature representation of the candidate entity is determined, and based on the difference matrix and the feature representations of each second field, a second fine-grained interaction feature representation of the candidate entity is determined.

[0035] Optionally, the entity linking model further includes: a decision layer;

[0036] The probability of determining the candidate entity as the target link entity based on the fine-grained interaction feature representation specifically includes:

[0037] The first fine-grained interaction feature representation of the text to be linked, the second fine-grained interaction feature representation of the text to be linked, the feature representation of each entity mentioned in the text to be linked, the first fine-grained interaction feature representation of the candidate entity, the second fine-grained interaction feature representation of the candidate entity, and the semantic feature representation of the description text of the candidate entity are input into the decision layer so as to determine the probability that the candidate entity is the target link entity.

[0038] This specification provides a physical linking device, including:

[0039] The acquisition module is used to acquire the text to be linked and the entity mentions contained in the text to be linked;

[0040] The filtering module is used to determine the candidate entity corresponding to each entity mention contained in the text to be linked, based on a pre-determined mapping table between entity mentions and entities.

[0041] The determination module is used to input the text to be linked, the entity mentions contained in the text to be linked, and the pre-defined description text of the candidate entities into a pre-trained entity linking model, so as to encode the text to be linked through the entity linking model to obtain the feature representation of the text to be linked, and for each candidate entity, to determine the fine-grained interaction feature representation between the feature representation of the pre-defined description text of the candidate entity and the feature representation of the text to be linked, and to determine the probability that the candidate entity is the target linking entity based on the fine-grained interaction feature representation;

[0042] The execution module is used to determine the target link entity corresponding to the text to be linked from each candidate entity according to the probability, and to perform task execution according to the target link entity.

[0043] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described entity linking method.

[0044] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-described entity linking method when executing the program.

[0045] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0046] In the entity linking method provided in this specification, the following steps are taken: First, the text to be linked and the entity mentions contained in the text are obtained. Based on a pre-determined mapping table between entity mentions and entities, candidate entities corresponding to each entity mention in the text to be linked are determined. The text to be linked, the entity mentions contained in the text, and the description text of the pre-defined candidate entities are input into a pre-trained entity linking model to encode the text to be linked, thereby obtaining the feature representation of the text to be linked. For each candidate entity, a fine-grained interaction feature representation between the feature representation of the description text of the candidate entity and the feature representation of the text to be linked is determined. Based on the fine-grained interaction feature representation, the probability that the candidate entity is the target linking entity is determined. Based on the probability, the target linking entity corresponding to the text to be linked is determined from the candidate entities, and the task is executed based on the target linking entity.

[0047] As can be seen from the above method, the entity linking model can be used to determine the fine-grained interaction feature representation between the feature representation of the candidate entity's description text and the feature representation of the text to be linked, so as to determine the probability that the candidate entity is the target linking entity. This can improve the efficiency of entity linking while preserving the fine-grained information contained in the description text of the text to be linked and the candidate entity. Attached Figure Description

[0048] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:

[0049] Figure 1 This is a flowchart illustrating one entity linking method provided in this specification;

[0050] Figure 2 This is an overall schematic diagram of the entity linking model provided in this specification;

[0051] Figure 3 This is a schematic diagram of the interaction layer provided in this specification;

[0052] Figure 4 This is a schematic diagram of the decision-making layer provided in this specification;

[0053] Figure 5 This is a schematic diagram of a physical linking device provided in this specification;

[0054] Figure 6 This specification provides a corresponding Figure 1 A schematic diagram of an electronic device. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0056] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0057] The goal of entity linking is to establish a correspondence between entities mentioned in text and entities stored in a knowledge base. Entity linking often involves multiple synonyms and polysemy, meaning that the same entity may correspond to multiple different entity mentions, and the same entity mention may correspond to different entities. The information used to distinguish between these multiple synonyms and polysemy usually appears in both the context of the text to be linked and the descriptive text of the entities stored in the knowledge base. Therefore, when performing entity linking on the text to be linked, it is often necessary to rely on fine-grained interaction information between the text to be linked and the descriptive text of the entities stored in the knowledge base.

[0058] Based on this, this specification provides a method for entity linking, such as... Figure 1 As shown.

[0059] Figure 1 This is a flowchart illustrating one entity linking method provided in this specification, including the following steps:

[0060] S101: Obtain the text to be linked and the entity mentions contained in the text to be linked.

[0061] In this specification, the business platform can obtain the text to be linked input by the user, and extract the entity mentions contained in the text to be linked by the user input through a preset algorithm. Then, based on the text to be linked and the entity mentions contained in the text to be linked, the platform can determine the corresponding linked entities from the entities stored in the preset knowledge base, and perform downstream tasks based on each linked entity.

[0062] The above-mentioned preset algorithms can be selected according to actual needs, such as the Named Entity Recognition (NER) algorithm.

[0063] The downstream tasks mentioned above can include tasks such as search recommendation, question answering, and knowledge graph construction.

[0064] In this specification, the execution subject used to implement the entity linking method can refer to a designated device set up in the business platform by a server or other means, or it can refer to a terminal device such as a desktop computer or a laptop computer. For ease of description, the following description will only use the server as the execution subject as an example to illustrate the entity linking method provided in this specification.

[0065] S102: Based on a pre-determined mapping table between entity mentions and entities, determine the candidate entity corresponding to each entity mention contained in the text to be linked.

[0066] The server can pre-obtain the text to be linked for each sample, and through manual annotation, determine the correspondence between the entity mentions in each sample text and the entities stored in the knowledge base. Based on the above correspondence, a mapping table between entity mentions and entities is constructed.

[0067] Furthermore, the server can determine the candidate entity corresponding to each entity mention contained in the text to be linked based on a pre-determined mapping table between entity mentions and entities.

[0068] In practical applications, since the mapping table between entity mentions and entities is determined based on a pre-determined sample text to be linked, the candidate entities determined solely by the pre-determined mapping table are not comprehensive. Therefore, the server can also use entities with mapping relationships between each entity mention in the text to be linked, determined based on the pre-determined mapping table, as first candidate entities. Furthermore, it can use a pre-determined best matching algorithm (Okapi Best Matching 25, BM25) to determine second candidate entities based on the relevance between each entity mention in the text to be linked and the description text of each entity in the pre-determined knowledge base. Based on the first and second candidate entities, the server determines the candidate entity corresponding to each entity mention in the text to be linked.

[0069] S103: Input the text to be linked, the entity mentions contained in the text to be linked, and the pre-set description text of the candidate entities into a pre-trained entity linking model, so as to determine the feature representation of each entity mention contained in the text to be linked through the entity linking model, and for each candidate entity, determine the fine-grained interaction feature representation between the feature representation of the pre-determined description text of the candidate entity and the feature representation of each entity mention, and determine the probability that the candidate entity is the target linking entity based on the fine-grained interaction feature representation.

[0070] In this specification, the server can determine the target link entity corresponding to the text to be linked using the entity linking model, specifically as follows: Figure 2As shown.

[0071] Figure 2 This is a schematic diagram of the entity linking model provided in this specification.

[0072] Combination Figure 2 As can be seen, the aforementioned entity linking model can be a dual-tower model, comprising: a first feature extraction layer, a second feature extraction layer, an interaction layer, and a decision layer. Specifically, the server can input the text to be linked and the entity references contained within the text into the first feature extraction layer of the entity linking model. The first feature extraction layer encodes the text to be linked to obtain its semantic feature representation. Furthermore, the first feature extraction layer encodes each field contained in the text to be linked to obtain the feature representations of each field, which serve as the first field feature representation T. 1 .

[0073] It should be noted that the first and second feature extraction layers mentioned above can be two Bidirectional Encoder Representation from Transformers (BERT) models, and the parameters of the two models are not shared. In addition, when encoding the text to be linked, the BERT model generates a feature representation for each field of the text to be linked, and generates a semantic feature representation [cls] for the entire text to be linked, representing the overall semantics of the text to be linked.

[0074] Additionally, the server can use the first feature extraction layer to determine the feature representation v of each entity mention contained in the text to be linked, based on the field feature representations of the start and end positions of the entity mention in the text to be linked. m .

[0075] Specifically, the server can use the first feature extraction layer to concatenate the field feature representations of the starting and ending positions of the entity mention in the text to be linked with the semantic feature representation of the text to be linked for each entity mention contained in the text to be linked. The concatenated feature representation is then input into the preset Dense module in the first feature extraction layer to obtain the feature representation of the entity mention through the Dense module.

[0076] Furthermore, for each candidate entity, the server can input the pre-defined descriptive text of that candidate entity into the second feature extraction layer of the pre-trained entity linking model, so that the second feature extraction layer encodes the descriptive text to obtain the semantic feature representation v of the descriptive text. eFurthermore, each field contained in the description text is encoded to obtain the feature representation of each field of the description text, which serves as the feature representation T of each second field. 2 .

[0077] In practical applications, to improve the efficiency of online entity linking, the server can predetermine the semantic feature representation of the descriptive text of each entity in the knowledge base and the feature representation of each field in an offline manner.

[0078] Furthermore, for each candidate entity, the server can determine, based on the first field feature representation of the determined text to be linked and the second field feature representation of the candidate entity's description text, a fine-grained interaction feature representation between the feature representation of the candidate entity's description text and the feature representation of the text to be linked, specifically as follows: Figure 3 As shown.

[0079] Figure 3 This is a schematic diagram of the interaction layer provided in this specification.

[0080] Combination Figure 3 It can be seen that the server can represent each of the first field features as T 1 and the feature representation of each second field T 2 The input is fed into the first interaction layer to determine the similarity matrix between the feature representations of each first field and each feature representation of each second field. See the following formula for details:

[0081] S = T 1 *(T 2 ) T

[0082] In the above formula, S represents the feature representation of each first field. 1 and the feature representation of each second field T 2 The similarity matrix S, where each element S ij For the i-th feature of the first field and the j-th second field feature representation The inner product of.

[0083] Additionally, the server can input the feature representations of each first field and each second field into the second interaction layer to determine the difference matrix between the feature representations of each first field and each second field through the second interaction layer, as shown in the following formula.

[0084] D = M(T) 1 , (T 2 ))

[0085] In the above formula, D represents the feature representation of each first field T. 1and the feature representation of each second field T 2 The difference matrix, D, where each element D ij For the i-th feature of the first field and the j-th second field feature representation Manhattan distance.

[0086] It should be noted that, in order to prevent the above-mentioned i-th first field feature representation and the j-th second field feature representation If the inner product or Manhattan distance is too large, the server can also divide each element in the similarity matrix S and the difference matrix D by 1 / 2. Where, d k Let S be the number of columns in the similarity matrix S and the difference matrix D.

[0087] In addition, the server can divide each element in the similarity matrix S and the difference matrix D by... The values ​​are then normalized to obtain the normalized similarity matrix S and the difference matrix D.

[0088] Furthermore, the server can determine the first fine-grained interaction feature representation of the text to be linked based on the similarity matrix and the feature representations of each first field. Based on the difference matrix and the feature representations of each first field, the second fine-grained interaction feature representation of the text to be linked is determined. Furthermore, the first fine-grained interaction feature representation of the candidate entity can be determined based on the similarity matrix and the feature representations of each second field. Based on the difference matrix and the feature representations of each second field, the second fine-grained interaction feature representation of the candidate entity is determined.

[0089] Furthermore, the server can determine the probability that the candidate entity is the target link entity through the decision layer of the entity linking model, specifically as follows: Figure 4 As shown.

[0090] Figure 4 This is a schematic diagram of the decision-making layer provided in this specification.

[0091] Combination Figure 4As can be seen, the server can input the first fine-grained interaction feature representation of the text to be linked, the second fine-grained interaction feature representation of the text to be linked, the feature representation of each entity mentioned in the text to be linked, the first fine-grained interaction feature representation of the candidate entity, the second fine-grained interaction feature representation of the candidate entity, and the semantic feature representation of the candidate entity's descriptive text into the decision layer. The decision layer then transmits the concatenated feature representation of the first fine-grained interaction feature representation of the text to be linked, the second fine-grained interaction feature representation of the text to be linked, the feature representation of each entity mentioned in the text to be linked, the first fine-grained interaction feature representation of the candidate entity, the second fine-grained interaction feature representation of the candidate entity, and the semantic feature representation of the candidate entity's descriptive text to the Dense module. The probability of the candidate entity being the target linked entity is obtained by sequentially passing through the Dense module, the Dropout module, and the Sigmoid module.

[0092] It is worth noting that the aforementioned entity linking model needs to be trained before it can be deployed to the server for task execution. The training method for the entity linking model can be as follows: The server can obtain a set of sample texts and the entity linking model to be trained. For each sample text in the sample text set, the server can obtain the entity mentions contained in the sample text and the link entities corresponding to the entity mentions contained in the sample text as positive samples. The server can also determine the entities other than the link entities corresponding to the entity mentions in the description texts similar to the entity mentions contained in the sample text as negative samples. The sample text, the entity mentions contained in the sample text, and the description texts of the positive or negative samples are input into the entity linking model to be trained. The entity linking model to be trained encodes the sample text to obtain the feature representation of the sample text. The server can also determine the fine-grained interaction feature representation between the feature representation of the description text of the positive or negative sample and the feature representation of the sample text. The server can then determine the probability that the positive or negative sample is a link entity of the sample text based on the fine-grained interaction feature representation.

[0093] It should be noted that the server can determine each negative sample by using a specified algorithm to identify each entity that is similar to the entity mention and its corresponding entities as candidate negative samples. Then, other entities besides the linked entities corresponding to the entity mention can be selected from the candidate negative samples as negative samples. The specified algorithm here can be the BM25 algorithm.

[0094] As can be seen from the above, the server can improve the accuracy of the output of the trained entity linking model by using other entities that are easily confused with the linked entities mentioned by each entity as negative samples.

[0095] Furthermore, the server can train the entity linking model to be trained with the optimization objective of minimizing the deviation between the probability that a positive or negative sample is a linked entity of the sample text and the labeling results of the positive or negative sample, and obtain the trained entity linking model. For details, please refer to the following formula.

[0096] loss = -ylogp - (1-y)log(1-p)

[0097] In the above formula, y is the labeling result, and p represents the probability that the positive or negative sample output by the decision layer is a link entity of the sample text.

[0098] S104: Based on the probability, determine the target link entity corresponding to the text to be linked from each candidate entity, and perform task execution based on the target link entity.

[0099] Furthermore, the server can determine the target link entity corresponding to the text to be linked from the candidate entities based on whether the probability that each candidate entity is a target link entity that has a corresponding relationship with each entity mentioned in the text to be linked is at its maximum value or exceeds a preset threshold, and then perform task execution based on the target link entity.

[0100] As can be seen from the above method, the server can determine the fine-grained interaction feature representation between the feature representation of the candidate entity's description text and the feature representation of the text to be linked by using the first feature extraction layer and the second feature extraction layer contained in the entity linking model. This allows the server to determine the probability that the candidate entity is the target linking entity, thereby ensuring the speed of entity linking while preserving the fine-grained information contained in the description text of the text to be linked and the candidate entity.

[0101] The above describes one or more implementations of entity linking methods in this specification. Based on the same idea, this specification also provides corresponding entity linking devices, such as... Figure 5 As shown.

[0102] Figure 5 A schematic diagram of a physical linking device provided in this specification includes:

[0103] The acquisition module 501 is used to acquire the text to be linked and the entity mentions contained in the text to be linked;

[0104] The filtering module 502 is used to determine the candidate entity corresponding to each entity mention contained in the text to be linked, based on a pre-determined mapping relationship table between entity mentions and entities.

[0105] The determining module 503 is used to input the text to be linked, the entity mentions contained in the text to be linked, and the pre-set description text of the candidate entities into a pre-trained entity linking model, so as to encode the text to be linked through the entity linking model to obtain the feature representation of the text to be linked, and for each candidate entity, to determine the fine-grained interaction feature representation between the feature representation of the description text of the candidate entity and the feature representation of the text to be linked, and to determine the probability that the candidate entity is the target linking entity based on the fine-grained interaction feature representation;

[0106] The execution module 504 is used to determine the target link entity corresponding to the text to be linked from each candidate entity according to the probability, and to perform task execution according to the target link entity.

[0107] Optionally, the filtering module 502 is specifically configured to: determine, according to a pre-determined mapping relationship table between entity mentions and entities, identify entities with mapping relationships for each entity mention contained in the text to be linked as first candidate entities; determine second candidate entities based on the relevance between each entity mention contained in the text to be linked and the description text of each entity in a preset knowledge base; and determine candidate entities corresponding to each entity mention contained in the text to be linked based on the first candidate entities and the second candidate entities.

[0108] Optionally, the device further includes: a training module 505;

[0109] The training module 505 is specifically used to: acquire a sample text set and an entity linking model to be trained; for each sample text in the sample text set, acquire the entity mentions contained in the sample text and the linking entities corresponding to the entity mentions contained in the sample text, as positive samples; determine the entities other than the linking entities corresponding to the entities in the descriptive texts similar to the entity mentions contained in the sample text, as negative samples; input the sample text, the entity mentions contained in the sample text, the descriptive texts of the positive samples or the descriptive texts of the negative samples into the entity linking model to be trained, so as to pass... The sample text is encoded using the entity linking model to be trained to obtain the feature representation of the sample text. A fine-grained interaction feature representation between the feature representation of the description text of the positive sample or the negative sample and the feature representation of the sample text is determined. The probability that the positive sample or the negative sample is a linking entity of the sample text is determined based on the fine-grained interaction feature representation. The entity linking model to be trained is trained with the optimization objective of minimizing the deviation between the probability that the positive sample or the negative sample is a linking entity of the sample text and the annotation result of the positive sample or the negative sample. The trained entity linking model is then obtained.

[0110] Optionally, the entity linking model includes: a first feature extraction layer;

[0111] The determining module 503 is specifically used to: input the text to be linked and each entity mention contained in the text to the first feature extraction layer of the entity linking model, so as to encode the text to be linked through the first feature extraction layer to obtain the semantic feature representation of the text to be linked; and to encode each field contained in the text to be linked through the first feature extraction layer to obtain the feature representation of each field of the text to be linked, which serves as the first field feature representation; and to determine the feature representation of each entity mention contained in the text to be linked based on the field feature representation of the starting position and the field feature representation of the ending position of the entity mention in the text to be linked through the first feature extraction layer.

[0112] Optionally, the entity linking model includes: a second feature extraction layer;

[0113] The determining module 503 is specifically used to: input the preset description text of the candidate entity into the second feature extraction layer of the pre-trained entity linking model for each candidate entity, so as to encode the description text through the second feature extraction layer to obtain the semantic feature representation of the description text; and encode each field contained in the description text to obtain the feature representation of each field of the description text, which serves as the feature representation of each second field.

[0114] Optionally, the entity linking model further includes: a first interaction layer and a second interaction layer;

[0115] The determining module 503 is specifically configured to: input the first field feature representations and the second field feature representations into the first interaction layer to determine a similarity matrix between the first field feature representations and the second field feature representations through the first interaction layer; input the first field feature representations and the second field feature representations into the second interaction layer to determine a difference matrix between the first field feature representations and the second field feature representations through the second interaction layer; determine a first fine-grained interaction feature representation of the text to be linked based on the similarity matrix and the first field feature representations, and determine a second fine-grained interaction feature representation of the text to be linked based on the difference matrix and the first field feature representations; and determine a first fine-grained interaction feature representation of the candidate entity based on the similarity matrix and the second field feature representations, and determine a second fine-grained interaction feature representation of the candidate entity based on the difference matrix and the second field feature representations.

[0116] Optionally, the entity linking model further includes: a decision layer;

[0117] The determining module 503 is specifically used to input the first fine-grained interaction feature representation of the text to be linked, the second fine-grained interaction feature representation of the text to be linked, the feature representation of each entity mentioned in the text to be linked, the first fine-grained interaction feature representation of the candidate entity, the second fine-grained interaction feature representation of the candidate entity, and the semantic feature representation of the description text of the candidate entity into the decision layer, so as to determine the probability that the candidate entity is the target linking entity through the decision layer.

[0118] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 This provides a method for linking entities.

[0119] This instruction manual also provides Figure 6 One of the corresponding Figure 1A schematic diagram of the structure of an electronic device. (e.g.) Figure 6 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The entity linking method described above. Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0120] Improvements in a technology can be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology can now be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement in methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog are the most commonly used. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0121] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0122] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0123] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0124] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0126] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0127] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0128] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0129] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0130] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0131] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0132] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0133] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0134] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0135] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. An entity linking method, characterized by, The method comprises: obtaining a text to be linked, and each entity mention contained in the text to be linked; determining a candidate entity corresponding to each entity mention contained in the text to be linked according to a pre-determined mapping relationship table between entity mentions and entities; inputting the text to be linked, each entity mention contained in the text to be linked, and a pre-set description text of the candidate entity into a pre-trained entity linking model, to encode the text to be linked by the entity linking model, to obtain a feature representation of the text to be linked, and for each candidate entity, to determine a fine-grained interaction feature representation between the feature representation of the description text of the candidate entity and the feature representation of the text to be linked according to a first field feature representation of the text to be linked and a second field feature representation of the description text of the candidate entity, and to determine a probability that the candidate entity is a target linking entity according to the fine-grained interaction feature representation; wherein the first field feature representation is a field feature representation of the text to be linked obtained by encoding each field contained in the text to be linked, and the second field feature representation is a field feature representation of the description text obtained by encoding each field contained in the description text; determining a target linking entity corresponding to the text to be linked from each candidate entity according to the probability, and performing a task according to the target linking entity.

2. The method of claim 1, wherein, The method further comprises: determining an entity to which each entity mention contained in the text to be linked has a mapping relationship as a first candidate entity according to the pre-determined mapping relationship table between entity mentions and entities; and determining a second candidate entity according to a relevance between each entity mention contained in the text to be linked and a description text of each entity in a pre-set knowledge base; determining a candidate entity corresponding to each entity mention contained in the text to be linked according to the first candidate entity and the second candidate entity.

3. The method of claim 1, wherein, The method further comprises: training the entity linking model, specifically comprising: obtaining a sample text set and an entity linking model to be trained; for each sample text contained in the sample text set, obtaining each entity mention contained in the sample text, and obtaining each linking entity corresponding to each entity mention contained in the sample text as a positive sample; and determining other entities corresponding to each description text similar to each entity mention contained in the sample text except for each linking entity corresponding to each entity mention as a negative sample. inputting the sample text, each entity mention contained in the sample text, the description text of the positive sample or the description text of the negative sample into the to-be-trained entity linking model to encode the sample text by the to-be-trained entity linking model to obtain a feature representation of the sample text, and determining a sample fine-grained interaction feature representation between the feature representation of the pre-determined description text of the positive sample or the negative sample and the feature representation of the sample text, and determining a probability that the positive sample or the negative sample is a linking entity of the sample text according to the sample fine-grained interaction feature representation; training the to-be-trained entity linking model to obtain a trained entity linking model, with a deviation between the probability that the positive sample or the negative sample is a linking entity of the sample text and a labeled result of the positive sample or the negative sample being minimized as an optimization objective.

4. The method of claim 1, wherein, The entity linking model comprises a first feature extraction layer. inputting the to-be-linked text and each entity mention contained in the to-be-linked text into the pre-trained entity linking model, specifically comprising: inputting the to-be-linked text and each entity mention contained in the to-be-linked text into the first feature extraction layer of the entity linking model to encode the to-be-linked text by the first feature extraction layer to obtain a semantic feature representation of the to-be-linked text, and to encode each field contained in the to-be-linked text by the first feature extraction layer to obtain a field feature representation of the to-be-linked text as each first field feature representation; determining, by the first feature extraction layer, a feature representation of each entity mention contained in the to-be-linked text according to a field feature representation of a starting position and a field feature representation of an ending position of the entity mention in the to-be-linked text.

5. The method of claim 4, wherein, The entity linking model comprises a second feature extraction layer. inputting the pre-set description text of the candidate entity into the pre-trained entity linking model, specifically comprising: for each candidate entity, inputting the pre-set description text of the candidate entity into the second feature extraction layer of the pre-trained entity linking model to encode the description text by the second feature extraction layer to obtain a semantic feature representation of the description text, and to encode each field contained in the description text to obtain a field feature representation of the description text as each second field feature representation.

6. The method of claim 5, wherein, The entity linking model further comprises a first interaction layer and a second interaction layer. for each candidate entity, determining a fine-grained interaction feature representation between the feature representation of the pre-determined description text of the candidate entity and the feature representation of the to-be-linked text, specifically comprising: inputting the first field feature representations and the second field feature representations into the first interaction layer to determine a similarity matrix between the first field feature representations and the second field feature representations by the first interaction layer; and inputting the first field feature representation and the second field feature representation into the second interaction layer to determine a difference degree matrix between the first field feature representation and the second field feature representation through the second interaction layer; determining a first fine-grained interaction feature representation of the text to be linked according to the similarity matrix and the first field feature representation, and determining a second fine-grained interaction feature representation of the text to be linked according to the difference degree matrix and the first field feature representation; and determining a first fine-grained interaction feature representation of the candidate entity according to the similarity matrix and the second field feature representation, and determining a second fine-grained interaction feature representation of the candidate entity according to the difference degree matrix and the second field feature representation.

7. The method of claim 6, wherein, The entity linking model further comprises a decision layer; determining a probability that the candidate entity is a target linking entity according to the fine-grained interaction feature representation, specifically comprising: inputting the first fine-grained interaction feature representation of the text to be linked, the second fine-grained interaction feature representation of the text to be linked, the feature representation of each entity mention contained in the text to be linked, the first fine-grained interaction feature representation of the candidate entity, the second fine-grained interaction feature representation of the candidate entity, and the semantic feature representation of the description text of the candidate entity into the decision layer to determine the probability that the candidate entity is a target linking entity through the decision layer.

8. An entity linking apparatus characterized by comprising: comprising: an acquisition module configured to acquire a text to be linked and each entity mention contained in the text to be linked; a screening module configured to determine a candidate entity corresponding to each entity mention contained in the text to be linked according to a pre-determined mapping relationship table between entity mentions and entities; a determination module configured to input the text to be linked, each entity mention contained in the text to be linked, and a pre-set description text of the candidate entity into a pre-trained entity linking model to encode the text to be linked through the entity linking model, to obtain a feature representation of the text to be linked, and for each candidate entity, to determine a fine-grained interaction feature representation between a feature representation of the description text of the candidate entity and the feature representation of the text to be linked according to a first field feature representation of the text to be linked and a second field feature representation of the description text of the candidate entity, and to determine a probability that the candidate entity is a target linking entity according to the fine-grained interaction feature representation; wherein the first field feature representation is each field feature representation of the text to be linked obtained by encoding each field contained in the text to be linked, and the second field feature representation is each field feature representation of the description text obtained by encoding each field contained in the description text; an execution module configured to determine a target linking entity corresponding to the text to be linked from the candidate entities according to the probability, and to perform a task according to the target linking entity.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1-7. The storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1-7.

10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1-7 when executing the program.

Citation Information

Patent Citations

  • Entity linking method and related equipment

    CN115238080A

  • Entity link model training method and device and entity link method and device

    CN116166770A