Entity chain refers to a method, apparatus, electronic device, and storage medium

By using a solid chain finger prediction model based on a fully connected neural network in natural language processing, combined with the solid chain finger set in the preset entity library, the problem of poor physical chain finger effect when there are fewer entities is solved, and the effect of improving the accuracy of physical chain finger is achieved.

CN114860878BActive Publication Date: 2025-06-17BEIJING XUEZHITU NETWORK TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210494352.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-06-17
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

When contextual information or entities are small, the entity chain in the prior art refers to poor results and no effective solution exists.

Method used

By obtaining the to-chain finger entity in the first text, recalling the entity chain finger set in the preset entity library, and inputting the entity information based on the entity chain finger prediction model trained based on the fully connected neural network, a second entity chain finger is generated. Then, the entity chain finger result is determined based on the similarity between the second entity chain finger and the first entity chain finger set.

Benefits of technology

This method effectively solves the problem of poor physical chain finger effect when there are fewer context information or entities, reduces the search space and improves the accuracy of physical chain finger.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860878B_ABST
    Figure CN114860878B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, electronic device and storage medium for entity linking. The method includes: obtaining a first text and determining a first entity to be linked in the first text; recalling a plurality of first entity links corresponding to the first entity from a preset entity library; inputting the entity information corresponding to each first entity into a trained entity link prediction model to obtain a second entity link corresponding to the first entity, where the entity link prediction model is trained based on a fully connected neural network and is trained to obtain the entity link corresponding to the entity information according to the input entity information; determining the entity link result according to the similarity between the second entity link and the plurality of first entity links. Through the present application, the problem of poor entity link effect when there is less information or entities in the context in the related art is solved, and the beneficial effects of reducing the search space and improving the entity link accuracy are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular, to an entity linking method, apparatus, electronic device, and storage medium. Background Art

[0002] Entity Linking, also known as entity linking, is a new task in natural language processing, which is used to link the names appearing in the article to the entities designated by them, that is, it is necessary to point out the corresponding items of the object in the Knowledge Base.

[0003] In the entity linking methods in the related art, the entity linking method based on literal and text similarity calculates the similarity degree between entities through indicators such as Edit Distance, Dice coefficient, Jaccard Similarity, Cosine Similarity, Relative Entropy or KL Divergence, and Probabilistic Model Similarity, etc. However, the entity linking method based on literal and text similarity only performs linking based on the literal meaning; the entity linking method based on entity relevance compares the relevance between the entity in the context and the candidate entity. However, for the entity linking method based on entity relevance, when the information or entities in the context are few, the entity linking effect is poor.

[0004] Aiming at the problem that the entity linking effect is poor when the information or entities in the context are few in the related art, there is no effective solution yet. Summary of the Invention

[0005] The present application provides an entity linking method, apparatus, electronic device, and storage medium, so as to at least solve the problem that the entity linking effect is poor when the information or entities in the context are few in the related art.

[0006] In a first aspect, the present application provides an entity linking method, including: obtaining a first text and determining a first entity to be linked in the first text; recalling a first entity linking set corresponding to the first entity from a preset entity library; inputting the entity information corresponding to each first entity into a trained entity linking prediction model to obtain a second entity linking corresponding to the first entity, where the entity linking prediction model is trained based on a fully connected neural network and is trained to obtain the entity linking of the entity corresponding to the input entity information according to the input entity information; determining the entity linking result according to the similarity between the second entity linking and each first entity linking in the first entity linking set.

[0007] In a second aspect, the present application provides an entity linking device, including:

[0008] An obtaining module, configured to obtain a first text and determine a first entity to be linked in the first text;

[0009] A recalling module, configured to recall a first entity linking set corresponding to the first entity from a preset entity library;

[0010] A processing module, configured to input the entity information corresponding to each first entity into a trained entity linking prediction model to obtain a second entity linking corresponding to the first entity, where the entity linking prediction model is trained based on a fully connected neural network and is trained to obtain the entity linking of the entity corresponding to the input entity information according to the input entity information;

[0011] A determining module, configured to determine the entity linking result according to the similarity between the second entity linking and each first entity linking in the first entity linking set.

[0012] In a third aspect, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0013] The memory is used for storing a computer program;

[0014] The processor is configured to implement the steps of the entity linking method according to any one of the embodiments in the first aspect when executing the program stored in the memory.

