Entity linking method, device, equipment and medium
By extracting feature data from entity linking and matching it with the preset feature library, and combining it with vector calculation, the problems of limited manual organization of correspondences and the consumption of labeled data in model matching in the existing technology are solved, and efficient and accurate entity linking is achieved.
Patent Information
- Application Number
- CN202210470501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the existing technology, the entities corresponding to the mentioned words in network data may be diverse, and the manually sorted correspondences are limited. Relying solely on model matching requires a large amount of labeled data for training, which makes it difficult to achieve good results.
By extracting feature data from the target data and matching it with the entity features in the preset feature library, the linked entities of the target data are determined by combining feature matching and vector calculation.
It improves the accuracy and recall of entity linking, reduces the need for manual data annotation, and improves the efficiency of entity linking.
Smart Images

Figure CN114860954B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to an entity linking method, apparatus, device and medium. Background Art
[0002] With the exponential growth of online data, the web has become one of the largest data repositories, and a vast amount of data is presented online in the form of natural language. However, natural language itself is highly ambiguous, especially for frequently occurring entities, which may correspond to multiple names. Therefore, if we can connect word mentions in online data with entities in knowledge bases, we can annotate natural language on the web, which will greatly facilitate our understanding of the semantic information of online data. However, the entities corresponding to word mentions may be diverse, and manually compiled correspondences are limited. Relying solely on model matching requires a large amount of labeled data for training, making it difficult to achieve effective results.
[0003] Regarding the above-mentioned problem that "the entities corresponding to the mentioned words may be diverse, the manually sorted correspondences are limited, and relying solely on model matching requires a large amount of labeled data for training, which is difficult to achieve good results", no effective solution has been proposed so far. Summary of the Invention
[0004] The present application provides an entity linking method, apparatus, device and medium to solve or at least partially solve the above-mentioned technical problem that "the entities corresponding to the mentioned words may be diverse, the manually sorted correspondences are limited, and relying solely on model matching requires a large amount of labeled data for training, which makes it difficult to achieve good results."
[0005] According to one aspect of an embodiment of the present application, the present application provides an entity linking method, comprising: extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; matching the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including multiple entity data; and determining the target entity to be linked to the target data based on the matching result.
[0006] Optionally, matching the feature data with the entity features in the preset feature library includes: matching the first main feature in the feature data with the second main feature of each entity feature respectively; when there are multiple entity features and all the second main features completely match the first main feature, determining the entities corresponding to the multiple entity features as the first candidate entity, and matching the first secondary feature with the second secondary features of the multiple first candidate entities respectively, wherein the feature data includes the first main feature and the first secondary feature, and the entity features include the second main feature and the second secondary feature; when the number of first candidate entities whose number of second secondary features matched with the first secondary feature is greater than or equal to the first threshold is greater than or equal to zero, determining the first candidate entity whose number of second secondary features matched with the first secondary feature is greater than or equal to the first threshold as the second candidate entity.
[0007] Optionally, after matching the first main element in the element data with the second main element of each entity element respectively, the method further includes: when there is only one entity element whose second main element completely matches the first main element, determining the entity data corresponding to the entity element as a second candidate entity; when there is no entity element whose second main element completely matches the first main element, determining that the second candidate entity does not exist.
[0008] Optionally, determining the target entity to be linked to the target data based on the matching result includes: when there is no second candidate entity, determining that there is no target entity to be linked to the target data; when there is a second candidate entity and the number of second candidate entities is one, determining the second candidate entity as the target entity to be linked to the target data; when there is a second candidate entity and the number of second candidate entities is greater than or equal to two, using the similarity between the target data and each second candidate entity to determine the target entity to be linked to the target data.
[0009] Optionally, using the similarity between the target data and each second candidate entity to determine the target entity to be linked to the target data includes: using a preset vector model to convert each second candidate entity into an entity vector, and converting the target data into a target vector; respectively determining the similarity between each entity vector and the target vector, and determining the second candidate entity corresponding to the entity vector whose similarity is greater than or equal to a preset threshold as the target entity to be linked to the target data.
[0010] Optionally, extracting element data from target data includes: obtaining an element dictionary, and using the element dictionary to extract initial data from the target data, wherein the initial data is the characters in the target data, and the element dictionary includes various types of standard element words and synonymous element words; when the initial data belongs to a standard element word, the initial data is directly determined as element data; when the initial data belongs to a synonymous element word, the standard element word corresponding to the initial data is obtained, and the standard element word is determined as element data.
[0011] Optionally, the method further includes training in the following manner to obtain a preset vector model: obtaining training data and streamlining the training data to obtain training sentences; using the TSDAE framework to input the training sentences into the initial model for training, and outputting the training results; when the training results indicate that the matching accuracy of the initial model for the training sentences reaches a second threshold, the initial model is determined as the preset vector model.
[0012] According to another aspect of the embodiments of the present application, the present application also provides an entity linking device, including: an extraction module for extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; a matching module for matching the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including multiple entity data; a determination module for determining the target entity to be linked to the target data based on the matching result.
[0013] According to another aspect of an embodiment of the present application, the present application also provides an electronic device, including a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, the memory and the processor communicate through the communication bus and the communication interface, and the processor implements the steps of any of the above methods when executing the computer program.
[0014] According to another aspect of the embodiments of the present application, the present application also provides a computer-readable medium having a non-volatile program code executable by a processor, where the program code enables the processor to execute any of the above methods.
[0015] The technical solution of this application can be applied to the design of natural language processing using deep learning technology.
[0016] The above technical solution provided by the embodiment of the present application has the following advantages compared with the related art:
[0017] The present application provides an entity linking method, comprising: extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; matching the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including multiple entity data; and determining a target entity to be linked to the target data based on the matching result.
[0018] This application determines the linked entities corresponding to the target data by performing feature matching between the target data and entities in a preset feature library, thereby solving the problems of low efficiency of manual matching and the need for a large amount of labeled data for model matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 A flowchart of an optional entity linking method provided according to an embodiment of the present application;
[0022] Figure 2 A block diagram of an optional entity linking device provided according to an embodiment of the present application;
[0023] Figure 3 The present invention provides an optional schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0025] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0026] With the exponential growth of online data, the web has become one of the largest data repositories, and a vast amount of data is presented online in the form of natural language. However, natural language itself is highly ambiguous, especially for frequently occurring entities, which may correspond to multiple names. Therefore, if we can connect word mentions in online data with entities in knowledge bases, we can annotate natural language on the web, which will greatly facilitate our understanding of the semantic information of online data. However, the entities corresponding to word mentions may be diverse, and manually compiled correspondences are limited. Relying solely on model matching requires a large amount of labeled data for training, making it difficult to achieve effective results.
[0027] In some existing solutions, entity linking directly converts candidate and entity information into vectors and calculates the similarity between these vectors. Vector representation methods cannot accurately represent the associated entity information and often match mentions and entities with similar structures but different meanings, resulting in low accuracy. Furthermore, methods that directly use vectors rely heavily on training vector representation models and training data. Achieving good results often requires a large amount of labeled data, which also requires significant manual annotation efforts. Other existing solutions require entity linking by obtaining entity descriptions, attributes, and relationships from a knowledge base. These solutions rely on extensive manual curation and knowledge base construction to obtain relevant entity information. Entity linking cannot be performed for entities that are not available or have no relevant information. Furthermore, for entity linking tasks, the information in the knowledge base may contain a lot of redundant information or be insufficient to distinguish between different entities. Therefore, methods built on this information struggle to achieve good results. Many solutions perform entity linking by directly calculating similarity between mentions and entities. These solutions only identify the most relevant entities to a mention and cannot accurately determine whether multiple entities correspond to the mention.
[0028] In order to solve the problems mentioned in the background technology, according to one aspect of the embodiments of the present application, the present application provides an entity linking method, such as Figure 1 Shown, including:
[0029] Step 101: extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data;
[0030] Step 103: Match the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including a plurality of entity data;
[0031] Step 105: Determine the target entity to be linked to the target data according to the matching result.
[0032] Specifically, entity linking involves associating entity mentions in natural language text with corresponding knowledge graph entities, such as corresponding entries in standard databases, knowledge bases, gazetteers, and Wikipedia pages. For example, for the text "Jordan is a famous American NBA basketball player," the strings "Jordan," "USA," and "NBA" should be mapped to the corresponding entities in a pre-set feature library.
[0033] The difficulty of entity linking lies in the phenomenon of multiple words with the same meaning. For example, an entity's standard name, alias, and abbreviation can all be used to refer to the entity. Through manual organization, we can match some commonly mentioned words with entities and map these words to entities by querying the knowledge base. However, in online data, each entity may correspond to a variety of words. Manual organization of correspondences is limited, making it difficult to achieve effective results.
[0034] Optionally, the preset feature library is a pre-organized feature library of multiple entities, including the main features and secondary features of the entity, as well as synonymous features of each main feature and / or each secondary feature. The data source can be pre-collected entity data of different categories, or the target data after identification is completed is updated to the preset feature library.
[0035] This application matches the main elements and secondary elements of the target data (i.e., the mentioned words) with the entity elements of the preset element library respectively to obtain data of the target entity with higher correlation for linking. Based on the element matching method, the accuracy is improved and the problem of one-to-many is solved.
[0036] As an optional embodiment, matching feature data with entity features in a preset feature library includes: matching the first main feature in the feature data with the second main feature of each entity feature respectively; when there are multiple entity features and all the second main features completely match the first main feature, determining the entities corresponding to the multiple entity features as first candidate entities, and matching the first secondary feature with the second secondary features of the multiple first candidate entities respectively, wherein the feature data includes the first main feature and the first secondary feature, and the entity features include the second main feature and the second secondary feature; when the number of first candidate entities whose number of second secondary features matched with the first secondary feature is greater than or equal to the first threshold is greater than or equal to zero, determining the first candidate entity whose number of second secondary features matched with the first secondary feature is greater than or equal to the first threshold as the second candidate entity.
[0037] Optionally, the matching method of the element words may be keyword matching, semantic matching, etc., which is not limited in this application.
[0038] Specifically, the pre-set feature library is pre-classified into primary and secondary features. When constructing different feature vocabularies, part-of-speech recognition is first performed to identify noun features, such as "fruit type," "place name," and "trademark name." These features are then filtered through the standard vocabularies. Noun feature types that appear in the standard vocabularies and can be distinguished from different standard terms are considered primary features, resulting in a feature type table for the primary features. During the matching process, the existing feature type table for the primary features is used to distinguish primary and secondary features.
[0039] Since the main elements can more accurately represent the attributes, properties or meanings of the mentioned words, the first main element of the target data is first matched with the second main element of each entity in the preset element library, and then the entity whose all second main elements completely match the first main element of the target data is determined as the first candidate entity, that is, the entity that enters the next round of secondary element matching.
[0040] Specifically, the first threshold may be set in advance according to the number of matched elements.
[0041] Optionally, the first minor element is matched with the second minor elements of multiple first candidate entities respectively, the number of factor words in the second minor elements of the first candidate entities that are the same as the first minor element of the target data is queried, and the first candidate entity with the largest number of matches is determined as the second candidate entity. For example, if there are 10 first candidate entities, the first minor element of the target data is matched with the second minor elements of the 10 first candidate entities respectively, and the matching results are that the second minor elements of 4 first candidate entities have 5 factor words that are the same as the first minor element of the target data, the second minor elements of 3 first candidate entities have 4 factor words that are the same as the first minor element of the target data, the second minor elements of 2 first candidate entities have 2 factor words that are the same as the first minor element of the target data, and the second minor element of 1 first candidate entity has 1 factor word that is the same as the first minor element of the target data, then the first threshold is 5, and the 4 first candidate entities with the largest number of matches (5 factor words matched) are determined as the second candidate entities.
[0042] As an optional embodiment, after matching the first main element in the element data with the second main element of each entity element respectively, the method also includes: when there is only one entity element whose second main element completely matches the first main element, determining the entity data corresponding to the entity element as a second candidate entity; when there is no entity element whose second main element completely matches the first main element, determining that the second candidate entity does not exist.
[0043] Optionally, when the second main element of the non-existent entity element completely matches the first main element, we can determine that the second candidate entity does not exist, that is, the target entity to be linked to the target data does not exist. If we still want to find the target entity closest to the target data, we can determine the entity corresponding to the entity element with the largest number of matches with the first main element as the target entity.
[0044] Optionally, when there is only one entity element whose second main element completely matches the first main element, the entity data corresponding to the entity element may be directly determined as the second candidate entity, ie, determined as the target entity to be linked to the target data.
[0045] As an optional embodiment, determining the target entity to be linked to the target data based on the matching results includes: when there is no second candidate entity, determining that there is no target entity to be linked to the target data; when there is a second candidate entity and the number of second candidate entities is one, determining the second candidate entity as the target entity to be linked to the target data; when there is a second candidate entity and the number of second candidate entities is greater than or equal to two, using the similarity between the target data and each second candidate entity to determine the target entity to be linked to the target data.
[0046] After the first main element and the first secondary element of the target data are matched with the entity elements in the preset element library, no matter how many entities ultimately meet the matching conditions (provided that they are not zero), they are determined as the second candidate entities.
[0047] When there is no second candidate entity, it is determined that the target entity to be linked does not exist in the target data, and the result that the target entity does not exist is directly returned to the user; when there is a second candidate entity and the number of second candidate entities is one, the second candidate entity is determined as the target entity to be linked in the target data, and the target entity is directly returned to the user as the link result.
[0048] When there are second candidate entities and the number of the second candidate entities is greater than or equal to two, we will continue to determine the target entity from the multiple second candidate entities. The following further describes the method for further determining the target entity.
[0049] As an optional embodiment, using the similarity between the target data and each second candidate entity to determine the target entity to be linked to the target data includes: using a preset vector model to convert each second candidate entity into an entity vector, and converting the target data into a target vector; determining the similarity between each entity vector and the target vector respectively, and determining the second candidate entity corresponding to the entity vector whose similarity is greater than or equal to a preset threshold as the target entity to be linked to the target data.
[0050] By inputting each second candidate entity into the preset vector model, the entity vector corresponding to each second candidate entity can be obtained. Similarly, the target data is input into the preset vector model to obtain the target vector, and then the cosine similarity between the target vector and each entity vector is calculated respectively.
[0051] Specifically, the formula for calculating cosine similarity is:
[0052]
[0053] Among them, P (,) Represents the cosine value of the target vector and the i-th entity vector, the target vector is (x1, y1), the i-th entity vector is (x i ,y i ).
[0054] The cosine value ranges from -1 to 1. The closer the value is to 1, the closer the directions of the two vectors are (i.e., the more similar they are); the closer it is to -1, the more opposite their directions are; and the closer it is to 0, the more orthogonal the two vectors are.
[0055] After determining the cosine values of the target vector and each entity vector, the cosine values are sorted from largest to smallest, and then a threshold is determined based on the number of target entities to be retrieved. For example, if three target entities are to be retrieved, the third cosine value is directly used as the threshold. This will find three entity vectors with a similarity greater than or equal to the threshold, thus determining the corresponding three target entities.
[0056] Optionally, one target data can match multiple target entities with high similarity.
[0057] This application first obtains multiple second candidate entities through feature matching, and then determines the similarity between entities through vector calculation, avoiding the problem of matching some mention words and entities with similar structures but different meanings together.
[0058] Optionally, the present application also provides an optional embodiment. When the matching result based on elements indicates that there is no entity element that matches the first main element or the first secondary element of the target data, that is, there is no first candidate entity and second candidate entity, the matched entity is directly converted into a vector using a preset vector model, and then the target data and each entity vector are matched based on the vector, and the matching result is returned to the user after obtaining the matching result.
[0059] The embodiment provided in this application is based on a method that combines feature matching and vector calculation, which improves accuracy while also ensuring recall rate.
[0060] As an optional embodiment, extracting element data from target data includes: obtaining an element dictionary and using the element dictionary to extract initial data from the target data, wherein the initial data is the characters in the target data, and the element dictionary includes various types of standard element words and synonymous element words; when the initial data belongs to a standard element word, the initial data is directly determined as element data; when the initial data belongs to a synonymous element word, the standard element word corresponding to the initial data is obtained, and the standard element word is determined as element data.
[0061] Both the element dictionary and the preset element library are pre-set knowledge bases including multiple entity elements, wherein the element dictionary also includes synonymous element words of element words.
[0062] For example, when the target data is "rich peach and pomegranate flavor", the initial data extracted includes "rich", "peach", and "pomegranate". After matching with the feature dictionary, it is found that "rich" and "pomegranate" are standard feature words, and "peach" does not belong to the standard feature words (it is a synonym feature word). Then the standard feature word corresponding to "peach" is searched in the feature dictionary, and the queried standard feature word "peach" and the previous "rich" and "pomegranate" are jointly determined as the feature data of the target data.
[0063] This application can make the element words more unified and reduce interference factors in subsequent element matching by setting standard element words and using synonymous element words to search for standard element words.
[0064] As an optional embodiment, the method also includes training in the following manner to obtain a preset vector model: obtaining training data and streamlining the training data to obtain training sentences; using the TSDAE framework to input the training sentences into the initial model for training, and outputting the training results; when the training results indicate that the matching accuracy of the initial model for the training sentences reaches a second threshold, the initial model is determined as the preset vector model.
[0065] Optionally, training data simplification includes standardization and sentence segmentation. Standardization involves converting sentences to simplified / traditional Chinese, converting full-width to half-width Chinese, and filtering out noise. Sentence segmentation involves breaking sentences into short sentences. In entity linking, entities are generally short, so processing them into short sentences can improve the effectiveness of entity linking.
[0066] The second threshold is a preset value that is less than or equal to 100%.
[0067] Optionally, when the training results indicate that the matching accuracy of the initial model for the training sentences does not reach a second threshold, the model parameters are adjusted and the model is continued to be trained using the training data until the matching accuracy of the initial model for the training sentences does not reach the second threshold.
[0068] Optionally, an initial model provided in this application is a BERT-Base-Chinese pre-training model.
[0069] The Transformer-based Sequential Denoising Auto-Encoder (TSDAE) framework uses sentences as training data for unsupervised training of sentence embeddings. During training, the TSDAE framework uses autoencoding to train the training data, eliminating the need for manual labeling and reducing manual workload.
[0070] The present application provides an entity linking method, comprising: extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; matching the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including multiple entity data; and determining a target entity to be linked to the target data based on the matching result.
[0071] This application determines the linked entities corresponding to the target data by performing feature matching between the target data and entities in a preset feature library, thereby solving the problems of low efficiency of manual matching and the need for a large amount of labeled data for model matching.
[0072] According to another aspect of the embodiment of the present application, the present application also provides a physical linking device, such as Figure 2 Shown, including:
[0073] An extraction module 202 is configured to extract element data from target data, wherein the target data includes fields to be linked to corresponding entity data;
[0074] Matching module 204, configured to match the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including a plurality of entity data;
[0075] The determination module 206 is configured to determine the target entity to be linked to the target data according to the matching result.
[0076] It should be noted that the extraction module 202 in this embodiment can be used to execute step 101 in the embodiment of the present application, the matching module 204 in this embodiment can be used to execute step 103 in the embodiment of the present application, and the determination module 206 in this embodiment can be used to execute step 105 in the embodiment of the present application.
[0077] Optionally, the matching module 204 is also used to match the first main element in the element data with the second main element of each entity element respectively; when there are multiple entity elements and all the second main elements completely match the first main element, the entity corresponding to the multiple entity elements is determined as the first candidate entity, and the first secondary element is matched with the second secondary elements of the multiple first candidate entities respectively, wherein the element data includes the first main element and the first secondary element, and the entity element includes the second main element and the second secondary element; when the number of first candidate entities whose number of second secondary elements matched with the first secondary element is greater than or equal to the first threshold is greater than or equal to zero, the first candidate entity whose number of second secondary elements matched with the first secondary element is greater than or equal to the first threshold is determined as the second candidate entity.
[0078] Optionally, the matching module 204 is also used to: when there is only one entity element whose second main element completely matches the first main element, determine the entity data corresponding to the entity element as the second candidate entity; when there is no entity element whose second main element completely matches the first main element, determine that the second candidate entity does not exist.
[0079] Optionally, the determining module 206 further includes:
[0080] A first determining submodule is configured to determine that the target data does not have a target entity to be linked when the second candidate entity does not exist;
[0081] A second determining submodule is configured to determine the second candidate entity as a target entity to be linked to the target data when there is a second candidate entity and the number of the second candidate entity is one;
[0082] The third determining submodule is configured to determine a target entity to be linked to the target data by using similarities between the target data and each second candidate entity when there are second candidate entities and the number of the second candidate entities is greater than or equal to two.
[0083] Optionally, the third determination submodule is also used to convert each second candidate entity into an entity vector using a preset vector model, and convert the target data into a target vector; determine the similarity between each entity vector and the target vector respectively, and determine the second candidate entity corresponding to the entity vector whose similarity is greater than or equal to a preset threshold as the target entity to be linked to the target data.
[0084] Optionally, the extraction module 202 is also used to obtain an element dictionary and use the element dictionary to extract initial data from the target data, wherein the initial data is the characters in the target data, and the element dictionary includes various types of standard element words and synonymous element words; when the initial data belongs to a standard element word, the initial data is directly determined as element data; when the initial data belongs to a synonymous element word, the standard element word corresponding to the initial data is obtained, and the standard element word is determined as element data.
[0085] Optionally, the entity linking device also includes a training module for training in the following manner to obtain a preset vector model: obtaining training data and streamlining the training data to obtain training sentences; using the TSDAE framework to input the training sentences into the initial model for training, and outputting the training results; when the training results indicate that the matching accuracy of the initial model for the training sentences reaches a second threshold, the initial model is determined as the preset vector model.
[0086] It should be noted here that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments.
[0087] According to another aspect of the embodiment of the present application, Figure 3 As shown, the present application provides an electronic device, including a memory 31, a processor 32, a communication interface 33 and a communication bus 34. The memory 31 stores a computer program that can be run on the processor 32. The memory 31 and the processor 32 communicate through the communication bus 34 and the communication interface 33. When the processor 32 executes the computer program, the steps of the above method are implemented.
[0088] The memory and processor in the electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like.
[0089] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0090] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0091] According to another aspect of the embodiments of the present application, the present application provides a computer-readable medium having a non-volatile program code executable by a processor, where the program code enables the processor to execute the steps of any of the above methods.
[0092] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for the processor to execute the above method steps.
[0093] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0094] When implementing the embodiments of the present application, reference may be made to the above embodiments, which have corresponding technical effects.
[0095] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.
[0096] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0097] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0098] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0099] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0100] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0101] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0102] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or partly contributed to the prior art or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard drive, a ROM, a RAM, a magnetic disk, or an optical disk. 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 such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without further constraints, an element defined by the phrase "comprises a..." does not preclude the existence of additional identical elements in the process, method, article or apparatus that includes the element.
[0103] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims
1. An entity linking method, characterized in that: include: Extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; Matching the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including a plurality of entity data; Determining a target entity to be linked to the target data according to the matching result; The matching of the element data with the entity elements in the preset element library includes: Matching the first main element in the element data with the second main element of each entity element; In a case where all the second main elements of a plurality of entity elements completely match the first main element, determining the entities corresponding to the plurality of entity elements as first candidate entities, and matching the first secondary elements with the second secondary elements of the plurality of first candidate entities, respectively, wherein the element data includes the first main element and the first secondary element, and the entity element includes the second main element and the second secondary element; In a case where the number of the first candidate entities whose number of the second secondary elements matching the first secondary element is greater than or equal to a first threshold is greater than or equal to zero, determining the first candidate entities whose number of the second secondary elements matching the first secondary element is greater than or equal to the first threshold as second candidate entities; Before matching the element data with the entity elements in the preset element library, the method also includes dividing the main elements and secondary elements in the preset element library in the following manner: performing part-of-speech recognition on each element in the preset element library to determine the noun element; using the standard vocabulary to filter the noun elements to find the target noun elements that exist in the standard vocabulary and can distinguish different standard words among the noun elements as the main elements, and determining the remaining elements as the secondary elements.
2. The method according to claim 1, characterized in that After matching the first main element in the element data with the second main element of each entity element, the method further includes: When there is only one entity element whose second main element completely matches the first main element, determining the entity data corresponding to the entity element as the second candidate entity; When the second main element of the entity element does not completely match the first main element, it is determined that the second candidate entity does not exist.
3. The method according to claim 2, characterized in that Determining the target entity to be linked to the target data according to the matching result includes: When the second candidate entity does not exist, determining that the target entity to be linked does not exist in the target data; When the second candidate entity exists and the number of the second candidate entity is one, determining the second candidate entity as the target entity to be linked to the target data; When the second candidate entities exist and the number of the second candidate entities is greater than or equal to two, the target entity to be linked to the target data is determined by using the similarity between the target data and each of the second candidate entities.
4. The method according to claim 3, characterized in that The determining the target entity to be linked to the target data by using the similarity between the target data and each of the second candidate entities includes: Using a preset vector model, each of the second candidate entities is converted into an entity vector, and the target data is converted into a target vector; The similarity between each entity vector and the target vector is determined respectively, and the second candidate entities corresponding to the entity vectors having the similarity greater than or equal to a preset threshold are determined as the target entities to be linked to the target data.
5. The method according to claim 1, wherein The extracting element data from the target data comprises: Acquire an element dictionary, and extract initial data from the target data using the element dictionary, wherein the initial data is characters in the target data, and the element dictionary includes various types of standard element words and synonymous element words; When the initial data belongs to the standard element word, the initial data is directly determined as the element data. When the initial data belongs to the synonymous element word, the standard element word corresponding to the initial data is obtained, and the standard element word is determined as the element data.
6. The method according to claim 4, characterized in that The method further includes training in the following manner to obtain the preset vector model: Obtaining training data and streamlining the training data to obtain training short sentences; Using the TSDAE framework, the training sentences are input into the initial model for training, and the training results are output; When the training result indicates that the matching accuracy of the initial model for the training phrase reaches a second threshold, the initial model is determined as the preset vector model.
7. A physical link device, characterized in that: include: an extraction module for extracting element data from target data, wherein the target data includes fields to be linked to corresponding entity data; a matching module, configured to match the element data with entity elements in a preset element library to obtain a matching result, wherein the preset element library is a pre-organized database of entity elements including a plurality of entity data; A determination module, configured to determine a target entity to be linked to the target data according to the matching result; The matching module is specifically used for: Matching the first main element in the element data with the second main element of each entity element; In a case where all the second main elements of a plurality of entity elements completely match the first main element, determining the entities corresponding to the plurality of entity elements as first candidate entities, and matching the first secondary elements with the second secondary elements of the plurality of first candidate entities, respectively, wherein the element data includes the first main element and the first secondary element, and the entity element includes the second main element and the second secondary element; In a case where the number of the first candidate entities whose number of the second secondary elements matching the first secondary element is greater than or equal to a first threshold is greater than or equal to zero, determining the first candidate entities whose number of the second secondary elements matching the first secondary element is greater than or equal to the first threshold as second candidate entities; The element division module is used to divide the main elements and secondary elements in the preset element library in the following manner before matching the element data with the entity elements in the preset element library: perform part of speech recognition on each element in the preset element library to determine the noun element; use the standard vocabulary to filter the noun elements to find the target noun elements that exist in the standard vocabulary and can distinguish different standard words among the noun elements as the main elements, and determine the remaining elements as the secondary elements.
8. An electronic device comprising a memory, a processor, a communication interface, and a communication bus, wherein the memory stores a computer program that can be run on the processor, and the memory and the processor communicate via the communication bus and the communication interface, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable medium having a non-volatile program code executable by a processor, characterized in that The program code enables the processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Entity linking method, an entity linking device, a computer readable storage medium and an electronic device
CN109522551A