An entity linking method and apparatus
Patent Information
- Application Number
- CN202410988676.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-07-23
AI Technical Summary
[0005]本发明的目的在于克服现有技术中远程监督和零样本学习带来的推理效果较差和不能较好的适应新领域的技术缺陷,提出了一种实体链接方法,本发明还公开了一种实体链接装置
[0049]1、本发明设计了一种融合深度语义和浅层特征的零样本实体链接方法,可有效提高零样本场景下实体链接的能力;
Smart Images

Figure CN118885557B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of entity linking technology in natural language processing, and more particularly to an entity linking method and apparatus. Background Technology
[0002] Entity linking refers to linking named entity references extracted from unstructured text to corresponding entities in a knowledge base. Entity linking is crucial for tasks such as content recommendation, information retrieval, knowledge graph question answering, and knowledge base expansion. However, the diversity and ambiguity of entity references pose significant challenges to entity linking tasks. Diversity means that the same entity may correspond to multiple different entity references; for example, "vitamin C," "vitamin C," and "vitamin C" can all link to the entity "vitamin C." Furthermore, ambiguity means that a reference may represent different entities; for example, "apple" could refer to a type of fruit or the Apple Inc.
[0003] The key to entity linking is ranking the candidate entities for the reference, which essentially involves determining the similarity between the reference and the candidate entities. This can be broken down into three parts: representing the reference, representing the entities, and determining similarity. The representation of the reference generally considers encoding it in conjunction with its context. Encoding methods have evolved from early models like the typical Bag of Word (BoW), to mid-stage models using Long Short-Term Memory (LSTM) networks combined with attention mechanisms, and more recently, pre-trained language models. Entity representation typically relies on existing large knowledge bases to obtain information such as entity descriptions, entity page titles, and entity types, and is represented in a manner similar to the encoding of the reference. Finally, methods such as cosine distance are used to match the similarity between the two representations to obtain the ranking of the candidate entities for the reference.
[0004] However, entity linking tasks only have high-quality labeled data in limited domains, and most current algorithms rely on supervised models, requiring large amounts of training data to achieve practical performance. Considering the cost of labeling, completing entity linking in low-resource scenarios with scarce labeled data is a significant challenge. Currently, there are two main solutions: distant supervision and zero-shot learning. Distant supervision methods typically use heuristic rules for text surface matching to generate distant supervision datasets and then perform weakly supervised learning on these datasets. However, the datasets generated by these methods are generally noisy, easily causing model bias and affecting inference performance. Zero-shot learning, on the other hand, trains universally applicable features in a domain with sufficient labeled data and then transfers them to a new domain. However, this type of method faces problems such as domain adaptation and sample bias, affecting the prediction performance after transfer. Therefore, a new entity linking method is urgently needed to overcome the shortcomings of both distant supervision and zero-shot learning methods. Summary of the Invention
[0005] The purpose of this invention is to overcome the technical defects of poor reasoning performance and inability to adapt well to new fields caused by remote supervision and zero-shot learning in the prior art. This invention proposes an entity linking method and also discloses an entity linking device.
[0006] On one hand, the present invention provides a method for linking entities, including:
[0007] Step 1: Obtain the entity set and the reference set that need to be linked with the entities;
[0008] Step 2: Obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and calculate the deep semantic matching score between references and entities;
[0009] Step 3: Obtain the relevance scores of entities in the entity set and references in the reference set, and use the relevance scores as the shallow text matching scores between references and entities.
[0010] Step 4: Based on the deep semantic matching score and the shallow text matching score, determine the candidate entities corresponding to the reference, calculate the comprehensive score of the candidate entities and sort them, and determine the entity linking result based on the sorting.
[0011] In an improved entity linking method, step 1 includes:
[0012] Step 1-1: Use a predefined set of entities in the domain, or obtain the set of entities in the domain through expert annotation;
[0013] Steps 1-2: Use an information extraction model to traverse every sentence in the domain dataset, extract information, and construct a reference set from all the obtained references. The information extraction model can include small-scale pre-trained language models or large-scale pre-trained language models with hint engineering methods.
[0014] In an improved entity linking method, step 2 includes:
[0015] Step 2-1: Use a pre-trained language model to encode the text sequences of references and entities respectively, to obtain the deep semantic features of each reference and the deep semantic features of each entity;
[0016] Step 2-2: Traverse each reference, use a similarity function to calculate the similarity between its deep semantic features and the deep semantic features of each entity, and use this similarity as the deep semantic matching score between the reference and the entity.
[0017] In an improved entity linking method, step 3 includes:
[0018] Step 3-1: Construct a stop word list;
[0019] Step 3-2: Traverse the entity set and the reference set, segment the entities and remove stop words, and segment the references and remove stop words.
[0020] Step 3-3: Use the processed entity set to build an information retrieval model;
[0021] Steps 3-4: Iterate through each reference, use the information retrieval model to calculate its relevance to each entity, and use this relevance as the shallow text matching score between the reference and the entity.
[0022] In an improved entity linking method, step 4 specifically includes:
[0023] Step 4-1: Traverse each reference and execute steps 4-2 to 4-4 to obtain the entity linking results for all references;
[0024] Step 4-2: For the currently traversed reference x, the entities with deep semantic matching scores greater than the threshold α constitute the deep semantic candidate entity set A of reference x, and the entities with shallow text matching scores greater than the threshold β constitute the shallow text candidate entity set B of reference x. The intersection C of sets A and B is taken as the candidate entity set of its links.
[0025] Step 4-3: Calculate the comprehensive score of each entity in the candidate entity set C as a weighted sum of its deep semantic matching score and shallow text matching score;
[0026] Step 4-4: Select the candidate entity with the highest score in the candidate entity set C as the entity linked by the reference x; if the set C is empty, then there is no object in the entity set that the reference x can link to.
[0027] On the other hand, the present invention provides an entity linking device, comprising: an information acquisition module, a deep semantic encoder, a shallow feature encoder, and a dual feature fusion unit, wherein:
[0028] The information acquisition module is used to acquire the entity set and the reference set that needs to be linked with the entities;
[0029] The deep semantic encoder is used to obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and to calculate the deep semantic matching score between references and entities.
[0030] The shallow feature encoder is used to obtain the relevance scores of entities in the entity set and references in the reference set, and uses the relevance scores as the shallow text matching scores between references and entities.
[0031] The dual-feature fusion processor is used to determine the candidate entities corresponding to the reference based on the deep semantic matching score and the shallow text matching score, calculate the comprehensive score of the candidate entities and sort them, and determine the entity linking result of the reference based on the sorting.
[0032] In an improved entity linking device, the information acquisition module includes: an entity acquisition unit and an information extractor, wherein:
[0033] The entity acquisition module is used to obtain the entity set of the domain by using a predefined set of entities in the domain, or by using expert annotation.
[0034] The information extractor specifically uses an information extraction model to traverse every sentence in the domain dataset, extract information, and construct a reference set from all the obtained references. The information extraction model includes small-scale pre-trained language models or large-scale pre-trained language models with prompting engineering methods.
[0035] In an improved entity linking device, the deep semantic encoder includes: an encoding unit and a similarity calculation unit, wherein:
[0036] The encoding unit is used to encode the text sequences of references and entities using a pre-trained language model, respectively, to obtain the deep semantic features of each reference and the deep semantic features of each entity.
[0037] The similarity calculation unit is used to traverse each reference, use a similarity function to calculate the similarity between its deep semantic features and the deep semantic features of each entity, and use the similarity as the deep semantic matching score between the reference and the entity.
[0038] In an improved entity linking device, the shallow feature encoder includes: a stop word construction unit, a word segmentation unit, a model construction unit, and a relevance calculation unit; wherein:
[0039] The stop word construction unit is used to construct a stop word list;
[0040] The text preprocessing unit is used to traverse the entity set and the reference set, segment the entities and remove stop words, and segment the references and remove stop words.
[0041] The model building unit is used to build an information retrieval model using the processed entity set;
[0042] The relevance calculation unit is used to traverse each reference, use an information retrieval model to calculate its relevance to each entity, and use the relevance as the shallow text matching score between the reference and the entity.
[0043] In an improved entity linking device, the dual-feature fusion unit includes: a candidate entity set determination unit, a comprehensive score calculation unit, a link object determination unit, and a traversal unit, wherein:
[0044] The traversal unit is used to traverse each reference, trigger the candidate entity set determination unit, the comprehensive score calculation unit, and the link object determination unit to obtain the entity linking results for all references.
[0045] The candidate entity set determination unit is used to: for the currently traversed reference x, form a deep semantic candidate entity set A for reference x by having entities whose deep semantic matching scores are greater than the threshold α, form a shallow text candidate entity set B for reference x by having entities whose shallow text matching scores are greater than the threshold β, and take the intersection C of set A and set B as the candidate entity set linked to it.
[0046] The comprehensive score calculation unit is used to calculate the comprehensive score of each entity in the candidate entity set C as a weighted sum of its deep semantic matching score and shallow text matching score.
[0047] The link object determination unit is used to select the candidate entity with the highest score in the candidate entity set C as the entity linked by the designation x; if the set C is empty, then there is no object in the entity set that the designation x can link to.
[0048] Compared with the prior art, the advantages of the present invention are:
[0049] 1. This invention designs a zero-shot entity linking method that integrates deep semantics and shallow features, which can effectively improve the entity linking capability in zero-shot scenarios;
[0050] 2. The method of the present invention performs entity linking in scenarios containing only entity sets and without labeled samples and entity-related information, without the need for model training, and can significantly improve the accuracy of entity linking. Attached Figure Description
[0051] Figure 1 This is one of the schematic diagrams of the entity linking method in Embodiment 1 of the present invention;
[0052] Figure 2 This is the second schematic diagram of the entity linking method in Embodiment 1 of the present invention;
[0053] Figure 3 This is a schematic diagram of extracting the referential set from a sentence in Embodiment 1 of the present invention;
[0054] Figure 4 This refers to the use of a pre-trained language model in Embodiment 1 of the present invention. A diagram illustrating the encoding of text sequences of references and entities;
[0055] Figure 5 This is a schematic diagram of the structure of the physical linking device in Embodiment 2 of the present invention;
[0056] Figure 6 This is a schematic diagram of the data flow of each module in the physical linking device of Embodiment 2 of the present invention during operation. Detailed Implementation
[0057] This invention proposes an entity linking method applicable to low-resource, zero-shot scenarios. Compared to existing remote supervision methods in low-resource scenarios, which require constructed labeled data but suffer from noisy samples affecting training performance, and zero-shot learning methods, which require training and transfer based on labeled data but suffer from domain adaptation issues, this invention proposes a method that integrates deep semantics and shallow features to link terms to entities based solely on an entity set. It matches terms and entities from both deep semantic and shallow feature perspectives, eliminating the need for labeled data construction and model training, making it suitable for emerging domains with low resources and no labeled data. Experiments demonstrate that this invention achieves entity linking without labeled samples or model training. By controlling the matching degree from both deep semantic and shallow feature perspectives, the matching bias between terms and entities can be adjusted to obtain accurate matching results.
[0058] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0059] Example 1
[0060] like Figure 1 and Figure 2 As shown, the entity linking method of this invention includes the following main steps:
[0061] Step 1: Obtain the entity set and the reference set that need to be linked.
[0062] Suppose we need to prepare an entity set Y = {y1, y2, ..., y} n}, we need to obtain the referent set X = {x1, x2, ..., x} in the dataset corpus that requires entity linking. m}, where n is the number of entities and m is the number of references. Each entity or reference in the entity set Y and the reference set X is represented as a sequence of text.
[0063] Specifically, it can be obtained through the following steps 1-1 and 1-2:
[0064] Step 1-1: Use a predefined entity set Y for the domain, or obtain the entity set Y for the domain through expert annotation or other methods. Table 1 shows an example of the entity set Y. The domain here can be an emerging domain or a non-emerging domain.
[0065] Table 1 Example of entity set Y
[0066] <![CDATA[y1]]> Image processing module <![CDATA[y2]]> Lighting system <![CDATA[y3]]> Light-emitting module … … <![CDATA[y n-1 ]]> apple <![CDATA[y n ]]> Vitamin C
[0067] Steps 1-2: Use an information extraction model to traverse every sentence in the domain dataset, extract information, and construct a reference set from all the obtained references.
[0068] Specifically, by traversing each document or paragraph in the domain dataset, slicing it into sentences, and then obtaining the sentence set Z in the dataset, the sentences in Z are sequence-labeled to obtain the reference set that appears in the sentences.
[0069] (1) A method based on a small-scale pre-trained language model such as BERT (Bidirectional Encoder Representations from Transformers) can be used as an information extraction model. Identifying references in sentences: By utilizing the parameters of models already trained in similar domains, sequence labeling is performed on sentences in a dataset from this domain to obtain the set of references appearing in the sentences. For example... Figure 3 As shown, taking the sentence z = "Low-pressure etchant gas is injected into the PECVD chamber to generate plasma" as an example, the input into the model... The model then outputs the label of each word in the sentence (such as the BIO label), and the label is parsed to obtain the reference set z′. (2) This step can also use large language models such as Tongyi Qianwen or Wenxin Yiyan as information extraction models. Referential information in sentences is identified using prompting engineering methods. For sentence z, it is first combined with the instruction template ins to obtain the sequence ins′, which is then input into the information extraction model. This yields the set of references z′ that can be extracted from the sentence z. For example, by replacing the default part inside the curly braces "{}" in the instruction template ins="Extract named entity references from the following sentence: {}" with the sentence z = "Low-pressure etchant gas is injected into the PECVD chamber to generate plasma", we can obtain the information extraction model. The input ins′ = "Extract named entity references from the following sentence: Low-pressure etchant gas is injected into the PECVD chamber to generate plasma.". Information extraction model The extracted reference set z′ = {“low-pressure etchant gas”, “PECVD chamber”, “plasma”} is output.
[0070] Using information extraction models Iterate through each sentence in Z and extract information, then construct a reference set X from all the obtained references. Table 2 shows an example of the reference set X.
[0071] Table 2 Examples of the Denotation Set X
[0072] <![CDATA[x1]]> Image acquisition and processing module <![CDATA[x2]]> A lighting system <![CDATA[x3]]> Light-emitting devices <![CDATA[x4]]> Low-pressure etchant gas <![CDATA[x5]]> PECVD chamber <![CDATA[x6]]> plasma … … <![CDATA[x m-1 ]]> apple <![CDATA[x m ]]> Vitamin C
[0073] Since the reference set and the entity set are determined separately, and the determination process is relatively independent, the above steps 1-1 and 1-2 can be executed in parallel or sequentially, i.e., step 1-1 is executed first and then step 1-2, or step 1-2 is executed first and then step 1-2. This invention does not impose any limitations on these steps.
[0074] Step 2: Obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and calculate the deep semantic matching score between references and entities.
[0075] Specifically, this includes the following steps 2-1 and 2-2:
[0076] Step 2-1: Use a pre-trained language model For example, BERT encodes the text sequence of each reference and entity in the reference set X and the entity set Y to obtain the deep semantic features of each reference and each entity.
[0077] like Figure 4 As shown, the sequence l of references or entities with a character length of p is... <Tok1,Tok2,…,Tok p For example, by using the special symbols [CLS] and [SEP] as delimiters, we concatenate them to the beginning and end of the sequence respectively, resulting in the input sequence l′=<[CLS],Tok1,Tok2,…,Tok p For example, the input sequence corresponding to the term "plasma" is <[CLS],plasma,ion,solid,[SEP]>. Then, sequence l′ is used as a pre-trained language model. The input is encoded. Then, the sequence l′ is processed in the model. The feature corresponding to each character in the last hidden layer is extracted and denoted as H = <h CLS ,h1,h2,…,h p ,h SEP Finally, the features H of the sequence are average-pooled to obtain the deep semantic features h of sequence l, denoted as: Each entity and reference in the entity set Y and the reference set X are encoded in this way to obtain the corresponding deep semantic features, which are denoted as sets. and
[0078] Step 2-2: Calculate the deep semantic matching score between the reference and the entity.
[0079] Specifically, traversing each mention in the mention set X, a function such as cosine distance is used to calculate the depth semantic feature of the mention and h Y the similarity between the depth semantic feature and the depth semantic feature of each entity in, and the similarity is taken as the deep semantic matching score of the mention and the entity. For the i-th mention x i as an example, firstly from h X the corresponding deep semantic feature is extracted calculate and the similarity between the deep semantic feature and the deep semantic feature of each entity in, so as to obtain the deep semantic matching scores between the i-th mention and all entities wherein represents the deep semantic matching score between the i-th mention and the j-th entity, which is calculated by cosine similarity, that is: finally, the deep semantic matching scores of each mention in the mention set X and all entities are recorded as a set
[0080] The above process of step 2 can be implemented by a deep semantic encoder capable of completing the above steps 2-1 to 2-4, as Figure 2 shown in.
[0081] Step 3: Obtain the relevance score between the entity in the entity set and the mention in the mention set, and take the relevance score as the shallow text matching score of the mention and the entity.
[0082] It specifically includes the following steps 3-1 to 3-4:
[0083] Step 3-1: Construct a stop word list.
[0084] The stop word list W generally includes frequently occurring function words or characters without practical significance, such as prepositions, conjunctions, articles, pronouns, punctuation marks, etc. For example, for Chinese, the stop word list W = {de, le, ma, yi ge, zhe ge, shi, …}; for English, the stop word list W = {a, an, the, is, …}.
[0085] Step 3-2: Traverse the entity set and the mention set, segment words for entities and remove stop words therein, and segment words for mentions and remove stop words therein.
[0086] Continuing with the above example, traverse the entity set Y, segment the text of each entity therein and remove stop words therein to form a set Y'.
[0087] Step 3-3: Construct an information retrieval model using the processed entity set.
[0088] Specifically, the information retrieval model herein may be a probability-based information retrieval model, such as the BM25 model.
[0089] Following the previous example, we will construct the BM25 model using set Y′.
[0090] Steps 3-4: Iterate through each reference, use the information retrieval model to calculate its relevance to each entity, and use this relevance as the shallow text matching score between the reference and the entity.
[0091] Following the previous example, we iterate through the reference set X and use the constructed BM25 model. Obtain the shallow text matching score for each reference and entity.
[0092] Specifically, the i-th reference x in set X i For example, first segment it and remove stop words to obtain sequence x′. i x′ i Input into BM25 model In this process, the relevance of the i-th reference to all entities can be obtained. in This represents the relevance between the i-th reference and the j-th entity. Perform minimax normalization to obtain the shallow text matching score between the i-th reference and all entities. Right now in Let represent the shallow text matching score between the i-th reference and the j-th entity. This method yields the shallow text matching score between each reference in the reference set X and all entities, denoted as .
[0093] The process described in step 3 above can be implemented using a shallow feature encoder capable of performing steps 3-1 to 3-4, as shown in... Figure 2 The middle section shows.
[0094] Since the shallow text matching score and the deep semantic matching score are determined separately and the determination process is relatively independent, steps 2 and 3 above can be executed in parallel or sequentially, i.e., step 2 is executed first and then step 3 or step 3 is executed first and then step 2. This invention does not impose any limitations on these steps.
[0095] Step 4: Based on the deep semantic matching score and the shallow text matching score, determine the candidate entities corresponding to the reference, calculate the comprehensive score of the candidate entities and sort them, and determine the entity linking result based on the sorting.
[0096] Specifically, this includes the following steps 4-1 and 4-2:
[0097] Step 4-1: Traverse each reference and execute steps 4-2 to 4-4 to obtain the entity linking results for all references;
[0098] Step 4-2: For the i-th reference x in the currently traversed reference set X i Its deep semantic matching score Entities with a score greater than the threshold α constitute the reference x. i deep semantic candidate entity set At the same time, it sets its shallow text matching score Entities with a score greater than the threshold β constitute the reference x. i Shallow text candidate entity set Then take set A i and B i The intersection C i =A∩B={c i,1 ,c i,2 ,…} as its referent x i The set of candidate entities for the link.
[0099] For example, in this invention, the candidate entity set for referring to the "image acquisition and processing module" is {"image acquisition module", "image analysis module", "image processing unit"}.
[0100] Step 4-3: Refer to x i The candidate entity set C i The deep semantic matching score and shallow text matching score of each entity are weighted and summed to obtain the overall score for that entity. in Let X be the i-th reference in the reference set X and the set of candidate entities C of that reference. i The overall score of the k-th entity is calculated as follows: Where λ∈[0,1] represents the weight of the score.
[0101] Step 4-4: Obtain the candidate entity set C i The candidate entity with the highest score is referred to as x. i Linked entities If set C i If empty, then the entity set does not contain the reference x. i Linkable objects, setting the link result
[0102] After completing the traversal, we obtain the entity that each reference in the reference set X should be linked to. Let the entity linking result for all references be denoted as .
[0103] The process described in step 4 can be implemented using a dual-feature fusion processor capable of performing steps 4-1 to 4-4, as shown in the example. Figure 2 The middle section shows.
[0104] For example, this invention constructs an emerging domain dataset of low-resource, unlabeled data by searching for statements related to GPU components in a patent database, and links the reference "image acquisition and processing module" to the entity "image acquisition module"; the reference "a lighting system" to the entity "lighting system"; and the reference "light-emitting device" to the entity "light-emitting module". These references and entities are not exactly the same in textual form, but they have the same concept.
[0105] Step 4 above determines the entity to be linked based on the deep semantic matching score and the shallow text matching score. The higher the deep semantic matching score and the shallow text matching score of the entity, the greater the probability that the entity will be identified as the linked object.
[0106] In emerging fields with limited resources, labeled samples are generally lacking, along with relevant entity descriptions, title pages, and other information. In this scenario, this invention proposes a zero-shot entity linking method that integrates deep semantics and shallow features, performing zero-shot entity linking based solely on the entity reference set and the entity set. This method considers the probability of linking entity references to candidate entities at both the semantic and textual levels, thereby improving entity linking performance. Compared to previous zero-shot learning and remote supervised learning methods, this invention emphasizes a zero-shot scenario that requires no labeled data and no model training, making it suitable for the rapid application of entity linking in new scenarios.
[0107] Example 2
[0108] Based on the same inventive concept as Embodiment 1, Embodiment 2 of the present invention proposes a physical linking device, such as... Figure 5 As shown, it includes: an information acquisition module, a deep semantic encoder, a shallow feature encoder, and a dual feature fusion unit, wherein:
[0109] The information acquisition module 51 is used to acquire the entity set and the reference set that needs to be linked with the entities;
[0110] The deep semantic encoder 52 is used to obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and to calculate the deep semantic matching score between references and entities.
[0111] The shallow feature encoder 53 is used to obtain the relevance scores of entities in the entity set and references in the reference set, and uses the relevance scores as the shallow text matching scores between references and entities.
[0112] The dual-feature fusion unit 54 is used to determine the candidate entities corresponding to the reference based on the deep semantic matching score and the shallow text matching score, calculate the comprehensive score of the candidate entities and sort them, and determine the entity linking result of the reference based on the sorting.
[0113] Specifically, the information acquisition module 51 includes: an entity acquisition unit 511 and an information extractor 512, wherein:
[0114] The entity acquisition unit 511 is used to obtain the entity set of the domain by using a predefined set of entities in the domain, or by using expert annotation.
[0115] The information extractor 512 is specifically used to use an information extraction model to traverse every sentence in the domain dataset, extract information, and form a reference set from all the obtained references. The information extraction model includes a small-scale pre-trained language model or a large-scale pre-trained language model prompting engineering method.
[0116] Specifically, the deep semantic encoder 52 includes: an encoding unit 521 and a similarity calculation unit 522, wherein:
[0117] The encoding unit 521 is used to encode the text sequences of references and entities using a pre-trained language model to obtain the deep semantic features of each reference and the deep semantic features of each entity.
[0118] The similarity calculation unit 522 is used to traverse each reference, use a similarity function to calculate the similarity between its deep semantic features and the deep semantic features of each entity, and use the similarity as the deep semantic matching score between the reference and the entity.
[0119] Specifically, the shallow feature encoder 53 includes: a stop word construction unit 531, a word segmentation unit 532, a model construction unit 533, and a relevance calculation unit 534; wherein:
[0120] The stop word construction unit 531 is used to construct a stop word list;
[0121] The text preprocessing unit 532 is used to traverse the entity set and the reference set, segment the entities and remove stop words, and segment the references and remove stop words. The model building unit 533 is used to build an information retrieval model using the processed entity set.
[0122] The relevance calculation unit 534 is used to traverse each reference, use an information retrieval model to calculate its relevance to each entity, and use the relevance as the shallow text matching score between the reference and the entity.
[0123] Specifically, the dual-feature fusion unit 54 includes: a traversal unit 541, a candidate entity set determination unit 542, a comprehensive score calculation unit 543, and a link object determination unit 544, wherein:
[0124] The traversal unit 541 is used to traverse each reference, trigger the candidate entity set determination unit 542, the comprehensive score calculation unit 543 and the link object determination unit 544, and obtain the entity linking results of all references.
[0125] The candidate entity set determination unit 542 is used to: for the currently traversed reference x, form a deep semantic candidate entity set A for reference x by having entities whose deep semantic matching scores are greater than the threshold α, form a shallow text candidate entity set B for reference x by having entities whose shallow text matching scores are greater than the threshold β, and take the intersection C of sets A and B as the candidate entity set linked to it.
[0126] The comprehensive score calculation unit 543 is used to calculate the comprehensive score of each entity in the candidate entity set C as a weighted sum of its deep semantic matching score and shallow text matching score.
[0127] The link object determination unit 544 is used to select the candidate entity with the highest score in the candidate entity set C as the entity linked by the reference x; if the set C is empty, then there is no object in the entity set that the reference x can link to.
[0128] The data transfer process during the operation of the above modules is as follows: Figure 6 As shown.
[0129] This invention presents a zero-shot entity linking method that integrates deep semantics and shallow features in low-resource scenarios. Entity linking tasks typically only have high-quality labeled data within a limited domain. Addressing the lack of training samples in emerging low-resource scenarios, this invention proposes a zero-shot entity linking method based solely on entity references and entity lists. By integrating deep semantics and shallow features, it considers the probability of linking entity references to candidate entities at both the semantic and textual levels, thereby improving entity linking performance. This invention is applicable to zero-shot scenarios where labeled data is unavailable and requires no model training, making it suitable for the rapid application of entity linking in new scenarios.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for linking entities, comprising: Step 1: Obtain the entity set and the reference set that need to be linked with the entities; Step 2: Obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and calculate the deep semantic matching score between references and entities; Step 3: Obtain the relevance scores of entities in the entity set and references in the reference set, and use the relevance scores as the shallow text matching scores between references and entities. Step 4: Based on the deep semantic matching score and the shallow text matching score, determine the candidate entities corresponding to the reference, calculate the comprehensive score of the candidate entities and rank them, and determine the entity linking result based on the ranking; specifically including: Step 4-1: Traverse each reference and execute steps 4-2 to 4-4 to obtain the entity linking results for all references; Step 4-2: For the reference of the current traversal The deep semantic matching score is greater than the threshold. The entity constitutes the reference deep semantic candidate entity set The shallow text matching score is greater than the threshold. The entity constitutes the reference Shallow text candidate entity set Take set and intersection As a set of candidate entities for its links; Step 4-3: Calculate the candidate entity set The overall score for each entity is a weighted average of its deep semantic matching score and shallow text matching score; Step 4-4: Obtain the candidate entity set The candidate entity with the highest score is the reference. The linked entities; if the set If empty, then the entity set does not contain the reference. Objects that can be linked.
2. The entity linking method as described in claim 1, characterized in that, Step 1 includes: Step 1-1: Use a predefined set of entities in the domain, or obtain the set of entities in the domain through expert annotation; Steps 1-2: Use an information extraction model to traverse every sentence in the domain dataset, extract information, and construct a reference set from all the obtained references. The information extraction model can include small-scale pre-trained language models or large-scale pre-trained language models with hint engineering methods.
3. The entity linking method as described in claim 1, characterized in that, Step 2 includes: Step 2-1: Use a pre-trained language model to encode the text sequences of references and entities respectively, to obtain the deep semantic features of each reference and the deep semantic features of each entity; Step 2-2: Traverse each reference, use a similarity function to calculate the similarity between its deep semantic features and the deep semantic features of each entity, and use this similarity as the deep semantic matching score between the reference and the entity.
4. The entity linking method as described in claim 1, characterized in that, Step 3 includes: Step 3-1: Construct a stop word list; Step 3-2: Traverse the entity set and the reference set, segment the entities and remove stop words, and segment the references and remove stop words. Step 3-3: Use the processed entity set to build an information retrieval model; Steps 3-4: Iterate through each reference, use the information retrieval model to calculate its relevance to each entity, and use this relevance as the shallow text matching score between the reference and the entity.
5. A physical linking device, characterized in that, include: The module consists of an information acquisition module, a deep semantic encoder, a shallow feature encoder, and a dual feature fusion unit, among which: The information acquisition module is used to acquire the entity set and the reference set that needs to be linked with the entities; The deep semantic encoder is used to obtain the deep semantic features of entities in the entity set and the deep semantic features of references in the reference set, and to calculate the deep semantic matching score between references and entities. The shallow feature encoder is used to obtain the relevance scores of entities in the entity set and references in the reference set, and uses the relevance scores as the shallow text matching scores between references and entities. The dual-feature fusion unit is used to determine candidate entities corresponding to the reference based on deep semantic matching scores and shallow text matching scores, calculate and sort the comprehensive scores of the candidate entities, and determine the entity linking results based on the sorting. Specifically, it includes: a candidate entity set determination unit, a comprehensive score calculation unit, a linking object determination unit, and a traversal unit, wherein: The traversal unit is used to traverse each reference, trigger the candidate entity set determination unit, the comprehensive score calculation unit, and the link object determination unit to obtain the entity linking results for all references. The candidate entity set determination unit: used for the designation of the currently traversed entity set. The deep semantic matching score is greater than the threshold. The entity constitutes the reference deep semantic candidate entity set The shallow text matching score is greater than the threshold. The entity constitutes the reference Shallow text candidate entity set Take set and set intersection As a set of candidate entities for its links; The comprehensive score calculation unit is used to calculate the candidate entity set. The overall score for each entity is a weighted average of its deep semantic matching score and shallow text matching score; The link object determination unit is used to retrieve the candidate entity set. The candidate entity with the highest score is the reference. The linked entities; if the set If empty, then the entity set does not contain the reference. Objects that can be linked.
6. The physical linking device as described in claim 5, characterized in that, The information acquisition module includes: an entity acquisition unit and an information extractor, wherein: The entity acquisition unit is used to obtain the entity set of the domain by using a predefined set of entities in the domain, or by using expert annotation. The information extractor specifically uses an information extraction model to traverse every sentence in the domain dataset, extract information, and construct a reference set from all the obtained references. The information extraction model includes small-scale pre-trained language models or large-scale pre-trained language models with prompting engineering methods.
7. The physical linking device as described in claim 5, characterized in that, A deep semantic encoder includes: an encoding unit and a similarity calculation unit, wherein: The encoding unit is used to encode the text sequences of references and entities using a pre-trained language model to obtain the deep semantic features of each reference and the deep semantic features of each entity. The similarity calculation unit is used to traverse each reference, use a similarity function to calculate the similarity between its deep semantic features and the deep semantic features of each entity, and use the similarity as the deep semantic matching score between the reference and the entity.
8. The physical linking device as described in claim 5, characterized in that, The shallow feature encoder includes: a stop word construction unit, a word segmentation unit, a model construction unit, and a relevance calculation unit; among which: The stop word construction unit is used to construct a stop word list; The word segmentation unit is used to traverse the entity set and the reference set, segment the entities and remove stop words, and segment the references and remove stop words. The model building unit is used to build an information retrieval model using the processed entity set; The relevance calculation unit is used to traverse each reference, use an information retrieval model to calculate its relevance to each entity, and use the relevance as the shallow text matching score between the reference and the entity.
Citation Information
Patent Citations
Integrated entity linking method and system based on deep learning
CN111062214A
Entity linking method and storage medium
CN115203438A