[0015] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the entity linking method according to any one of the embodiments in the first aspect are implemented.

[0016] This application can be applied to the field of natural language processing for entity recognition and entity linking. The entity linking method, apparatus, electronic device, and storage medium provided by the embodiments of this application obtain a first text and determine a first entity to be linked in the first text; recall multiple first entity links corresponding to the first entity from a preset entity library; input the entity information corresponding to each first entity into a trained entity link prediction model to obtain a second entity link corresponding to the first entity, where the entity link prediction model is trained based on a fully connected neural network and is trained to obtain the entity link of the entity corresponding to the input entity information according to the input entity information; determine the entity link result according to the similarity between the second entity link and the multiple first entity links, solve the problem of poor entity linking effect when there is less information or entities in the context in the related art, and achieve the beneficial effects of reducing the search space and improving the accuracy of entity linking.

[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make the other features, objects, and advantages of this application more comprehensible. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present invention and, together with the specification, are used to explain the principles of the present invention.

[0019] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0020] Figure 1 It is a schematic flowchart of an entity linking method provided by an embodiment of this application;

[0021] Figure 2 It is a schematic structural diagram of an entity linking apparatus according to an embodiment of this application;

[0022] Figure 3 It is a schematic structural diagram of an electronic device according to an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of this application without creative efforts shall fall within the scope of protection of this application.

[0024] Before describing the embodiments of the present application, the related technical means used in the entity linking method of the embodiments of the present application and the problems existing in the related technologies are described as follows.

[0025] In related technologies, entity linking methods include entity linking methods based on literal and text similarity and entity linking methods based on entity relevance. Among them, the corresponding methods of entity linking based on literal and text similarity are simple and highly interpretable, but they do not deeply mine the corpus and entities, and only link based on the literal meaning, resulting in poor entity linking effects for complex knowledge entities; for entity linking methods based on entity relevance, the candidate entity with a high relevance to the context entity is more likely to be the target entity, and better entity linking effects can be achieved when there are sufficient entities in the context. However, when there are few entities in the context, the entity linking effect is not good.

[0026] The various technologies described in the present application can be used for tasks such as entity recognition and linking in natural language understanding and natural language processing.

[0027] Figure 1 It is a schematic flowchart of an entity linking method provided for an embodiment of the present application. As Figure 1 shown, an embodiment of the present application provides an entity linking method, which includes the following steps:

[0028] Step S101, obtain a first text and determine a first entity to be linked in the first text.

[0029] In this embodiment, the first text is a sentence or corpus that needs to point out the relevant information corresponding to the entity in the knowledge base (for example: the category of the entity, other attribute information of the entity, such as: alias, brief introduction). For example: He went to City B. In this sentence, "B" is the entity that needs to point out the relevant information corresponding to it in the knowledge base, that is, the first entity; at the same time, the first text is a text that only annotates the entity and needs to link the annotated entity to the relevant information corresponding to it in the knowledge base.

[0030] In this embodiment, the first entity can be determined through entity information related to the entity in the text content corresponding to the first text, such as: the entity name.

[0031] Step S102, recall a first entity linking set corresponding to the first entity from a preset entity library.

[0032] In this embodiment, the preset entity library is a standard entity library, which includes standard entities (entity names), entity categories, and other entity attributes and attribute values (e.g., aliases). The entity category and other entity attributes and attribute values constitute the knowledge information of the standard entity, and this knowledge information is used as the entity link pointer of the entity.

[0033] In this embodiment, the first entity link pointer set recalled from the preset entity library is the standard entity in the standard entity library. Since the entity link pointer result corresponding to the standard entity has been represented by the corresponding knowledge information, therefore, by recalling the corresponding standard entity set in the standard entity library, the recall of the first entity link pointer set is correspondingly completed; in this embodiment, when recalling the standard entity corresponding to the first entity link pointer set, if the name or alias of an entity in the standard entity library contains the entity name of the first entity in the first text, then it is determined that this entity is the entity to be recalled.

[0034] In this embodiment, the entity link pointer result of the first text is determined according to the data of the recalled corresponding standard entity. When there are multiple recalled corresponding standard entities, entity link pointer recognition is performed on the standard entities corresponding to each first entity. When there is only one recalled corresponding standard entity, then this recalled standard entity corresponds to the entity link pointer result of the first text. When no standard entity is recalled, it means that the first text is an empty entity.

