Method, device and electronic device for detecting hollow entities in entity links
By encoding entity mentions and text descriptions of candidate entities, and calculating semantic and category similarity, the problem of insufficient accuracy and low computational efficiency of low-frequency entities in the existing technology is solved, and more efficient entity linking and empty entity detection are achieved. .
Patent Information
- Application Number
- CN202211378616.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-11-04
AI Technical Summary
Existing entity linking methods have insufficient accuracy when processing low-frequency entities, and have low computational efficiency on large-scale knowledge graphs. They fail to effectively detect empty entities and have poor anti-noise capabilities.
By encoding entity mentions and text descriptions of candidate entities, calculating semantic similarity and category similarity, combined with the dual-tower encoder or cross-attention encoder structure, predict the entity category and calculate the score, and judge that the entity mention points to the empty entity or candidate entity.
It improves the accuracy of entity linking and empty entity detection capabilities, and combines structured information and large-scale pre-trained neural networks to enhance the reliability and efficiency of entity linking.
Smart Images

Figure CN115759096B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge engineering technology, and in particular to a method, device and electronic device for detecting hollow entities in entity links. Background Art
[0002] Entity linking is one of the classic tasks in the field of knowledge engineering. Its goal is to find text segments that may correspond to entities (also known as entity mentions) from text, and map entity mentions to specific entities in a given knowledge graph. Entity linking is a bridge between unstructured text and structured knowledge graphs, and can help in downstream natural language processing tasks such as knowledge question answering and text understanding. The main difficulty of entity linking lies in the ambiguity of natural language, that is, one entity mention may correspond to multiple candidate entities.
[0003] In some cases, an entity mention may not have a correct corresponding entity in the knowledge graph. In this case, we call the entity mention an "empty entity". The goal of the empty entity detection problem is to detect the part of the entity mention in the text that points to the empty entity. Empty entity detection can improve the accuracy of entity linking results and provide more reliable entity information for downstream tasks.
[0004] At present, entity linking methods can be divided into two categories: one is based on representation learning, and the other is based on large-scale pre-trained neural network methods. Representation learning-based methods often use high-quality structured information such as graph structure and category to learn the vector representation of entities and texts, making full use of structured information and having higher accuracy on traditional data sets; methods based on large-scale pre-trained neural networks introduce pre-trained language models, using their powerful semantic encoding capabilities to encode the text description of entities, and then calculate text similarity as the basis for linking.
[0005] The paper titled "Neural Collective Entity Linking (Cao Y, Hou L, Li J, et al. Proceedings of the 27th International Conference on Computational Linguistics. 2018: 675-686.)" adopts a method based on representation learning. This method uses a graph convolutional neural network (GCN) to integrate local similarity and global consistency. It first jointly trains on annotated corpus to obtain vector representations of text and entities, and then calculates local features such as text similarity. Then, it constructs a dependency graph of entities in the text, and further uses a graph convolutional neural network to calculate the global consistency of entities. Finally, it combines local similarity and global consistency to select linked entities. This method is difficult to accurately model low-frequency entities with fewer neighbors, which may cause errors; at the same time, the graph convolutional neural network has low computational efficiency on large-scale knowledge graphs, and it is difficult to provide efficient entity linking practical services.
[0006] The paper titled "Scalable Zero-shot Entity Linking with Dense Entity Retrieval (Wu L, Petroni F, Josifoski M, et al. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). 2020: 6397-6407.)" proposed an entity linking model BLINK based on a large-scale pre-trained neural network. The model believes that using only the text description of the entity can also achieve good entity linking results. Using the pre-trained language model BERT as the encoder base, a dual-tower encoder structure is constructed that uses two different encoders to encode the context and entity description respectively, and a cross encoder structure that regards the context and entity description as a text pair, which has achieved considerable results on large-scale knowledge graphs. The BLINK model has more advantages in processing low-frequency entities with fewer neighbors, and can efficiently process large-scale knowledge graphs, but it does not make enough use of high-quality structured information, does not consider the problem of empty entities, and has poor noise resistance. Summary of the invention
[0007] In order to solve the problems existing in the prior art, the present invention provides the following technical solutions.
[0008] A first aspect of the present invention provides a method for detecting a hollow entity in an entity link, comprising:
[0009] Get entity mentions and their corresponding candidate entity sets from the text to be linked;
[0010] Encode the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector, and calculate the semantic similarity between the entity mention and the candidate entity;
[0011] Predicting entity categories of entity mentions and candidate entities using the encoding vectors, and calculating category similarities between the entity mentions and the candidate entities;
[0012] Calculating the scores of the candidate entities according to the semantic similarity and the category similarity;
[0013] The entity mention points to a null entity or a candidate entity as a link result, according to the scores of all candidate entities.
[0014] Preferably, obtaining entity mentions and their corresponding candidate entity sets from the text to be linked includes:
[0015] Constructing an entity alias table according to the entity linking corpus, wherein the entity alias table includes entity mentions and candidate entity sets corresponding to each entity mention;
[0016] According to the entity alias table, entity mentions and their corresponding candidate entity sets are obtained from the text to be linked.
[0017] Preferably, encoding the text description of each candidate entity corresponding to the entity mention context and the entity mention to obtain the encoding vector comprises:
[0018] A dual-tower encoder structure is used to independently encode the entity mention context and the text description of each candidate entity corresponding to the entity mention, and the encoding vector of the entity mention and the encoding vector of the candidate entity are obtained accordingly.
[0019] Preferably, the predicting entity mentions and entity categories of candidate entities using the encoding vector comprises: using linear transformation layers to predict the entity mentions and entity categories of candidate entities for the encoding vectors of the entity mentions and the encoding vectors of the candidate entities, respectively.
[0020] Preferably, calculating the semantic similarity between the entity mention and the candidate entity, and calculating the category similarity between the entity mention and the candidate entity comprises:
[0021] Calculate the inner product of the encoding vector of the entity mention and the encoding vector of the candidate entity to obtain semantic similarity;
[0022] The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0023] Preferably, encoding the text description of each candidate entity corresponding to the entity mention context and the entity mention to obtain the encoding vector comprises:
[0024] The entity mention context and the text description of each candidate entity corresponding to the entity mention are taken as a text pair;
[0025] The text pair is encoded using a cross-attention encoder structure to obtain an encoding vector of the text pair.
[0026] Preferably, the predicting entity mentions and entity categories of candidate entities using the encoding vector comprises: predicting entity mentions and entity categories of candidate entities using a linear transformation layer on the encoding vector of the text pair.
[0027] Preferably, calculating the semantic similarity between the entity mention and the candidate entity, and calculating the category similarity between the entity mention and the candidate entity comprises:
[0028] Calculating semantic similarity using the encoding vectors of the text pairs;
[0029] The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0030] Preferably, the step of calculating the score of the candidate entity according to the semantic similarity and the category similarity comprises: performing weighted summation of the semantic similarity and the category similarity to obtain the score of the candidate entity.
[0031] Preferably, judging, according to the scores of all candidate entities, whether the entity mention points to an empty entity or is a candidate entity as a link result comprises:
[0032] If the scores of all candidate entities corresponding to the entity mention are lower than the threshold, the entity mention points to the empty entity, otherwise the candidate entity with the highest score is used as the link result of the entity mention.
[0033] A second aspect of the present invention provides a device for detecting a hollow entity in an entity link, comprising:
[0034] An entity mention and candidate entity acquisition module is used to obtain entity mentions and their corresponding candidate entity sets from the text to be linked;
[0035] The entity mention and candidate entity encoding module is used to encode the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector, and calculate the semantic similarity between the entity mention and the candidate entity;
[0036] An entity mention and candidate entity category prediction module, used to predict the entity mention and candidate entity category using the encoding vector, and calculate the category similarity between the entity mention and the candidate entity;
[0037] A candidate entity score calculation module, used to calculate the score of the candidate entity according to the semantic similarity and category similarity;
[0038] The link result judgment module is used to judge whether the entity mention points to an empty entity or a candidate entity as a link result according to the scores of all candidate entities.
[0039] A third aspect of the present invention provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method for detecting hollow entities in entity links described in the first aspect.
[0040] The fourth aspect of the present invention provides an electronic device, comprising a processor and a memory connected to the processor, the memory storing a plurality of instructions, the instructions being loaded and executed by the processor so that the processor can execute the method for detecting hollow entities in entity links as described in the first aspect.
[0041] The beneficial effects of the present invention are as follows: the present invention provides a method, device and electronic device for detecting empty entities in entity links. First, entity mentions and candidate entities are encoded to obtain encoding vectors, and then the semantic similarity and category similarity between entity mentions and candidate entities are calculated based on the encoding vectors, and the scores of candidate entities are calculated based on these two indicators, and then the link results are judged based on the scores. The present invention combines high-quality structured information such as entity categories with an entity linking method based on large-scale pre-trained neural networks, thereby improving the accuracy of entity links; at the same time, empty entity detection is performed under large-scale knowledge graphs, thereby improving the detection capability of empty entities. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of the method for detecting hollow entities in entity links according to the present invention;
[0043] Figure 2 The schematic diagram of the model structure and working process of the double-tower encoder of the present invention;
[0044] Figure 3 A schematic diagram of the model structure and working process of the cross-attention encoder according to the present invention;
[0045] Figure 4 This is a functional structural diagram of the device for detecting hollow entities in entity links according to the present invention. DETAILED DESCRIPTION
[0046] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0047] The method provided by the present invention can be implemented in the following terminal environment, and the terminal may include one or more of the following components: a processor, a memory, and a display screen. The memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the following embodiment.
[0048] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory.
[0049] The memory may include random access memory (RAM) or read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instructions.
[0050] The display screen is used to display the user interface of each application.
[0051] In addition, those skilled in the art can understand that the structure of the above terminal does not constitute a limitation on the terminal, and the terminal may include more or fewer components, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, and a power supply, which will not be described in detail here.
[0052] Embodiment 1
[0053] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting a hollow entity in an entity link, comprising:
[0054] S101, obtaining entity mentions and their corresponding candidate entity sets from the text to be linked;
[0055] S102, encoding the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain an encoding vector, and calculating the semantic similarity between the entity mention and the candidate entity;
[0056] S103, predicting entity mentions and entity categories of candidate entities using the encoding vector, and calculating category similarity between the entity mentions and the candidate entities;
[0057] S104, calculating the score of the candidate entity according to the semantic similarity and the category similarity;
[0058] S105, judging, according to the scores of all candidate entities, whether the entity mention points to an empty entity or a candidate entity as a link result.
[0059] The method provided by the present invention utilizes structured entity category information to detect the part of entity mentions pointing to empty entities while performing entity linking, thereby improving the accuracy of entity linking. The present invention jointly trains the traditional entity linking task with the entity classification task, calculates the semantic similarity and category similarity between the entity mention and the candidate entity, and combines the two indicators to determine whether a specific entity mention points to an empty entity or a specific entity in the knowledge graph, thereby improving the accuracy and reliability of the entity linking results.
[0060] Executing step S101 may specifically include: constructing an entity alias table based on the entity linking corpus, the entity alias table including entity mentions and candidate entity sets corresponding to each entity mention; obtaining entity mentions and candidate entity sets corresponding to them from the text to be linked based on the entity alias table. Among them, the entity alias table can be understood as a mapping between entities in the knowledge graph and possible appearance forms in the text. Among them, entities in the knowledge graph may be mapped to a set of forms in the text, such as the "Yao Ming" entity may appear in the text "Yao Ming", "Little Giant", etc. Entity categories can be understood as some common types of attributes of entities corresponding to encyclopedia documents (such as people, places, organizations, etc.). The entity category system in the present invention is constructed based on the Wikidata classification system.
[0061] In the embodiment of the present invention, when executing steps S102-S103, two structural models can be selected, one is a dual-tower encoder structural model, and the other is a cross-attention encoder structural model. The specific implementation steps can be:
[0062] One is to use a dual-tower encoder structure to independently encode the entity mention context and the text description of each candidate entity corresponding to the entity mention, and obtain the encoding vector of the entity mention and the encoding vector of the candidate entity respectively; then use a linear transformation layer to predict the entity category of the entity mention and the candidate entity for the encoding vector of the entity mention and the encoding vector of the candidate entity respectively; then calculate the inner product of the encoding vector of the entity mention and the encoding vector of the candidate entity to obtain the semantic similarity, and obtain the category similarity by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0063] Another method is to regard the entity mention context and the text description of each candidate entity corresponding to the entity mention as a text pair, and use a cross-attention encoder structure to encode the text pair to obtain an encoding vector of the text pair; then use a linear transformation layer to predict the entity category of the entity mention and the candidate entity for the encoding vector of the text pair; then use the encoding vector of the text pair to calculate the semantic similarity, and obtain the category similarity by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0064] Executing step S104, calculating the score of the candidate entity according to the semantic similarity and the category similarity includes: performing weighted summation of the semantic similarity and the category similarity to obtain the score of the candidate entity.
[0065] Execute step S105, and determine whether the entity mention points to an empty entity or a candidate entity as a link result based on the scores of all candidate entities, including: if the scores of all candidate entities corresponding to the entity mention are lower than a threshold, then the entity mention points to an empty entity, otherwise the candidate entity with the highest score is used as the link result of the entity mention.
[0066] In a specific embodiment, Figure 2 , Figure 3 They respectively represent the model structure and working process of the dual-tower encoder used in the present invention, as well as the model structure and working process of the cross-attention encoder.
[0067] In the implementation process, we can first count the network corpus containing hyperlinks, regard the hyperlink text as an alias of the entity corresponding to the hyperlink target web page, and thus construct the entity alias table T: Record each entity mention m and its corresponding candidate entity set {e}, and discover the entity mentions and their corresponding candidate entity sets in the input text (text to be linked) based on the entity alias table.
[0068] When linking each entity mention specifically, two different structures can be used to correspond to different scenarios in reality. The dual-tower encoder structure corresponds to the coarse screening scenario with high efficiency requirements, and the cross encoder structure corresponds to the fine screening scenario with high accuracy requirements.
[0069] like Figure 2 As shown in the figure, under the dual-tower encoder structure, the model uses the context encoder f and the entity encoder g to encode the entity mention context c and the text description e of the candidate entity respectively, and obtains the corresponding vector representations f(c) and g(e), and then calculates the semantic similarity s by the inner product of the two vectors. s (c,e):
[0070] s s (c,e)=f(c)·g(e)
[0071] The model then uses a linear transformation layer to predict the category information t of the entity mention context c and the category information of the candidate entity e , and calculate the category similarity s between the entity mention and the candidate entity using cosine similarity t (c,e):
[0072] t c =σ(W cf(c)+b c )
[0073] t e =σ(W e g(e)+b e )
[0074] s t (c,e)=cos(t c ,t e )
[0075] Where σ is the normalized Sigmoid function, W c ,b c ,W e ,b e is a trainable parameter.
[0076] The two encoding systems of the dual-tower encoder structure are independent of each other, which allows the entities in the knowledge graph to be encoded in advance in practical applications. Therefore, only the encoding context needs to be encoded at runtime. It has high operating efficiency and is suitable for coarse screening scenarios with high efficiency requirements.
[0077] Under the cross encoder structure, the model regards the context c of the entity mention and the text description e of the candidate entity as a text pair (c, e), encodes the text pair jointly, obtains the text pair encoding vector f([c, e]) and calculates the semantic similarity s s (c,e):
[0078] s s (c,e)=σ(W s f([c,e])+b s )
[0079] Where σ is the normalized Sigmoid function, W s ,b s is a trainable parameter and f is an encoder.
[0080] Then, the model under the cross encoder structure uses a linear transformation layer to predict the category information t of the entity mention context on the text pair encoding vector c and the category information of the candidate entity e , and use cosine similarity to calculate the category similarity s t (c,e):
[0081] [t c ,t e ]=σ(Wf([c,e])+b)
[0082] s t (c,e)=cos(t c ,t e )
[0083] The cross-encoder structure jointly encodes the entity mention context and the candidate entity text description, which can better capture the connection between texts and has higher accuracy, but at the same time it is relatively slow and is suitable for fine screening scenarios with high accuracy requirements.
[0084] The model using any of the above structures obtains the semantic similarity s s (c,e) Similarity with category s t (c, e), the model will weight the semantic similarity and category similarity to obtain the final score s(c, e) of the candidate entity. The specific formula can be as follows:
[0085] s(c,e)=λs s (c,e)+(1-λ)s t (c,e)
[0086] Here, λ is a hyperparameter, and in this embodiment, λ=0.9 can be used.
[0087] For each entity mention, the model calculates the scores of all corresponding candidate entities. If the scores of all candidate entities are lower than the threshold ∈, the entity mention is considered to point to the "empty entity" NIL. Otherwise, the candidate entity with the highest score is taken as the link result a:
[0088]
[0089] Among them, e represents the text description of the candidate entity.
[0090] Compared with the prior art, the technical solution proposed in the present invention combines structured entity category information on the basis of utilizing a large-scale pre-trained language model, thereby improving the empty entity detection capability and entity linking accuracy. The quality evaluation of entity linking results was carried out on the self-annotated NEL dataset according to the method provided by the present invention. The results show that the present invention has achieved a 10% improvement in empty entity detection accuracy and a 4% improvement in overall accuracy compared with the prior art. In addition, the method provided by the present invention was tested on the classic entity linking datasets AIDA, MSNBC, and WNED-WIKI. The results show that on datasets that do not consider the empty entity problem, the present invention can still improve the accuracy by 1% compared with the prior art.
[0091] Embodiment 2
[0092] like Figure 4 As shown, an embodiment of the present invention provides a device for detecting a hollow entity in an entity link, comprising:
[0093] An entity mention and candidate entity acquisition module 401 is used to acquire entity mentions and their corresponding candidate entity sets from the text to be linked;
[0094] An entity mention and candidate entity encoding module 402 is used to encode the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain an encoding vector, and calculate the semantic similarity between the entity mention and the candidate entity;
[0095] An entity mention and candidate entity category prediction module 403, used to predict the entity mention and the entity category of the candidate entity using the encoding vector, and calculate the category similarity between the entity mention and the candidate entity;
[0096] A candidate entity score calculation module 404, used to calculate the score of the candidate entity according to the semantic similarity and category similarity;
[0097] The link result judgment module 405 is used to judge whether the entity mention points to an empty entity or a candidate entity as a link result according to the scores of all candidate entities.
[0098] Wherein, in the entity mention and candidate entity acquisition module, acquiring entity mention and its corresponding candidate entity set from the to-be-linked text includes:
[0099] Constructing an entity alias table according to the entity linking corpus, wherein the entity alias table includes entity mentions and candidate entity sets corresponding to each entity mention;
[0100] According to the entity alias table, entity mentions and their corresponding candidate entity sets are obtained from the text to be linked.
[0101] In the entity mention and candidate entity encoding module, encoding the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector may include:
[0102] A dual-tower encoder structure is used to independently encode the entity mention context and the text description of each candidate entity corresponding to the entity mention, and the encoding vector of the entity mention and the encoding vector of the candidate entity are obtained accordingly.
[0103] Furthermore, in the entity mention and candidate entity category prediction module, the use of the encoding vector to predict the entity category of the entity mention and the candidate entity includes: using a linear transformation layer to predict the entity category of the entity mention and the candidate entity encoding vector respectively.
[0104] Further, calculating the semantic similarity between the entity mention and the candidate entity, and calculating the category similarity between the entity mention and the candidate entity includes:
[0105] Calculate the inner product of the encoding vector of the entity mention and the encoding vector of the candidate entity to obtain semantic similarity;
[0106] The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0107] In addition, in the entity mention and candidate entity encoding module, encoding the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector may also include:
[0108] The entity mention context and the text description of each candidate entity corresponding to the entity mention are taken as a text pair;
[0109] The text pair is encoded using a cross-attention encoder structure to obtain an encoding vector of the text pair.
[0110] Furthermore, in the entity mention and candidate entity category prediction module, predicting the entity mention and candidate entity category using the encoding vector includes: using a linear transformation layer to predict the entity mention and candidate entity category of the encoding vector of the text pair.
[0111] Further, calculating the semantic similarity between the entity mention and the candidate entity, and calculating the category similarity between the entity mention and the candidate entity includes:
[0112] Calculating semantic similarity using the encoding vectors of the text pairs;
[0113] The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
[0114] Further, in the score calculation module of the candidate entity, the step of calculating the score of the candidate entity according to the semantic similarity and the category similarity includes: performing weighted summation of the semantic similarity and the category similarity to obtain the score of the candidate entity.
[0115] Further, in the empty entity judgment module, judging the candidate entity that the entity mention points to an empty entity or is a link result according to the scores of all candidate entities includes:
[0116] If the scores of all candidate entities corresponding to the entity mention are lower than the threshold, the entity mention points to the empty entity, otherwise the candidate entity with the highest score is used as the link result of the entity mention.
[0117] The device can be implemented by the method for detecting hollow entities in entity links provided in the above-mentioned embodiment 1. The specific implementation method can be found in the description of embodiment 1, which will not be repeated here.
[0118] The present invention also provides a memory storing a plurality of instructions, wherein the instructions are used to implement the method for detecting hollow entities in entity links as described in the first embodiment.
[0119] The present invention also provides an electronic device, comprising a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions, and the instructions can be loaded and executed by the processor so that the processor can execute the method for detecting hollow entities in entity links as described in Example 1.
[0120] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for detecting hollow entities in entity links, characterized in that: include: Acquiring entity mentions and corresponding candidate entity sets from the text to be linked includes: constructing an entity alias table according to the entity linking corpus, wherein the entity alias table includes entity mentions and candidate entity sets corresponding to each entity mention; acquiring entity mentions and corresponding candidate entity sets from the text to be linked according to the entity alias table; the entity alias table is a mapping between entities in the knowledge graph and possible appearance forms in the text; Encode the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector, and calculate the semantic similarity between the entity mention and the candidate entity; Predicting entity categories of entity mentions and candidate entities using the encoding vectors, and calculating category similarities between the entity mentions and the candidate entities; Calculating the score of the candidate entity according to the semantic similarity and the category similarity includes: obtaining the score of the candidate entity by weighted summing the semantic similarity and the category similarity; The entity mentions are judged based on the scores of all candidate entities. Candidate entities that point to empty entities or are link results include: If the scores of all candidate entities corresponding to the entity mention are lower than the threshold, the entity mention points to the empty entity, otherwise the candidate entity with the highest score is used as the link result of the entity mention.
2. The method for detecting hollow entities in entity links according to claim 1, characterized in that: The encoding of the text description of each candidate entity corresponding to the entity mention context and the entity mention to obtain the encoding vector includes: A dual-tower encoder structure is used to independently encode the entity mention context and the text description of each candidate entity corresponding to the entity mention, and the encoding vector of the entity mention and the encoding vector of the candidate entity are obtained accordingly.
3. The method for detecting hollow entities in entity links according to claim 2, characterized in that: The using of the encoding vector to predict entity mentions and entity categories of candidate entities includes: using linear transformation layers to predict entity mentions and entity categories of candidate entities for the encoding vectors of the entity mentions and the encoding vectors of the candidate entities, respectively.
4. The method for detecting hollow entities in entity links according to claim 3, characterized in that: The calculating the semantic similarity between the entity mention and the candidate entity, and the calculating the category similarity between the entity mention and the candidate entity include: Calculate the inner product of the encoding vector of the entity mention and the encoding vector of the candidate entity to obtain semantic similarity; The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
5. The method for detecting hollow entities in entity links according to claim 1, characterized in that: The encoding of the text description of each candidate entity corresponding to the entity mention context and the entity mention to obtain the encoding vector includes: The entity mention context and the text description of each candidate entity corresponding to the entity mention are taken as a text pair; The text pair is encoded using a cross-attention encoder structure to obtain an encoding vector of the text pair.
6. The method for detecting hollow entities in entity links according to claim 5, characterized in that: The using the encoding vector to predict entity mentions and entity categories of candidate entities includes: using a linear transformation layer to predict entity mentions and entity categories of candidate entities on the encoding vector of the text pair.
7. The method for detecting hollow entities in entity links according to claim 6, characterized in that: The calculating the semantic similarity between the entity mention and the candidate entity, and the calculating the category similarity between the entity mention and the candidate entity include: Calculating semantic similarity using the encoding vectors of the text pairs; The category similarity is obtained by calculating the cosine similarity between the entity category of the entity mention and the entity category of the candidate entity.
8. A device for detecting a hollow entity in a physical link, characterized in that: include: The entity mention and candidate entity acquisition module is used to obtain entity mentions and their corresponding candidate entity sets from the text to be linked, including: constructing an entity alias table according to the entity linking corpus, the entity alias table including entity mentions and candidate entity sets corresponding to each entity mention; obtaining entity mentions and their corresponding candidate entity sets from the text to be linked according to the entity alias table; the entity alias table is a mapping between entities in the knowledge graph and possible forms in the text; The entity mention and candidate entity encoding module is used to encode the entity mention context and the text description of each candidate entity corresponding to the entity mention to obtain the encoding vector, and calculate the semantic similarity between the entity mention and the candidate entity; An entity mention and candidate entity category prediction module, used to predict the entity mention and candidate entity category using the encoding vector, and calculate the category similarity between the entity mention and the candidate entity; The score calculation module of the candidate entity is used to calculate the score of the candidate entity according to the semantic similarity and the category similarity, including: obtaining the score of the candidate entity by weighted summing the semantic similarity and the category similarity; The link result judgment module is used to judge whether the entity mention points to an empty entity or a candidate entity as a link result according to the scores of all candidate entities, including: If the scores of all candidate entities corresponding to the entity mention are lower than the threshold, the entity mention points to the empty entity, otherwise the candidate entity with the highest score is used as the link result of the entity mention.
9. A memory, characterized in that: A plurality of instructions are stored, and the instructions are used to implement the method for detecting hollow entities in entity links according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It comprises a processor and a memory connected to the processor, wherein the memory stores a plurality of instructions, and the instructions can be loaded and executed by the processor, so that the processor can execute the method for detecting hollow entities in entity links as described in any one of claims 1-7.
