Entity linking method and device, electronic equipment and computer readable storage medium
By fusing the encoding features of reference and synonyms and utilizing the weight coefficients of synonyms, the problem of insufficient accuracy of entity linking in short texts is solved, and more accurate entity recognition and linking are achieved.
Patent Information
- Application Number
- CN202411864230.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-09-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In short texts with relatively scarce contextual information, the accuracy of entity linking is greatly affected.
By fusing the encoding features of the reference and its synonyms and using the weight coefficient of the synonyms to fuse the encoding features of the reference, the accuracy of entity linking is improved.
The accuracy of entity linking is improved, especially in short text scenarios with insufficient contextual information, and the corresponding second entity can be more accurately filtered out from the first entity.
Smart Images

Figure CN120688448A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to natural language processing technology, and in particular to an entity linking method, device, electronic device and computer-readable storage medium. Background Art
[0002] Natural Language Processing (NLP) is a branch of artificial intelligence and linguistics dedicated to the study of how computers can understand, interpret, and generate human language. Within NLP, entity linking refers to the process of matching identified mentions in text with entities in a knowledge base. With the explosive growth of short text-based information on the internet, entity linking for short texts is playing an increasingly important role in practical applications. However, in related technologies, the accuracy of entity linking for short texts, where contextual information is relatively scarce, is often significantly affected. Summary of the Invention
[0003] The embodiments of the present application provide an entity linking method, apparatus, electronic device, and computer-readable storage medium, which can improve the accuracy of entity linking by fusing the encoding features of a reference and its synonyms.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] This embodiment of the present application provides an entity linking method, the method comprising:
[0006] performing encoding processing on the reference to obtain a first encoding feature of the reference;
[0007] performing encoding processing on the synonyms of the reference to obtain a second encoding feature of the synonyms;
[0008] Based on the weight coefficient of the synonym, the first coding feature and the second coding feature are fused to obtain a third coding feature of the reference;
[0009] Based on the third coding feature, a second entity is selected from the first entity, and the reference is linked to the second entity.
[0010] An embodiment of the present application provides a physical linking device, the device comprising:
[0011] A first encoding module, configured to encode the reference to obtain a first encoding feature of the reference;
[0012] A second encoding module is used to encode the synonyms of the reference to obtain second encoding features of the synonyms;
[0013] a coding fusion module, configured to fuse the first coding feature and the second coding feature based on the weight coefficient of the synonym to obtain a third coding feature of the reference;
[0014] The entity screening module screens out a second entity from the first entity based on the third coding feature, and links the reference to the second entity.
[0015] An embodiment of the present application provides an electronic device, comprising:
[0016] a memory for storing computer-executable instructions or computer programs;
[0017] The processor is used to implement the entity linking method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.
[0018] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the entity linking method provided in the embodiment of the present application when executed by a processor.
[0019] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the entity linking method provided in the embodiment of the present application is implemented.
[0020] The embodiments of the present application have the following beneficial effects:
[0021] Based on the weight coefficient of synonyms, the first coding feature of the reference and the second coding feature of its synonyms are fused to obtain the third coding feature of the reference. Since the third coding feature integrates the rich information of the reference and its synonyms, the third coding feature can be used to accurately filter out the second entity corresponding to the reference from the first entity, thereby improving the accuracy of entity linking. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a schematic diagram of the structure of the entity linking system architecture provided by an embodiment of the present application;
[0023] Figure 2 Schematic diagram of the structure of an electronic device for entity linking provided in an embodiment of the present application;
[0024] Figure 3 This is a first flow chart of the entity linking method provided in an embodiment of the present application;
[0025] Figure 4 This is a second flow chart of the entity linking method provided in an embodiment of the present application;
[0026] Figure 5 This is a third flow chart of the entity linking method provided in an embodiment of the present application;
[0027] Figure 6 This is a fourth flow chart of the entity linking method provided in an embodiment of the present application;
[0028] Figure 7 This is a fifth flow chart of the entity linking method provided in an embodiment of the present application;
[0029] Figure 8 This is a sixth flow chart of the entity linking method provided in an embodiment of the present application;
[0030] Figure 9 This is a schematic diagram of the first principle of the entity linking method provided by the embodiment of the present application;
[0031] Figure 10 This is a second principle diagram of the entity linking method provided in an embodiment of the present application.
[0032] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of distinction between the advantages and disadvantages of the solutions or the priority in the implementation process. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0034] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0035] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0036] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0037] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0038] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0039] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0040] 1) Entity Linking (EL): Entity linking is a task in natural language processing (NLP). Entity linking involves matching entities in text (such as names, places, and organizations) with corresponding entities in a knowledge base. This allows entities in text to be linked to rich information in the knowledge base, providing a more comprehensive and in-depth semantic understanding.
[0041] 2) Mention: Also known as mention, it is a language fragment that expresses an entity in a natural language text. Specifically, a reference refers to the name or description of the entity mentioned in the text. These mentions need to be linked to the corresponding entities in the knowledge base. The task of entity linking is to match and link these mentions (references) in the text with the entities in the knowledge base.
[0042] 3) Knowledge Base: A knowledge base is a system used to store, organize, and manage large amounts of information. In a knowledge base, information is stored in the form of entities, which usually exist in the form of facts, rules, concepts, and principles. The knowledge base aims to provide structured and easily accessible data so that users or systems can quickly retrieve, analyze, and utilize the information therein.
[0043] 4) Entity Entry: Entity is the basic component unit in the knowledge base, which represents a specific information unit or object in the knowledge base. Each entity usually contains detailed information about a specific entity.
[0044] 5) Edit Distance: Edit distance is a measure of the difference between two strings, indicating the minimum number of edit operations required to transform one string into another. An edit distance calculation engine is a software module or system that implements this calculation. Edit distance calculation engines are commonly used in scenarios such as spell checking and autocorrection, entity linking and text similarity calculation in natural language processing, and DNA sequence alignment in bioinformatics.
[0045] The embodiments of the present application provide an entity linking method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of entity linking by fusing the encoding features of a reference and its synonyms.
[0046] The entity linking method provided in the embodiments of the present application can be implemented independently by a terminal or a server; it can also be implemented collaboratively by a terminal and a server. For example, the terminal independently undertakes the entity linking method described below, or the terminal sends an entity linking request containing a reference to the server, and the server executes the entity linking method based on the received entity linking request containing a reference.
[0047] The electronic devices used for entity linking provided in the embodiments of the present application can be various types of terminals or servers, wherein the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart TV, smart watch, etc., but is not limited to these. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in this application.
[0048] See also Figure 1 , Figure 1 It is a structural diagram of the entity linking system architecture provided in an embodiment of the present application. In the entity linking system 10 provided in an embodiment of the present application, in order to support an entity linking application, the terminal 400 is connected to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0049] Terminal 400 may be used to obtain an entity linking request containing a reference.
[0050] In some embodiments, an entity linking plug-in may be implanted in the client running in the terminal 400 to implement the entity linking method locally on the client. For example, the terminal 400 calls the entity linking plug-in to implement the entity linking method, encodes the reference to obtain a first encoding feature of the reference, encodes the synonyms of the reference to obtain a second encoding feature of the synonyms, and based on the weight coefficient of the synonyms, fuses the first encoding feature and the second encoding feature to obtain a third encoding feature of the reference. Based on the third encoding feature, the second entity is filtered out from the first entity, and the reference is linked to the second entity.
[0051] In some embodiments, after the terminal 400 obtains an entity link request containing a reference, it calls the entity link interface of the server 200 (which can be provided in the form of a cloud service). The server 200 implements the entity link method through the entity link plug-in, encodes the reference to obtain a first encoding feature of the reference, encodes the synonyms of the reference to obtain a second encoding feature of the synonyms, and based on the weight coefficient of the synonyms, fuses the first encoding feature and the second encoding feature to obtain a third encoding feature of the reference. Based on the third encoding feature, the second entity is filtered out from the first entity, and the second entity is returned to the terminal 400, and then the terminal 400 links the reference to the second entity.
[0052] See also Figure 2 , Figure 2 is a structural diagram of an electronic device for entity linking provided in an embodiment of the present application, Figure 2 The electronic device 500 shown may be Figure 1 The terminal 400 or server 200 in the electronic device 500 includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 2 Various buses are labeled as bus system 540 .
[0053] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0054] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0055] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, a hard drive, an optical drive, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 510.
[0056] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.
[0057] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0058] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0059] A network communication module 552 for reaching other computing devices via one or more (wired or wireless) network interfaces 520 , exemplary network interfaces 520 including Bluetooth, WiFi, and USB;
[0060] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripheral devices and displaying content and information);
[0061] The input processing module 554 is configured to detect one or more user inputs or interactions from one of the one or more input devices 532 and to translate the detected inputs or interactions.
[0062] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 Entity linking device 555 stored in memory 550 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: a first encoding module 5551, a second encoding module 5552, an encoding fusion module 5553, and an entity screening module 5554. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0063] In other embodiments, the apparatus provided in the embodiments of the present application may be implemented in hardware. As an example, the apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the entity linking method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0064] As mentioned above, the electronic device that implements the entity linking method of the embodiment of the present application can be a terminal, a server, or a combination of the two. Therefore, the execution subject of each step will not be repeated below. Figure 3 , Figure 3 This is a first flow chart of the entity linking method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.
[0065] In step 101, the reference is encoded to obtain a first encoding feature of the reference.
[0066] As an example, the reference is a text fragment in the second text that has not yet been linked to the corresponding entity in the first knowledge base. The encoding processing of the reference can be context encoding processing of the reference to obtain a first encoding feature of the reference, which is an encoding feature of the reference that integrates the context information in the second text. The second text is a natural language text, the first knowledge base is the target knowledge base to which the reference is linked, and the knowledge base is a system for storing, organizing and managing large amounts of information. The entity is the basic component unit in the knowledge base.
[0067] In some embodiments, see Figure 4 , Figure 4 This is a second flow chart of the entity linking method provided in an embodiment of the present application. Figure 3 The illustrated step 101 can be implemented by following steps 1011 to 1014 , which are described in detail below.
[0068] In step 1011 , the position of the reference in the second text is determined.
[0069] As an example, the position can refer to a character index in the second text, or it can be a sequential position calculated based on the word, which is not limited here. For example, in the case where the position refers to a character index in the second text, the second text can be a natural language text "On a beautiful farm, the fox leaped over a silver river.", and the reference to "fox" is the 11th to 12th characters in the second text (punctuation marks are counted as characters). The character index representation of "fox" is [11, 12], and the position of "fox" is [11, 12].
[0070] In step 1012 , the second text is split into a third text and a fourth text based on the position.
[0071] Among them, the third text and the fourth text both include reference.
[0072] As an example, in a case where the position refers to a character index in the second text, the second text is split into a third text and a fourth text based on the character index of the reference in the second text, the third text includes characters whose character index in the second text is less than or equal to the referred character index, and the fourth text includes characters whose character index in the second text is greater than or equal to the referred character index.
[0073] Continuing with the previous example, based on the character index [11, 12] of the reference "fox" in the second text "In a beautiful farm, the fox leaped over a silver river," the second text is split into a third text and a fourth text. The third text includes characters with character indices less than or equal to [11, 12], that is, the third text is "In a beautiful farm, the fox," and the fourth text includes characters with character indices greater than or equal to [11, 12], that is, the fourth text is "The fox leaped over a silver river."
[0074] In step 1013 , text encoding is performed on the third text and the fourth text respectively to obtain encoding features of the third text and encoding features of the fourth text.
[0075] As an example, the third text is segmented to obtain a segmentation sequence of the third text, and the stop words in the segmentation sequence of the third text are removed to obtain a segmentation sequence of the third text after removing the stop words. Each segmentation in the segmentation sequence of the third text after removing the stop words is embedded to obtain a word embedding sequence of the third text. Based on the context coding model, the word embedding sequences of the three texts are context-encoded to obtain encoding features of the third text. The embedding processing can be implemented by an embedding coding model. The embedding coding model includes a word vector model (Word2Vec model), a global vector model (GloVe model) and a bidirectional encoder representation model (BERT model), etc., which are not limited here. The context coding model can be a long short-term memory model (LSTM model) or other encoding models based on text context, which are not limited here.
[0076] Referring to the above steps of processing the third text, text encoding is performed on the fourth text to obtain encoding features of the fourth text.
[0077] For example, the word embedding sequence of the second text S can be represented as S = (w1, w2, ..., m, ..., w n-1 ,w n ), where m is the reference, w n The word embedding sequence of the third text can be represented as (w1, w2, ..., m), and the word embedding sequence of the fourth text can be represented as (w n ,w n-1 ,…,m), through the long short-term memory model, the word embedding sequence of the third text is encoded to obtain the encoding features of the third text. The encoding features of the third text can be represented as Perform text encoding on the word embedding sequence of the fourth text to obtain the encoding features of the fourth text. The encoding features of the fourth text can be represented as
[0078] In step 1014 , the coding features of the third text and the coding features of the fourth text are fused to obtain the referred first coding features.
[0079] As an example, the coding features of the third text and the coding features of the fourth text are fused to obtain fused coding features, and feature extraction processing is performed on the fused coding features based on a feedforward neural network to obtain the referred first coding features, wherein the fusion processing can be matrix splicing processing of the coding features of the third text and the coding features of the fourth text, or it can be fusion processing of the coding features of the third text and the coding features of the fourth text based on an attention model (Transform model), which is not limited here.
[0080] Following the above example, the encoding features of the third text and the encoding features of the fourth text Perform matrix splicing to obtain fusion coding features Based on the feedforward neural network, the fusion encoding features Perform feature extraction processing to obtain the first coding feature of the reference, which can be represented as
[0081] In some embodiments, the feedforward neural network can be a single-layer feedforward neural network, which includes a linear transformation layer and an activation layer. "Performing feature extraction processing on the fused coding features based on the single-layer feedforward neural network" can be achieved through the following steps: performing linear transformation processing on the fused coding features to obtain the fused coding features after the linear transformation, and performing nonlinear activation processing on the fused coding features after the linear transformation to obtain the referred first coding features, wherein the nonlinear activation processing is achieved through an activation function, and the activation function can be a step function (Step Function), a logical function (Sigmoid Function), a hyperbolic tangent function (tanh function, Hyperbolictangent function), a rectified linear unit (ReLU function, Rectified Linear Unit), etc., which are not limited here.
[0082] In an embodiment of the present application, by accurately locating the position of the reference in the second text, and performing context encoding processing on the texts before and after the reference respectively, and then fusing the encoding features of the texts before and after the reference, the context information of the reference is effectively captured, thereby improving the ability of the first encoding feature of the reference to understand the deep semantics of the second text.
[0083] In some embodiments, Figure 3 Before step 101 shown, the following steps may also be performed: performing part-of-speech recognition processing on the second text to obtain part-of-speech information of the second text; performing word segmentation processing on the second text to obtain a first participial, and based on the part-of-speech information, deleting stop words in the first participial to obtain a second participial; performing aggregation processing on the second participial to obtain a reference.
[0084] Therein, the second text includes reference.
[0085] As an example, part-of-speech recognition is performed on each word in the second text to determine the part-of-speech information of each word in the second text. The part-of-speech information represents the type of the word, for example, part-of-speech information can include noun, verb, adjective, and preposition. The second text is segmented to obtain a first segmentation. Stop words in the first segmentation are determined based on the part-of-speech information of each word and the part-of-speech information of preset stop words. For example, if the part-of-speech information of the preset stop word is a preposition, the preposition in the first segmentation is determined as a stop word. The stop words in the first segmentation are deleted to obtain a second segmentation, where the second segmentation is different from the stop word. When two consecutive second segmentations in the second text contain only stop words, the two consecutive second segmentations are aggregated to obtain a reference list, and a reference is selected from the reference list. The preset part-of-speech information of the stop words can be set by engineers based on the fine-grained nature of reference recognition.
[0086] For example, the second text can be a natural language text "On a beautiful farm, a white fox jumps over a silver river." After word segmentation processing is performed on the second text, the first participles obtained include: "in", "one", "beautiful", "of", "farm", "in", "white", "of", "fox", "jump over", "one", "silver", "of" and "river". When the part-of-speech information of the preset stop words is preposition and quantifier, the second participles include: "beautiful", "farm", "white", "fox", "jump over", "silver" and "river". Among them, the second participle "white" and "fox" only contain the stop word "of". "White" and "fox" are aggregated, and so on. The obtained reference list includes "beautiful farm", "white fox", "jump over" and "silver river".
[0087] In an embodiment of the present application, through part-of-speech recognition and word segmentation processing, stop words are effectively identified and removed from the second text, thereby improving the recognition accuracy of key entities in the second text. Aggregation is performed through the second word segmentation, thereby reducing the number of references to be processed and improving the efficiency of the entity linking task of the second text. On this basis, by adjusting the part-of-speech information of the preset stop words, the fine-grainedness of reference recognition is controlled, which can more flexibly adapt to different practical application needs.
[0088] In step 102, the synonyms are coded to obtain second coding features of the synonyms.
[0089] As an example, a synonym is at least one word that is semantically similar to the reference. Each synonym of the reference is encoded separately to obtain a second encoding feature of each synonym. The synonyms can be retrieved from a second knowledge base. The second knowledge base can be a WordNet knowledge base or other knowledge base containing semantic relationships between words, such as FrameNet, ConceptNet, etc., which is not limited here.
[0090] In some embodiments, see Figure 5 , Figure 5 This is a third flow chart of the entity linking method provided in the embodiment of the present application. Figure 3 The illustrated step 102 can be implemented by following the steps 1021 to 1022 , which are described in detail below.
[0091] In step 1021 , text encoding processing is performed on the reference, synonyms, and first text respectively to obtain encoding features of the reference, encoding features of the synonyms, and encoding features of the first text.
[0092] Among them, the first text is used to represent the hyponymy relationship between the semantics of the reference and the semantics of the synonym. In knowledge engineering and natural language processing (NLP), the hyponymy relationship (Hyponymy / Hypernymy) is often used to describe the inclusion relationship between the semantics of words. Among them, words with stronger generality are called hypernyms, and words with stronger specificity are called hyponyms.
[0093] For example, when the semantics of the reference to "animal" includes the semantics of the synonym "bird", the semantics of the reference is a superordinate generalization of the semantics of the synonym. At this time, the first text can be a "superordinate relationship" or an "implication relationship". When the semantics of the synonym includes the semantics of the reference, the semantics of the reference is a subordinate limitation of the semantics of the synonym. The first text can be a "subordinate relationship" or an "overall relationship".
[0094] As an example, for each synonym, the first text between the reference and the synonym is determined. The text encoding model can be used to perform text encoding processing on the reference, synonym and first text respectively to obtain the encoding features of the reference, the encoding features of the synonym and the encoding features of the first text. The first encoding features of the reference can also be directly determined as the encoding features of the reference, and the text encoding model can be used to perform text encoding processing on the synonym and the first text respectively to obtain the encoding features of the synonym and the encoding features of the first text. This is not limited here. The text encoding model can be a bilinear text encoding model (BILINEAR model) or other text encoding models, such as a word vector model (Word2Vec model) or a pre-trained language model based on an attention architecture (BERT model), etc., which is not limited here.
[0095] In some embodiments, "text encoding is performed on synonyms through a text encoding model to obtain encoding features of the synonyms" can be achieved in the following ways: embedding the synonyms to obtain embedding features of the synonyms; text encoding is performed on the embedded features through the first text encoding layer in multiple cascaded text encoding layers; the encoding result of the first text encoding layer is output to the subsequent cascaded text encoding layer, and text encoding and encoding result output are continued through the subsequent cascaded text encoding layers until the last text encoding layer is output, and the encoding result output by the last text encoding layer is used as the encoding feature of the synonym.
[0096] As an example, a text encoding model may include an embedding layer and multiple cascaded text encoding layers. First, based on the embedding layer, synonyms are embedded to obtain embedding features of the synonyms. Then, the embedding features are input into the first text encoding layer to obtain the encoding result of the first text encoding layer. The encoding result of the first text encoding layer is input into the second text encoding layer to obtain the encoding result of the second text encoding layer. And so on, the output result of the previous cascaded text encoding layer is encoded by the subsequent cascaded text encoding layers until it is output to the last text encoding layer, and the encoding result output by the last text encoding layer is used as the encoding feature of the synonym. Each text encoding layer may include a multi-head attention layer and a fully connected feedforward network layer, and the multi-head attention layer and the fully connected feedforward network layer are both connected to a residual connection layer and a normalization layer. The text encoding layer may also be a convolutional layer, which is not limited here.
[0097] In step 1022 , the coding features of the reference, the coding features of the synonyms, and the coding features of the first text are fused to obtain second coding features of the synonyms.
[0098] As an example, matrix transposition processing is performed on the coding features of the reference to obtain the transposed matrix of the coding features of the reference. For each synonym, the product of the transposed matrix of the coding features of the reference, the coding features of the synonym and the diagonal matrix of the coding features of the first text is determined as the second coding feature of the synonym.
[0099] For example, the coding feature of the reference can be represented as s, the coding feature of the synonym can be represented as o, and the coding feature of the first text can be represented as r. Based on formula (1.1), the coding feature s of the reference, the coding feature o of the synonym, and the coding feature r of the first text are fused to obtain the second coding feature f(s, r, o) of each synonym. Formula (1.1) is as follows:
[0100] f(s,r,o)=sT diag(r)o (1.1)
[0101] Among them, f(s,r,o) is the second coding feature of the synonym, s is the coding feature of the reference, o is the coding feature of the synonym, r is the coding feature of the first text, s T is the transposed matrix of the encoding features of the reference, and diag(r) is the diagonal matrix of the encoding features of the first text.
[0102] In step 103, the first coding feature and the second coding feature are fused based on the weight coefficients of the synonyms to obtain a third coding feature of the reference.
[0103] As an example, based on the weight coefficient of the synonym, the second coding feature is weighted and summed to obtain the weighted sum of the second coding feature, and the weighted sum of the first coding feature and the second coding feature is fused to obtain the referred third coding feature.
[0104] In some embodiments, Figure 3 Before step 103 shown, the following steps may be performed: determining a first correlation coefficient between the reference and the synonym based on the first coding feature and the second coding feature; and normalizing the first correlation coefficient to obtain a weight coefficient of the synonym.
[0105] As an example, based on the first coding feature of the reference and the second coding feature of the synonym, the first correlation coefficient between the reference and the synonym is determined. The first correlation coefficient represents the semantic similarity between the reference and the synonym. The first correlation coefficient between the reference and each synonym is normalized to obtain the weight coefficient of each synonym. The synonyms correspond to the first correlation coefficient one by one, and the weight coefficient of the synonym is positively correlated with the first correlation coefficient.
[0106] For example, the synonym set can be represented as Z(m), which includes j synonyms, j is a positive integer greater than 0, and the first coding feature of the reference and the second coding feature z of the jth synonym are determined by the bilinear algorithm. j The first correlation coefficient between them is positively correlated with the weight coefficient of the jth synonym based on formula (1.2), where formula (1.2) is as follows:
[0107]
[0108] in, is the first coding feature of the reference, is the second encoding feature z of the jth synonym j The transposed matrix of is the first coding feature and the second coding feature z of the jth synonym jThe first correlation coefficient, α j is the weight coefficient of the jth synonym, and W is a hyperparameter.
[0109] In an embodiment of the present application, the semantic similarity between the reference and the synonyms is quantified by the first correlation coefficient between the reference and the synonyms. By normalizing the first correlation coefficient between the reference and each synonym, a dynamic weight coefficient is assigned to each synonym, which helps to highlight the synonyms most relevant to the reference and reduce the influence of less relevant synonyms on the fusion results in the subsequent "fusion processing of the first coding feature and the second coding feature".
[0110] In some embodiments, see Figure 6 , Figure 6 This is a fourth flow chart of the entity linking method provided in an embodiment of the present application. Figure 3 The illustrated step 103 can be implemented by following steps 1031 to 1033, which are described in detail below.
[0111] In step 1031 , the second coding feature is weighted based on the weight coefficient of the synonym to obtain a fourth coding feature.
[0112] As an example, based on the weight coefficients of synonyms, the second coding feature is weighted and summed to obtain the weighted sum of the second coding feature. Based on the first coding feature and the bias matrix, the weight coefficient of the bias matrix is determined. The product of the bias matrix and the weight coefficient of the bias matrix is determined, and the sum of the weighted sum of the second coding feature and the above product is determined as the fourth coding feature, wherein the bias matrix is a hyperparameter used to adjust and optimize the fourth coding feature, and the bias matrix is used to ensure the consistency of the semantic expression of the fourth coding feature obtained by the fusion processing with the referred first coding feature.
[0113] For example, the bias matrix can be represented as Based on formula (1.3), the weight coefficient β of the bias matrix is determined. Formula (1.3) is as follows:
[0114]
[0115] in, is the first coding feature, is the bias matrix, β is the weight coefficient of the bias matrix, is the transposed matrix of the bias matrix, and W is a hyperparameter.
[0116] When the synonyms of the reference are successfully retrieved in the second knowledge base, the synonym set can be represented as Z(m), which includes j synonyms, where j is a positive integer greater than 0. Based on formula (1.4), the bias matrix and the second encoding feature are fused to obtain the fourth encoding feature k. Formula (1.4) is as follows:
[0117]
[0118] Among them, k is the fourth coding feature, α j is the weight coefficient of the jth synonym, z j is the second encoding feature of the jth synonym, β is the weight coefficient of the bias matrix, is the bias matrix, and j is the number of synonyms.
[0119] In the case that no synonyms of the reference are retrieved in the second knowledge base, when Z(m) is an empty set, the fourth encoding feature k is a zero matrix.
[0120] In step 1032 , the fourth coding feature is fused with the first coding feature to obtain a fifth coding feature.
[0121] As an example, the fusion processing can be matrix splicing processing of the fourth coding feature and the first coding feature, or it can be fusion processing of the fourth coding feature and the first coding feature based on the attention model (Transform model), which is not limited here.
[0122] For example, the first coding feature can be represented as The fourth coding feature can be represented as k. The first coding feature and the fourth coding feature are concatenated by a matrix to obtain the fifth coding feature. The fifth coding feature can be represented as d.
[0123] In step 1033, feature extraction processing is performed on the fifth coding feature to obtain the so-called third coding feature.
[0124] As an example, the specific method of performing feature extraction processing on the fifth coding feature can be referred to step 1014, which will not be described in detail here.
[0125] In an embodiment of the present application, based on the weight coefficient of the synonym, the second coding feature is weighted and summed to obtain the weighted sum of the second coding feature, and the weighted sum of the first coding feature and the second coding feature is fused to obtain a third coding feature that integrates the rich semantic information of the reference and its synonyms. Especially in the entity linking task scenario of short texts with relatively scarce contextual information, the semantic information of the reference and its synonyms is fully mined and utilized to achieve more accurate entity linking, thereby improving the accuracy and robustness of overall entity recognition and linking.
[0126] In step 104 , based on the third coding feature, the second entity is filtered out from the first entity, and the reference is linked to the second entity.
[0127] As an example, based on the third coding feature of the reference, the third probability of linking the reference to each first entity is determined respectively, the first entity with the highest third probability is determined as the second entity, and the reference is linked to the second entity, wherein the first entity can be all entities in the third knowledge base or some entities screened out from the third knowledge base, the third knowledge base can be the Freebase knowledge base or other knowledge base containing descriptive information of words and part-of-speech information of words, which is not limited here, and the target number can be set by engineering technicians based on engineering experience, which is not limited here.
[0128] As an example, "screening out a target number of first entities from the third knowledge base" can be achieved through the following steps: based on an edit distance calculation engine, determining the similarity between the description information of the entity in the third database and the third encoding feature, and determining the entity whose similarity is greater than the similarity threshold as the first entity.
[0129] In some embodiments, see Figure 7 , Figure 7 This is a fifth flow chart of the entity linking method provided in an embodiment of the present application. Figure 3 The step 104 of “filtering out the second entity from the first entity based on the third coding feature” can be implemented by following the steps 1041 to 1044 , which are described in detail below.
[0130] In step 1041 , for each first entity, a first probability of linking the reference to the first entity is determined based on the description information of the first entity, the part-of-speech information of the first entity, and the context information of the reference.
[0131] As an example, the descriptive information of the first entity is the explanatory information of the first entity, and the first probability is a comprehensive measure of the correlation between the first entity and its corresponding descriptive information, the correlation between the first entity and the referred context information, and the correlation between the first entity and the referred context information.
[0132] In some embodiments, see Figure 8 , Figure 8 This is a sixth flow chart of the entity linking method provided in an embodiment of the present application. Figure 7 The step 1041 of "determining a first probability of linking the reference to the first entity based on the description information of the first entity, the part-of-speech information of the first entity and the context information of the reference" can be implemented by following the steps 201 to 203, which are described in detail below.
[0133] In step 201 , a second correlation coefficient between the first entity and the description information is determined based on the coding feature of the first entity and the coding feature of the description information.
[0134] As an example, the first entity and the description information of the first entity are encoded respectively through a text encoder to obtain the encoding features of the first entity and the encoding features of the description information of the first entity. Based on the encoding features of the first entity and the encoding features of the description information, the second correlation coefficient between each first entity and its description information is determined. The second correlation coefficient can characterize the correlation between the first entity and its corresponding description information. Among them, the encoding processing of the first entity and the description information of the first entity respectively through a text encoder can be referred to step 1021 above and will not be repeated here.
[0135] For example, the first entity set can be represented as C m , the first entity e∈C m , based on formula (1.5), determine the second correlation coefficient of the first entity e Wherein, formula (1.5) is as follows:
[0136]
[0137] Among them, v e is the encoding feature of the first entity e, is the encoding feature of the description information of the first entity e, c k The first entity set C m Any first entity in The first entity set C m The encoding feature of any first entity in .
[0138] In step 202 , a third correlation coefficient between the reference and the part of speech of the first entity is determined based on the third coding feature, the coding feature of the first entity, and the coding feature of the part of speech information.
[0139] As an example, based on the embedded coding model, the part-of-speech information of the first entity is embedded and encoded to obtain the encoding features of the part-of-speech information of the first entity. Based on the third encoding features, the encoding features of the first entity and the encoding features of the part-of-speech information, the third correlation coefficient between the reference and the part-of-speech of the first entity is determined. The third correlation coefficient can characterize the consistency between the part-of-speech of the reference and the words of the first entity. Among them, the embedded coding model includes Word2Vec model, GloVe model and BERT model, etc., which are not limited here.
[0140] In some embodiments, Figure 8 Step 202 shown can be implemented by the following steps: determining the fourth correlation coefficient between the reference and the part-of-speech information based on the third coding feature and the coding feature of the part-of-speech information; determining the fifth correlation coefficient between the first entity and the part-of-speech information based on the coding feature of the first entity and the coding feature of the part-of-speech information; determining the third correlation coefficient between the reference and the part of speech of the first entity based on the fourth correlation coefficient and the fifth correlation coefficient.
[0141] As an example, the fourth correlation coefficient can represent the correlation between the reference and the part-of-speech information of the first entity, and the fifth correlation coefficient can represent the correlation between the first entity and its part-of-speech information. Then, by multiplying the product of the fourth correlation coefficient and the fifth correlation coefficient, the third correlation coefficient between the reference and the part-of-speech of the first entity is determined, thereby indirectly achieving the quantification of the consistency between the part-of-speech of the reference and the words of the first entity.
[0142] For example, the third encoding feature can be represented as v m , the encoding feature of the first entity can be represented as v e , the encoding feature of the part of speech of the first entity can be represented as v t Based on the sigma function δ (sigmoid function), the fourth correlation coefficient P(t|m)=δ(v t .v m ), and the fifth correlation coefficient between the first entity and the part-of-speech information P(t|e)=δ(v t .v e ), based on formula (1.6), determine the third correlation coefficient P(t|e,m) between the reference and the part of speech of the first entity. Formula (1.6) is as follows:
[0143] P(t|e,m)=P(t|e)×P(t|m) (1.6)
[0144] In an embodiment of the present application, by multiplying the product of the fourth correlation coefficient and the fifth correlation coefficient to determine the third correlation coefficient between the part of speech of the reference and the first entity, the consistency between the part of speech of the reference and the words of the first entity is indirectly quantified, thereby improving the understanding and recognition ability of the subsequent entity linking task of the part of speech relationship, thereby improving the accuracy of entity linking.
[0145] In step 203 , the hit frequency of the first entity is determined from the context information, and a first probability is determined based on the second correlation coefficient, the third correlation coefficient, and the hit frequency.
[0146] As an example, for each first entity, the number of characters that hit the first entity in the referred context information is determined, and the ratio between the number of hit characters and the number of characters in the context information is determined as the hit rate of the first entity. The hit rate of each first entity is normalized to obtain the hit frequency of each first entity. The hit frequency of the first entity represents the correlation between the first entity and the referred context information. The product of the second correlation coefficient, the third correlation coefficient and the hit frequency is determined as the first probability.
[0147] For example, the first entity set can be represented as C m , the first entity e∈C m , the hit rate of the first entity e can be represented as f(e|m). Based on formula (1.7), the hit frequency P of the first entity e is determined freq (e|m), formula (1.7) is as follows:
[0148]
[0149] Among them, c k The first entity set C m Any first entity in .
[0150] Based on formula (1.8), determine the first probability P of linking the reference m to the first entity e prior (e|m), formula (1.8) is as follows:
[0151]
[0152] in, is the second correlation coefficient, P(t|e,m) is the third correlation coefficient, P freq (e|m) is the hit frequency.
[0153] In an embodiment of the present application, the second correlation coefficient is used to quantify the correlation between the first entity and its corresponding descriptive information; the third correlation coefficient is used to quantify the degree of association between the reference and the first entity in terms of part of speech; the hit frequency of the first entity is used to quantify the correlation between the contextual information of the first entity and the reference; and by determining the product of the second correlation coefficient, the third correlation coefficient and the hit frequency as the first probability, the overall correlation between the first entity and the reference can be more comprehensively reflected, thereby improving the accuracy and robustness of entity linking.
[0154] In step 1042 , a second probability of linking the reference to the first entity is determined based on the third encoding feature and the encoding feature of the first entity.
[0155] As an example, the second probability may characterize the semantic similarity between the third encoding feature of the reference and the encoding feature of the first entity.
[0156] In some embodiments, Figure 7 Step 1042 shown may be implemented by determining a sixth correlation coefficient between the third coding feature and the coding feature of each first entity; and normalizing the sixth correlation coefficient to obtain a second probability of linking the reference to the first entity.
[0157] As an example, for each first entity, matrix dot multiplication is performed on the third coding feature and the coding feature of the first entity to obtain the dot product of the third coding feature and the coding feature of the first entity, the above dot product is subjected to exponential operation to obtain the dot product after exponential operation, and the dot product after exponential operation is determined as the sixth correlation coefficient between the reference and the first entity, the sixth correlation coefficient of each first entity is normalized, and the second probability of linking the reference to each first entity is obtained respectively.
[0158] For example, the first entity set can be represented as C m , the first entity e∈C m , the third encoding feature of m can be represented as v m , the encoding feature of the first entity e can be represented as v e , determine the sixth correlation coefficient between the reference m and the first entity e, the sixth correlation coefficient can be represented as exp(v m ·v e ), based on formula (1.9), determine the second probability P of linking the reference m to the first entity e tex t(e|m), where formula (1.9) is as follows:
[0159]
[0160] Among them, c kThe first entity set C m Any first entity in The first entity set C m The encoding feature of any first entity in .
[0161] In an embodiment of the present application, by calculating the sixth correlation coefficient between the third coding feature and each first entity coding feature and normalizing the sixth correlation coefficient, the semantic similarity between the reference and each first entity can be effectively quantified, providing strong support for the entity linking task.
[0162] In step 1043 , a third probability of linking the reference to the first entity is determined based on the first probability and the second probability.
[0163] As an example, the sum of the first probability and the second probability is determined, and the product of the first probability and the second probability is determined, and the difference between the sum and the product is determined as the third probability linking the reference to the first entity.
[0164] For example, based on formula (1.10), the third probability P(e|m) that the reference m is linked to the first entity e is determined, where formula (1.10) is as follows:
[0165] P(e|m)=P prior (e|m)+P text (e|m)-(P prior (e|m)*P text (e|m)) (1.10)
[0166] Among them, P prior (e|m) is the first probability, P text (e|m) is the second probability.
[0167] In step 1044 , the second entity is filtered out from the first entity based on the third probability.
[0168] As an example, the first entity with the third highest probability is determined as the second entity.
[0169] For example, based on formula (1.11), the third most probable first entity is determined as the second entity Formula (1.11) is as follows:
[0170]
[0171] Among them, P(e|m) is the third probability, For the second entity.
[0172] In an embodiment of the present application, the probability of the reference being linked to the first entity is comprehensively evaluated from multiple dimensions, including the correlation between the first entity and its corresponding descriptive information, the correlation between the first entity and the contextual information of the reference, and the semantic correlation between the first entity and the reference, thereby greatly improving the accuracy and robustness of entity linking.
[0173] Below, an exemplary application of the entity linking method provided in an embodiment of the present application in a practical application scenario will be described.
[0174] Entity linking is the task of linking references in text to entities in a knowledge base. With the explosive growth of short text information on the Internet, entity linking tasks for short texts are playing an increasingly important role in practical applications (for example, information extraction, question answering, and understanding news headlines and comments in social media). Short text refers to text containing only a dozen words, and short texts expand the context around the reference (mention). In terms of form, short texts are usually very sparse and concise.
[0175] In related technologies, the entity linking model is mainly used. By evaluating the consistency between the context encoding and reference of the candidate entity, the consistency between the reference and each candidate entity is scored separately. The fine-grained interaction between the reference context and its candidate entity is not involved. At the same time, related technologies rely heavily on the semantic matching between the reference and the candidate entity, without in-depth exploration of the lexical and grammatical relationship between the reference and the candidate entity. In the entity linking task scenario of short texts with relatively scarce contextual information, the entity linking effect of related technologies is not ideal due to the lack of sufficient contextual information.
[0176] In order to solve the above problems, the present application embodiment proposes an entity linking method, see Figure 9 , Figure 9This is a first principle diagram of the entity linking method provided in an embodiment of the present application. The knowledge base 901 (equivalent to the second knowledge base above, for example, WordNet) provides a rich source of high-quality, manually curated knowledge, which can be used to reduce dependence on a single knowledge base and cover more entities related to the reference. Through the basic primitives of English morphology (for example, the composite method), the short text (equivalent to the context information of the reference mentioned above) is input into the reference identification module 902 to obtain the reference, and the reference is encoded through the context-only encoding module 903 to obtain the context encoding feature of the reference (equivalent to the first encoding feature mentioned above), and the synonym set of the reference in the knowledge base 901 (equivalent to the synonyms mentioned above) is regarded as the knowledge retrieved from the knowledge base. Based on the given reference and synonym set, a candidate knowledge base triple is constructed, and a bilinear model is used to learn the vector representation of the candidate knowledge base triple. Then, through the knowledge aggregation module 904, an attention mechanism is used to embed the candidate knowledge base triple into the context encoding feature of the reference. At this point, the context encoding feature of the reference is enhanced using the external knowledge base 901, and the enhanced encoding feature of the reference is obtained (equivalent to the third encoding feature mentioned above). In addition, through the supplementary additional knowledge base in the candidate entity generation module 905 (equivalent to the third knowledge base mentioned above), more accurate and comprehensive entity information in the background knowledge base is obtained, and the candidate entity set (equivalent to the first entity mentioned above) is obtained by calculating the editing distance between the coding features of the reference and the entities in the additional knowledge base, and the coding features of the candidate entities are determined. Through the reference-entity context coding module 906, the context-based probability between the enhanced coding features of the reference and the coding features of the candidate entities is determined (equivalent to the second probability mentioned above). Through the reference-entity type coding module 907, the coding features of the type of the candidate entity are calculated (equivalent to the coding features of the part-of-speech information of the entity mentioned above), and the prior probability (equivalent to the first probability mentioned above) is further determined, thereby improving the accuracy of disambiguation. Finally, the final probability is determined through the context-based probability and the prior probability. By capturing the probabilities of the above aspects, a competitive linking decision is made to link the reference to the corresponding entity.
[0177] The embodiment of the present application uses English word formation to identify references in short texts, retrieves potential relevant knowledge in the knowledge base to embed and integrate the contextual encoding features of the reference to enrich the encoding feature representation of the reference, and at the same time, encodes the entity descriptions and entity types in the knowledge base to obtain more complete information. Then, the semantic similarity between each reference and its candidate entities is estimated, and a link decision is made.
[0178] The entity linking method of the embodiment of the present application mainly includes three stages: the reference identification stage, the encoding stage and the entity linking stage. The entity linking method of the embodiment of the present application will be introduced below based on the above three stages respectively.
[0179] 1. Reference Identification Stage
[0180] The input of the reference recognition stage is natural language text, and the output is a reference list. Reference recognition includes: part-of-speech tagging (POS tagging), tokenization and compounding, and N-gram Tilling module.
[0181] 1. Part-of-speech tagging (POS tagging): Receives natural language text and tags each word in the natural language text with relevant tags (such as noun, verb, and adverb). This is used to identify verbs and noun phrases in the natural language text. Morphological rules can then be used to analyze stems and affixes, and output a list of word-to-tag correspondences.
[0182] 2. Tokenization and compounding: Delete all stop words in the natural language text and decompose the natural language text into multiple tokens (equivalent to the segmentation sequence above). Compound two or more tokens (equivalent to the segmentation sequence above) corresponding to compound words that do not include any stop words (combined into one token) to determine the token list.
[0183] Compounding can reduce the total number of tags in the tag list. English word formation includes five common word formation methods: conversion, compounding, abbreviation, postposition, and affix. The compounding method adopted in the embodiment of the present application is to arrange two or more words (equivalent to the above participles) in a certain order to form a new word. The new word constructed in this way is called a compound word (for example, newspaper). In the dataset, all entities are nouns. The main component of the compound word is noun, and the secondary component includes various word parts.
[0184] 3. N-Gram Tilling Module: Based on the rules of N-Gram Tilling word formation, if the tokens contain only stop words, the corresponding tokens are combined to obtain a reference list.
[0185] 2. Coding stage
[0186] The knowledge base contains different types of information about entities, such as entity descriptions (equivalent to the description information of the first entity above), references of entity links, and entity types (equivalent to the part-of-speech information of the first entity above). In order to ensure the accuracy of entity links, it is usually necessary to combine entity-related information from different sources. Specifically, the link between reference and entity can be achieved by encoding the relevant information of the entity and reference.
[0187] 1. Context-only encoding module
[0188] For example, for the natural language text "Who composed the theme song for Titanic directed by Cameron?", which contains two references, "Cameron" and "Titanic", in order to link "Cameron" to the correct entity, the local context in the natural language text (theme song, composer and Titanic) is needed, that is, the semantics of the reference needs to be retained through contextual representation.
[0189] The context S of the reference can be represented as S = w1,…,m,…,w n , m is a given reference. Through the long short-term memory model (LSTM model), the reference m and the context sequence around the reference m are encoded respectively, and then the local context representation of the reference m is determined.
[0190] Specifically, the cell state output at each time step in the LSTM model can be represented as s i , s i =LSTM(u i ,h i-1 ,s i-1 ), where u i is the i-th token w in the context S of the reference i Embedding features, h i-1 is the output result of the LSTM model at the i-1th time step, s i-1 is the cell state output at the i-1th time step.
[0191] The left LSTM follow-up sequence (w1, w2, ..., m) referring to m is encoded by the LSTM model, and we get (equivalent to the encoding feature of the third text above), the left LSTM following sequence (w n ,w n-1 ,…,m) is encoded to obtain (equivalent to the encoding features of the fourth text above), and then through a single-layer feedforward network, Processing is performed to obtain the unique context encoding feature of the reference (equivalent to the first coding feature referred to above).
[0192] It is worth noting that although in most datasets, multiple references in the same natural language text are different, for sentences containing two or more identical references, the context encoding features of the references at different positions are different.
[0193] 2. Knowledge aggregation module
[0194] The additional knowledge base WordNet contains lexical relationships between words, which the present embodiment will refer to as unique context encoding features Combined with high-quality knowledge retrieved from additional knowledge bases, a better encoding feature representation of the reference is obtained.
[0195] See also Figure 10 , Figure 10 This is a schematic diagram of the second principle of the entity linking method provided in an embodiment of the present application. Candidate knowledge base tuples that may be related to the reference (equivalent to the first entity above) are retrieved in the knowledge base WordNet, and then the candidate knowledge base tuples are embedded and encoded to obtain the encoding features of the candidate knowledge base tuples. The candidate knowledge base tuples are integrated with the unique context encoding features of the reference output by the LSTM model, which will be explained in detail below.
[0196] 1) Knowledge base embedding and retrieval
[0197] The knowledge base is a data storage in WordNet in the form of triples (subject, relation and object). The WordNet synonym set of the reference m is obtained, and the synonym set is regarded as a candidate knowledge base tuple of the above reference. The candidate knowledge base tuple is encoded using the text encoding model 1001 (for example, the BILINEAR model), and the encoding features of the candidate knowledge base tuple are determined based on the above formula (1.1). In the formula (1.1) shown above, f(s, r, o) is the encoding feature of the candidate knowledge base tuple, s, r, o are the encoding features with the reference (encoding features of the subject), the encoding features of the relationship between the reference and the synonym, and the encoding features of the synonym, respectively, and diag(r) is the diagonal matrix of the encoding features of the relationship between the reference and the synonym.
[0198] 2) Knowledge aggregation layer
[0199] The knowledge aggregation layer is the core part of the knowledge aggregation module, which is used to integrate the encoding features of the candidate knowledge base tuples into the unique context encoding features of the reference output by the LSTM model.
[0200] See also Figure 10 In the above, for each reference m, the unique context encoding feature of the reference output by the LSTM model corresponding to the reference m is obtained A set of potential related tuples are retrieved from the knowledge base WordNet as candidate knowledge base tuples referring to m, and the candidate knowledge base tuple is represented as Z(m). The encoding feature z of the jth candidate knowledge base tuple among the K candidate knowledge base tuples is measured using a bilinear algorithm. j and the relevance of the reference m, and uses the attention mechanism to calculate the attention weight of each candidate knowledge base tuple through the normalization module 1002, and then adaptively select the most relevant knowledge base tuple.
[0201] Based on the formula (1.2) shown above, the encoding feature z of the candidate knowledge base tuple is j The correlation between the reference m (equivalent to the first correlation coefficient above) and the encoding feature z of the candidate knowledge base tuple j The attention weight (equivalent to the weight coefficient above) is positively correlated, where α in the above formula (1.2) j is the encoding feature z of the candidate knowledge base tuple j The attention weight, is the encoding feature z of the candidate knowledge base tuple j and the correlation with the reference m, W is a trainable parameter.
[0202] Since there is no guarantee that there will be a tuple related to the reference in WordNet, the deviation point is introduced. (equivalent to the bias matrix above), and determine the attention weight of the deviation point based on the formula (1.3) shown above, where β is the weight coefficient of the deviation point, representing the importance or attention of the deviation point, and W is a trainable parameter.
[0203] Then, see Figure 10 , through the fusion module 1003, the encoding features of the candidate knowledge base tuples are integrated into the unique context encoding features of the reference output by the LSTM model. Specifically, based on the formula (1.4) shown above, the encoding features of the K candidate knowledge base tuples and the deviation points The fusion is performed to obtain the knowledge state vector k referring to m (equivalent to the fourth coding feature above).
[0204] if Then k is 0, and then k is combined with the unique context encoding feature output by the LSTM model Aggregate and get the output d of the knowledge aggregation layer.
[0205] 3) Output layer
[0206] The output d of the knowledge aggregation layer is input into a single-layer feedforward network to obtain the referred enhanced encoding feature v m .
[0207] 3. Entity Description Encoding Module
[0208] The additional knowledge base Freebase contains entity description information, which is very useful background knowledge. For the description information of a given entity, the description information is encoded to obtain the encoding feature sequence of each word in the description information [des1,des2…des n], convert the encoded feature sequence into a fixed-size vector and use a convolutional neural network (CNN) with global average pooling to determine the encoded features of the entity's description information
[0209] Reference-based enhanced encoding features m , determine the candidate entity set c referring to m from the knowledge base Freebase k .
[0210] Based on the formula (1.5) shown above, maximize the encoding feature v of the entity e In the candidate entity set C m The distribution probability of the description encoding feature is used to calculate the probability of the entity description (equivalent to the second correlation coefficient above).
[0211] 4. Entity type encoding module
[0212] Fine-grained types provide a very easy-to-obtain source of structured information, often more readily available than description or link data (for example, the knowledge base Freebase contains tens of millions of entities with types). By accurately predicting the type of the reference and matching it with the entity type, the ambiguity problem in entity linking tasks can be effectively resolved.
[0213] Each entity often has multiple types T in the type set T e , the probability P(t|e) of type t being associated with entity e (equivalent to the fifth correlation coefficient above) is calculated as δ(v t .v e ), where δ is the sigmoid function, v e is the encoding feature of the entity, v t It is the embedded coding feature of type t in the type set T. Type t is a label used to classify entities. These labels can help understand and process the attributes and relationships of entities. Common labels include person names, place names, organization names, etc.
[0214] By using the same method, the probability P(t|m) that type t is associated with reference m (equivalent to the fourth correlation coefficient above) is determined, and then through the direct interaction between the reference type and the entity type, based on formula (1.6) shown above, the probability P(t|e,m) of the entity type (equivalent to the third correlation coefficient above) is determined.
[0215] Entity Linking Stage
[0216] In the above, we first use English word formation to identify the reference in the text, then encode the reference context, and use an external knowledge base to enhance the encoding feature representation of the reference. Then, we use the reference-entity context encoding module to determine the context-based probability. At the same time, we measure the type relevance between the entity and the reference by determining the probability of the entity type. Finally, we combine the results of these two sources to make the entity linking decision.
[0217] A typical knowledge base contains millions of entities, which makes it too expensive to calculate the similarity score between each reference and all entities in the knowledge base. According to previous work, for each reference, reducing the potential entities to a relatively small subset has a very slight impact on the results of entity linking, but makes the entity linking process more efficient.
[0218] Specifically, for each reference, the enhanced encoding feature v of the reference is calculated through the Edit Distance calculation engine m The edit distance between the encoding features of the description information of the potential entity is calculated, and the top 50 potential entities with the smallest edit distance are obtained. The top 50 potential entities with the smallest edit distance are taken as candidate entities (equivalent to the first entity above), and are represented as C m ={e j}∈ε.
[0219] The frequency of each candidate entity in the context of the reference is represented as f(e|m). Based on the formula (1.7) shown above, the frequency of each candidate entity in the context of the reference is normalized to obtain the normalized frequency P freq (e|m) (equivalent to the hit frequency above).
[0220] Based on the formula (1.8) shown above, the prior probability P of the candidate entity is determined prior (e|m), where is the probability of the description of the candidate entity, P(t|e,m) is the probability of the type of the candidate entity, P freq (e|m) represents the normalized frequency, C m is a set of candidate entities.
[0221] For each candidate entity, based on the formula (1.9) shown above, the context-based probability is obtained by determining the probability distribution of the reference's enhanced coding features over the candidate entity's coding features.
[0222] The prior probability P of the candidate entity determined above prior (e|m) and context-based probability P text(e|m) is an independent extract signal source, and the final probability P(e|m) is determined based on the formula (1.10) shown above, where e∈C m , C m is a set of candidate entities.
[0223] Based on the formula (1.11) shown above, the candidate entity with the highest final probability is determined as the predicted entity referring to m (equivalent to the second entity above).
[0224] The entity linking method provided in the embodiment of the present application has the following beneficial effects:
[0225] 1) By integrating external knowledge into the encoding features of the reference, the accuracy of entity linking in short texts is enhanced, which can effectively solve the problem of insufficient decision-making ability in short text entity linking due to the lack of contextual information.
[0226] 2) The additional knowledge in the external knowledge base is jointly encoded with the context of the reference, which enriches the encoding representation of the reference and also covers more potential candidate entities.
[0227] The following continues to describe the exemplary structure of the entity linking device 555 provided in the embodiment of the present application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the entity linking device 555 of the memory 550 may include:
[0228] The first encoding module 5551 is used to encode the reference to obtain a first encoding feature of the reference.
[0229] The second encoding module 5552 is used to encode the synonyms of the reference to obtain second encoding features of the synonyms.
[0230] The coding fusion module 5553 is used to fuse the first coding feature and the second coding feature based on the weight coefficient of the synonym to obtain a third coding feature of the reference.
[0231] The entity screening module 5554 is configured to screen out a second entity from the first entity based on the third coding feature, and link the reference to the second entity.
[0232] In some embodiments, the second encoding module 5552 is further used to perform text encoding processing on the reference, the synonym and the first text respectively to obtain the encoding features of the reference, the encoding features of the synonym and the encoding features of the first text, wherein the first text is used to represent the hierarchical relationship between the semantics of the reference and the semantics of the synonym; and the encoding features of the reference, the synonym and the first text are integrated to obtain the second encoding features of the synonym.
[0233] In some embodiments, the coding fusion module 5553 is further used to determine a first correlation coefficient between the reference and the synonym based on the first coding feature and the second coding feature; and normalize the first correlation coefficient to obtain a weight coefficient of the synonym.
[0234] In some embodiments, the entity screening module 5554 is also used to determine, for each first entity, a first probability of linking the reference to the first entity based on the description information of the first entity, the part-of-speech information of the first entity and the context information of the reference; determine a second probability of linking the reference to the first entity based on the third coding feature and the coding feature of the first entity; determine a third probability of linking the reference to the first entity based on the first probability and the second probability; and screen out the second entity from the first entity based on the third probability.
[0235] In some embodiments, the entity screening module 5554 is also used to determine a second correlation coefficient between the first entity and the descriptive information based on the coding features of the first entity and the coding features of the descriptive information; determine a third correlation coefficient between the reference and the part of speech of the first entity based on the third coding features, the coding features of the first entity and the coding features of the part of speech information; determine the hit frequency of the first entity from the context information, and determine the first probability based on the second correlation coefficient, the third correlation coefficient and the hit frequency.
[0236] In some embodiments, the entity screening module 5554 is also used to determine a fourth correlation coefficient between the reference and the part-of-speech information based on the third coding feature and the coding feature of the part-of-speech information; determine a fifth correlation coefficient between the first entity and the part-of-speech information based on the coding feature of the first entity and the coding feature of the part-of-speech information; and determine a third correlation coefficient between the reference and the part of speech of the first entity based on the fourth correlation coefficient and the fifth correlation coefficient.
[0237] In some embodiments, the entity screening module 5554 is further used to determine a sixth correlation coefficient between the third coding feature and the coding feature of each of the first entities; and normalize the sixth correlation coefficient to obtain a second probability of linking the reference to the first entity.
[0238] In some embodiments, the coding fusion module 5553 is further used to perform weighted processing on the second coding feature based on the weight coefficient of the synonym to obtain a fourth coding feature; fuse the fourth coding feature with the first coding feature to obtain a fifth coding feature; and perform feature extraction processing on the fifth coding feature to obtain the third coding feature of the reference.
[0239] In some embodiments, the entity linking device also includes a reference identification module, which is used to perform part-of-speech recognition processing on the second text to obtain part-of-speech information of the second text, wherein the second text includes the reference; perform word segmentation processing on the second text to obtain a first word segmentation, and based on the part-of-speech information, delete stop words in the first word segmentation to obtain a second word segmentation; perform aggregation processing on the second word segmentation to obtain the reference.
[0240] In some embodiments, the first encoding module 5551 is further used to determine the position of the reference in the second text; based on the position, split the second text into a third text and a fourth text, wherein the third text and the fourth text both include the reference; perform text encoding processing on the third text and the fourth text respectively to obtain the encoding features of the third text and the encoding features of the fourth text; and fuse the encoding features of the third text and the encoding features of the fourth text to obtain the first encoding features of the reference.
[0241] The present invention provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the entity linking method described above in the present invention.
[0242] The embodiment of the present application provides a computer-readable storage medium in which computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the entity linking method provided by the embodiment of the present application, for example, Figures 3 to 8 The entity linking method shown.
[0243] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0244] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0245] By way of example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0246] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0247] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. An entity linking method, characterized in that: The method comprises: performing encoding processing on the reference to obtain a first encoding feature of the reference; performing encoding processing on the synonyms of the reference to obtain a second encoding feature of the synonyms; Based on the weight coefficient of the synonym, the first coding feature and the second coding feature are fused to obtain a third coding feature of the reference; Based on the third coding feature, a second entity is selected from the first entity, and the reference is linked to the second entity.
2. The method according to claim 1, characterized in that The encoding process of the synonyms to obtain the second encoding features of the synonyms includes: Performing text encoding processing on the reference, the synonym, and the first text respectively to obtain encoding features of the reference, encoding features of the synonym, and encoding features of the first text, wherein the first text is used to represent a hyponymous relationship between the semantics of the reference and the semantics of the synonym; The coding feature of the reference, the coding feature of the synonym, and the coding feature of the first text are fused to obtain a second coding feature of the synonym.
3. The method according to claim 1, characterized in that The method further comprises: determining a first correlation coefficient between the reference and the synonym based on the first coding feature and the second coding feature; Normalizing the first correlation coefficient to obtain a weight coefficient of the synonym.
4. The method according to claim 1, wherein The filtering out the second entity from the first entity based on the third coding feature includes: For each first entity, determining a first probability of linking the reference to the first entity based on description information of the first entity, part-of-speech information of the first entity, and context information of the reference; determining a second probability of linking the reference to the first entity based on the third encoding feature and the encoding feature of the first entity; determining a third probability of linking the reference to the first entity based on the first probability and the second probability; Based on the third probability, the second entity is filtered out from the first entities.
5. The method according to claim 4, characterized in that The determining, based on the description information of the first entity, the part-of-speech information of the first entity, and the context information of the reference, a first probability of linking the reference to the first entity includes: determining a second correlation coefficient between the first entity and the description information based on the encoding feature of the first entity and the encoding feature of the description information; determining a third correlation coefficient between the reference and the part of speech of the first entity based on the third coding feature, the coding feature of the first entity, and the coding feature of the part of speech information; The hit frequency of the first entity is determined from the context information, and the first probability is determined based on the second correlation coefficient, the third correlation coefficient, and the hit frequency.
6. The method according to claim 5, characterized in that The determining, based on the third coding feature, the coding feature of the first entity, and the coding feature of the part-of-speech information, a third correlation coefficient between the reference and the part-of-speech of the first entity includes: determining a fourth correlation coefficient between the reference and the part-of-speech information based on the third coding feature and the coding feature of the part-of-speech information; determining a fifth correlation coefficient between the first entity and the part-of-speech information based on the encoding feature of the first entity and the encoding feature of the part-of-speech information; Based on the fourth correlation coefficient and the fifth correlation coefficient, a third correlation coefficient between the reference and the part of speech of the first entity is determined.
7. The method according to claim 4, characterized in that The determining, based on the third coding feature and the coding feature of the first entity, a second probability of linking the reference to the first entity comprises: determining a sixth correlation coefficient between the third coding feature and the coding feature of each of the first entities; The sixth correlation coefficient is normalized to obtain a second probability of linking the reference to the first entity.
8. The method according to any one of claims 1 to 7, characterized in that The fusing of the first coding feature and the second coding feature based on the weight coefficient of the synonym to obtain the third coding feature of the reference includes: performing weighted processing on the second coding feature based on the weight coefficient of the synonym to obtain a fourth coding feature; fusing the fourth coding feature with the first coding feature to obtain a fifth coding feature; Perform feature extraction processing on the fifth coding feature to obtain the referred third coding feature.
9. The method according to any one of claims 1 to 7, characterized in that Before encoding the reference to obtain the first encoding feature of the reference, the method further includes: performing part-of-speech recognition processing on a second text to obtain part-of-speech information of the second text, wherein the second text includes the reference; Performing word segmentation processing on the second text to obtain a first word segmentation, and deleting stop words in the first word segmentation based on the part-of-speech information to obtain a second word segmentation; Aggregation processing is performed on the second participles to obtain the reference.
10. The method according to any one of claims 1 to 7, characterized in that The encoding process of the reference to obtain a first encoding feature of the reference includes: determining the location of the reference in the second text; Based on the position, splitting the second text into a third text and a fourth text, wherein both the third text and the fourth text include the reference; Performing text encoding processing on the third text and the fourth text respectively to obtain encoding features of the third text and encoding features of the fourth text; The encoding feature of the third text and the encoding feature of the fourth text are fused to obtain the first encoding feature of the reference.
11. A physical link device, characterized in that: The device comprises: A first encoding module, configured to encode the reference to obtain a first encoding feature of the reference; A second encoding module is used to encode the synonyms of the reference to obtain second encoding features of the synonyms; a coding fusion module, configured to fuse the first coding feature and the second coding feature based on the weight coefficient of the synonym to obtain a third coding feature of the reference; An entity screening module is configured to screen out a second entity from the first entity based on the third coding feature, and link the reference to the second entity.
12. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; A processor, configured to implement the entity linking method according to any one of claims 1 to 10 when executing the computer-executable instructions or computer program stored in the memory.
13. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the entity linking method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the entity linking method according to any one of claims 1 to 10 is implemented.