[0035] Step S103: Input the entity information corresponding to each first entity into the trained entity link pointer prediction model to obtain the second entity link pointer corresponding to the first entity. Among them, the entity link pointer prediction model is trained based on a fully connected neural network and is trained to obtain the entity link pointer of the entity corresponding to the input entity information.

[0036] In this embodiment, an entity link pointer prediction model trained by a fully connected neural network (Full Connection, abbreviated as FC) is used to predict the entity link pointer. That is, the entity link pointer result corresponding to the first entity is predicted through the entity name corresponding to the first entity, and then based on the predicted entity link pointer result and the entity link pointer corresponding to the entity in the standard entity library, screening is performed to determine the entity link pointer of the first entity; in this embodiment, the standard entities recalled from the standard entity library are used for neural network training. Among them, FC is a most basic neural network structure, and each node in the FC neural network except the input layer is connected to all nodes in the previous layer.

[0037] Step S104: Determine the entity link pointer result according to the similarity between the second entity link pointer and each first entity link pointer in the first entity link pointer set.

[0038] In this embodiment, the ultimate goal of entity linking is to link to the standard entities in the standard entity library. Therefore, the predicted entity linking result is used as the screening condition for the target entity link in the entity links recalled from the standard entity library (candidate entity link results), that is, the target entity link is determined based on the similarity between the second entity link and the first entity link, and the first entity link with a high similarity is selected as the entity link result. In this way, the accuracy of entity linking is improved.

[0039] Through the above steps S101 to S104, the method includes obtaining a first text and determining a first entity to be linked in the first text; recalling a plurality of first entity links corresponding to the first entity from a preset entity library; inputting the entity information corresponding to each first entity into a trained entity link prediction model to obtain a second entity link corresponding to the first entity, where the entity link prediction model is trained based on a fully connected neural network and is trained to obtain the entity link of the entity corresponding to the input entity information according to the input entity information; and determining the entity link result according to the similarity between the second entity link and the plurality of first entity links, solving the problem of poor entity link effect when there is less information or entities in the context in the related art, and achieving the beneficial effects of reducing the search space and improving the accuracy of entity linking.

[0040] It should be noted that in this embodiment, when performing entity linking on an entity, entity linking is performed on one entity and then on the next entity; of course, when recalling entities, standard entities can be recalled for all entities in the text, that is, the corresponding entity link set.

[0041] In some embodiments, according to the similarity between the second entity link and each first entity link in the first entity link set in step S104, determining the entity link result can be implemented through the following steps:

[0042] Step 21: Calculate the similarity between the word vector corresponding to each first entity link and the word vector corresponding to the second entity link.

[0043] In this embodiment, the similarity based on word vectors is used to determine the corresponding target entity link, that is, the corresponding first entity link is selected according to the second entity link.

[0044] In some alternative embodiments, the word vector corresponding to the first entity link includes the average word vector corresponding to all the words of the first entity link, and the word vector corresponding to the second entity link includes the average word vector corresponding to all the words of the second entity link, where the word vector of the entity link is generated by processing the corresponding entity link through a bidirectional attention neural network model Bert.

[0045] In this embodiment, a Bidirectional Encoder Representations from Transformers (Bert for short) is used to process the first entity link pointer and the second entity link pointer, and generate word vectors corresponding to the first entity link pointer and the second entity link pointer respectively. Among them, the BERT model is a language representation model. The goal of the BERT model is to train with a large-scale unlabeled corpus to obtain the semantic representation of the text containing rich semantic information, and then fine-tune the semantic representation of the text in a specific natural language understanding (NLP) task, and finally apply it to this NLP task. It should be understood that the Bert language model is a well-known semantic vector processing model. The method or method of using the Bert language model to process the corresponding entity link pointer and generate the corresponding word vector should be considered clear.

[0046] In this embodiment, when the word vectors corresponding to the first entity link pointer and the second entity link pointer are obtained respectively, a known similarity calculation method can be used to calculate the similarity of the corresponding word vectors, such as Euclidean distance and cosine similarity.

[0047] Step 22: Select a third entity link pointer from the first entity link pointer set, and determine that the entity link pointer result includes the third entity link pointer, where the third entity link pointer is the first entity link pointer with the largest similarity to the word vector of the second entity link pointer.

[0048] In this embodiment, all the first entity link pointers in the first entity link pointer set are sorted in descending order of similarity to the word vector of the second entity link pointer (corresponding to sorting the recalled standard entities), and the first entity link pointer with the highest similarity is selected as the third entity link pointer and used as the entity link pointer of the corresponding first entity, that is, the entity link pointer result of the first text includes this third entity link pointer.

[0049] By calculating the similarity of the word vector corresponding to each first entity link pointer and the word vector corresponding to the second entity link pointer in the above steps; selecting a third entity link pointer from the first entity link pointer set, and determining that the entity link pointer result includes the third entity link pointer, where the third entity link pointer is the first entity link pointer with the largest similarity to the word vector of the second entity link pointer, and using the sorting based on the similarity of word vectors as the strategy for link pointer selection, the confirmation of the entity link pointer result is realized, and the accuracy of the entity link pointer is improved.

[0050] In some of these embodiments, recalling the first entity link pointer set corresponding to the first entity in step S102 from the preset entity library can be achieved through the following steps:

[0051] Step 31: Obtain a first entity parameter table corresponding to a preset entity library, where the first entity parameter table includes entity information, entity links, and correspondence information between the entity information and the entity links.

[0052] In this embodiment, the first entity parameter table refers to standard entities stored in the form of a parameter table, which is a representation of the standard entity library. By looking up the table, the entity name, entity category, other attribute information, knowledge information, etc. of the corresponding standard entity can be queried.

[0053] Step 32: In the first entity parameter table, query the entity link corresponding to the entity information of the first entity, where the first entity link set includes the entity link corresponding to the entity information of the first entity.

[0054] In this embodiment, the entity information of the first entity is the descriptive information of the first entity. For example: entity name. When querying the entity link corresponding to the entity information of the first entity, the first entity parameter table is traversed according to the corresponding entity information. When the entity information corresponding to the first entity corresponds or is associated with the entity (entity name), the name of the entity category, and the attribute value of other attributes in the first entity parameter table, the corresponding entity is the entity to be recalled. For example: when the entity name a corresponding to the entity information of the first entity matches the name a' of the alias in other attributes of the standard entity S in the first entity parameter table, the standard entity S is the entity to be recalled, and the entity link corresponding to the standard entity S corresponds to the first entity link.

[0055] By obtaining the first entity parameter table corresponding to the preset entity library in the above steps, the first entity parameter table includes entity information, entity links, and correspondence information between the entity information and the entity links; in the first entity parameter table, query the entity link corresponding to the entity information of the first entity, and the first entity link set includes the entity link corresponding to the entity information of the first entity, the recall of the entity in the first text is realized, thereby obtaining the candidate entity link of the entity link, and by adopting the method of looking up the table, the efficiency of entity recall and entity link is improved.

[0056] In some embodiments, determining the first entity to be linked in step S101 is achieved by implementing the following steps: detecting the first entity name in the first text, and determining the first entity to be linked according to the detected first entity name.

[0057] In this embodiment, the detection of the entity is completed by reading the entity name representing the entity; in some alternative embodiments, character extraction from the text content of the text can be used, and the first entity name is verified according to the extracted characters, thereby determining the first entity.

[0058] In some of these embodiments, after recalling the first entity chain finger set corresponding to the first entity from the preset entity library in step S102, the following steps are further implemented:

[0059] Step 41: Determine the number of first entity chain fingers in the recalled first entity chain finger set.

[0060] In this embodiment, whether the corresponding standard entity can be recalled, that is, whether the corresponding entity chain finger can be recalled, is related to the first entity in the first text. Specifically, it is determined by whether the first entity can match the corresponding standard entity in the preset entity library (standard entity library). Moreover, whether the corresponding standard entity can be recalled also affects the corresponding entity chain finger result.

[0061] In this embodiment, by determining or counting the number of the recalled first entity chain fingers, the entity chain finger result can be quickly confirmed.

[0062] Step 42: When it is determined that the first entity chain finger set includes a single first entity chain finger, determine that the entity chain finger result corresponding to the first text includes the first entity chain finger.

[0063] In this embodiment, when only one first entity chain finger is recalled, that is, when only one standard entity is recalled, the corresponding entity chain finger result must be the standard entity and the entity chain finger corresponding to the standard entity.

[0064] Step 43: When it is determined that the first entity chain finger set is an empty set, determine that the entity chain finger result corresponding to the first text includes an empty entity for the first text.

[0065] In this embodiment, when no first entity chain finger is recalled, that is, when no standard entity is recalled, the corresponding entity chain finger result is empty, an empty entity corresponding to the first text.

[0066] In this embodiment, when multiple standard entities are recalled, the corresponding standard entity or entity chain finger selection step is executed downward, that is, steps S103 to S104 are continued to be executed.

[0067] Through the above steps, the entity chain finger result is quickly determined according to the recalled entity, the processing of invalid entity chain fingers is reduced, and the efficiency of entity chain finger is further improved.

[0068] In some of these embodiments, the following steps are further implemented: The entity chain finger prediction model is trained through the following steps:

[0069] Step 51: Obtain the text data corresponding to the second entity with entity chain fingers from the preset entity library, convert the text data according to the preset format, and input the converted text data into the Bert model to obtain the semantic vector corresponding to the text data.

[0070] In this embodiment, the data for training is the text data composed of all information of standard entities from the standard entity library; in this embodiment, before inputting the data into the initial fully connected neural network model, the corresponding text data is processed using the Bert model, so the text data needs to be converted according to the data format of the Bert model.

[0071] In this embodiment, the format conversion of the text data includes: adding a cls flag before the text, where CLS represents the classification of the corresponding entity; adding a start flag for marking the position of the entity in the text and an end flag before and after the entity name in the text, adding a sep flag at the end of the text to represent the entity chain reference, and at the same time, adding the knowledge information of a certain standard entity in the recalled standard entity set after the sep flag, that is, adding the information corresponding to the entity chain reference; in some alternative embodiments, adding the knowledge information of a certain standard entity in the recalled standard entity set is to first add the name of the standard entity after the sep identifier, and then add the string composed of the attributes and attribute values of the standard entity in the knowledge base after the name of the standard entity, in the form of "attribute 1: attribute value 1, attribute 2: attribute value 2, ". After completing the conversion according to the preset data format, it is processed by the Bert model to obtain the corresponding semantic vector.

[0072] Step 52: In the semantic vector, obtain the first vector corresponding to the word for the second entity classification and the second vector corresponding to the entity chain reference of the second entity.

[0073] In this embodiment, in the semantic vector, obtain and splice the output vectors corresponding to the cls flag, start flag, and end flag to form the first vector, and obtain and splice the output vectors corresponding to the sep flag, start flag, and end flag to form the second vector.

[0074] Step 53: Input the first vector and the second vector into the initial fully connected neural network respectively, and train the initial fully connected neural network to obtain the category judgment loss function and the entity chain reference loss function correspondingly.

[0075] In this embodiment, by inputting the first vector into the fully connected layer of the fully connected neural network, predict the category of the corresponding entity in the corresponding text data to obtain the category judgment loss; by inputting the second vector into the fully connected layer of the fully connected neural network, predict the chain reference result of the entity in the text data and the entity from the knowledge base in the input data to obtain the entity chain reference loss.

[0076] Step 54: Generate a combined loss function based on the category judgment loss function and the entity linking loss function, and retrain the initial fully connected neural network with the combined loss function as the target loss function until fitting to obtain an entity linking prediction model.

[0077] In this embodiment, a combined loss function composed of a category judgment loss function and an entity linking loss function is used to quickly reduce the loss of the entity linking prediction model. By designing a multi-task model for category judgment and entity linking, the mining of the category information of the linked entity is enhanced, the search space is reduced, and the accuracy of entity linking is improved.

[0078] It should be noted that the steps shown in the above process or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0079] This embodiment also provides an entity linking device, which is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0080] Figure 2 is the structural block diagram of the entity linking device of the embodiment of the present application. As Figure 2 shown, the device includes:

[0081] An acquisition module 21, configured to acquire a first text and determine a first entity to be linked in the first text;

[0082] A recall module 22, coupled to the acquisition module 21, configured to recall a first entity linking set corresponding to the first entity from a preset entity library;

[0083] A processing module 23, coupled to the recall module 22, configured to input the entity information corresponding to each first entity into a trained entity linking prediction model to obtain a second entity linking corresponding to the first entity, where the entity linking prediction model is trained based on a fully connected neural network and is trained to obtain the entity linking of the entity corresponding to the input entity information according to the input entity information;

[0084] A determination module 24, coupled to the processing module 23, configured to determine an entity linking result according to the similarity between the second entity linking and each first entity linking in the first entity linking set.

[0085] Through the device according to the embodiments of the present application, the method includes obtaining a first text and determining a first entity to be linked in the first text; recalling a plurality of first entity links corresponding to the first entity from a preset entity library; inputting the entity information corresponding to each first entity into a trained entity link prediction model to obtain a second entity link corresponding to the first entity, where the entity link prediction model is trained based on a fully connected neural network and is trained to obtain the entity link of the entity corresponding to the input entity information according to the input entity information; determining the entity link result according to the similarity between the second entity link and the plurality of first entity links, solving the problem of poor entity link effect when there is less information or entities in the context in the related art, and achieving the beneficial effects of reducing the search space and improving the entity link accuracy.

[0086] In some embodiments, the determining module 24 further includes:

[0087] A first calculation unit, configured to calculate the similarity between the word vector corresponding to each first entity link and the word vector corresponding to the second entity link;

[0088] A first determination unit, coupled to the first calculation unit, configured to select a third entity link from the first entity link set and determine that the entity link result includes the third entity link, where the third entity link is the first entity link with the largest similarity to the word vector of the second entity link.

[0089] In some embodiments, the word vector corresponding to the first entity link includes the average word vector corresponding to all words of the first entity link, and the word vector corresponding to the second entity link includes the average word vector corresponding to all words of the second entity link, where the word vector of the entity link is generated by processing the corresponding entity link through a bidirectional attention neural network model Bert.

[0090] In some embodiments, the recall module 22 further includes:

[0091] A first obtaining unit, configured to obtain a first entity parameter table corresponding to the preset entity library, where the first entity parameter table includes entity information, entity links, and correspondence information between the entity information and the entity links;

[0092] A first query unit, coupled to the first obtaining unit, configured to query the entity link corresponding to the entity information of the first entity in the first entity parameter table, where the first entity link set includes the entity links corresponding to the entity information of the first entity.

[0093] In some embodiments, the obtaining unit 21 is further configured to detect a first entity name in the first text and determine the first entity to be linked according to the detected first entity name.

[0094] In some of these embodiments, the entity chain pointing device is further configured to, after recalling a first entity chain pointing set corresponding to a first entity from a preset entity library, determine the number of first entity chain pointings in the recalled first entity chain pointing set; when it is determined that the first entity chain pointing set includes a single first entity chain pointing, determine that the entity chain pointing result corresponding to the first text includes the first entity chain pointing; when it is determined that the first entity chain pointing set is an empty set, determine that the entity chain pointing result corresponding to the first text includes that the first text is an empty entity.

[0095] Figure 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As Figure 3 shown, an embodiment of the present application provides an electronic device, including a processor 31, a communication interface 32, a memory 33, and a communication bus 34. Among them, the processor 31, the communication interface 32, and the memory 33 complete mutual communication through the communication bus 34.

[0096] The memory 33 is used to store a computer program.

[0097] The processor 31, when executing the program stored on the memory 33, implements Figure 1 the method steps in

[0098] The processing in the server implements Figure 1 the method steps in Figure 1 The technical effects brought by the entity chain pointing method are the same as those of the above embodiments executing

[0099] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 3 only a thick line is used to represent it in

[0100] The communication interface is used for communication between the above electronic device and other devices.

[0101] The memory may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0102] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU for short), a Network Processor (NP for short), etc.; it may also be a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuit (ASIC for short), a Field-Programmable Gate Array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0103] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the entity chain pointing method provided in any of the foregoing method embodiments are implemented.

[0104] In another embodiment provided by the present application, a computer program product containing instructions is also provided. When it runs on a computer, the computer is caused to execute the entity chain pointing method in any of the above embodiments.

[0105] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without more limitations, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0106] The above are only specific implementation manners of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An entity linking method, characterized in that, Including: Obtain a first text and determine a first entity to be entity-linked in the first text; Recall a first entity link set corresponding to the first entity from a preset entity library; wherein, the preset entity library is a standard entity library, and the standard entity library includes standard entities, entity categories, and entity attribute values; the first entity link set recalled from the preset entity library is a standard entity in the standard entity library; when recalling the standard entity corresponding to the first entity link set, if the name or alias of an entity in the standard entity library contains the entity name of the first entity in the first text, then determine this entity as the standard entity to be recalled; Determine the number of the first entity links in the recalled first entity link set; When it is determined that the first entity link set includes a single first entity link, determine that the entity link result corresponding to the first text includes the first entity link; When it is determined that the first entity link set is an empty set, determine that the entity link result corresponding to the first text includes the first text as an empty entity; When multiple standard entities are recalled, input the entity information corresponding to each first entity into a trained entity link prediction model to obtain a second entity link corresponding to the first entity, wherein the entity link prediction model is trained based on a fully connected neural network and is trained to obtain the entity link corresponding to the input entity information according to the input entity information; Determine the entity link result according to the similarity between the second entity link and each first entity link in the first entity link set.

2. The method according to claim 1, characterized in that, Determining the entity link result according to the similarity between the second entity link and each first entity link in the first entity link set includes: Calculate the similarity between the word vector corresponding to each first entity link and the word vector corresponding to the second entity link; Select a third entity link in the first entity link set and determine that the entity link result includes the third entity link, where the third entity link is the first entity link with the maximum similarity to the word vector of the second entity link.

3. The method according to claim 2, characterized in that, The word vector corresponding to the first entity link includes the average word vector corresponding to all the words of the first entity link, and the word vector corresponding to the second entity link includes the average word vector corresponding to all the words of the second entity link, wherein the word vector of the entity link is generated by processing the corresponding entity link through a bidirectional attention neural network model Bert.

4. The method according to claim 1, characterized in that, Recalling a first entity link set corresponding to the first entity from a preset entity library includes: Obtain a first entity parameter table corresponding to the preset entity library, wherein the first entity parameter table includes entity information, entity links, and the correspondence information between the entity information and the entity links; In the first entity parameter table, query the entity link corresponding to the entity information of the first entity, wherein the first entity link set includes the entity link corresponding to the entity information of the first entity.

5. The method according to claim 1, characterized in that, Determining the first entity to be entity-linked in the first text includes: detecting the name of the first entity in the first text, and determining the first entity to be entity-linked according to the detected name of the first entity.

6. The method according to claim 1, characterized in that, The training process of the entity-linking prediction model includes: Obtaining the text data corresponding to the second entity with entity-linking from the preset entity library, converting the text data into a preset format, and inputting the converted text data into a Bert model to obtain a semantic vector corresponding to the text data; In the semantic vector, obtaining a first vector corresponding to the word for classifying the second entity and a second vector corresponding to the entity-linking of the second entity; Inputting the first vector and the second vector into an initial fully connected neural network respectively, and training the initial fully connected neural network to obtain a class judgment loss function and an entity-linking loss function correspondingly; Generating a joint loss function based on the class judgment loss function and the entity-linking loss function, and retraining the initial fully connected neural network with the joint loss function as the target loss function until fitting to obtain the entity-linking prediction model.

7. An entity linking device, characterized in that, Including: An acquisition module, configured to acquire a first text and determine the first entity to be entity-linked in the first text; A recall module, configured to recall a first entity-linking set corresponding to the first entity from a preset entity library; wherein, the preset entity library is a standard entity library, and the standard entity library includes standard entities, entity categories, and entity attribute values; the first entity-linking set recalled from the preset entity library is the standard entity in the standard entity library; when recalling the standard entity corresponding to the first entity-linking set, if the name or alias of an entity in the standard entity library contains the entity name of the first entity in the first text, then determine that entity as the standard entity to be recalled; The entity-linking device is further configured to, after recalling the first entity-linking set corresponding to the first entity from the preset entity library, determine the number of the first entity-linkings in the recalled first entity-linking set; when determining that the first entity-linking set includes a single first entity-linking, determining that the entity-linking result corresponding to the first text includes the first entity-linking; when determining that the first entity-linking set is an empty set, determining that the entity-linking result corresponding to the first text includes that the first text is an empty entity; A processing module, configured to, when multiple standard entities are recalled, input the entity information corresponding to each first entity into the trained entity-linking prediction model to obtain a second entity-linking corresponding to the first entity, wherein the entity-linking prediction model is trained based on a fully connected neural network and is trained to obtain the entity-linking of the entity corresponding to the input entity information; A determination module, configured to determine the entity-linking result according to the similarity between the second entity-linking and each first entity-linking in the first entity-linking set.

8. An electronic device, characterized in that, Including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used for storing a computer program; A processor, when executing a program stored in a memory, implements the steps of the entity chain pointing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, it implements the steps of the entity chain pointing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Entity disambiguation method and device, equipment and storage medium

    CN114021570A