Entity linking method and device
Through the dictionary-based entity discovery and entity linking method of word and entity joint representation model, the entity detection problem in news text is solved, the accurate identification and linking of entities is achieved, and text understanding and semantic information acquisition are improved.
Patent Information
- Application Number
- CN202110326779.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-26
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-03-26
AI Technical Summary
The existing technology is difficult to effectively process news texts from a large number of sources, making it almost impossible to detect Chinese news events. It is necessary to use computers to understand and analyze text semantics to extract effective information.
The dictionary-based entity discovery method is used to combine the joint representation model of word and entity for entity linking. Through the anchor text dictionary, Aho-Corasick algorithm and probabilistic entity model, the identification of entity mentions and linking to entities in the knowledge base is achieved.
Improve the accuracy and richness of entity links, assist in reading and text preprocessing, provide richer background knowledge, and provide semantic information for natural language processing tasks.
Smart Images

Figure CN112989808B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an entity linking method and device. Background Art
[0002] With the development of the Internet in the era of big data, people are surrounded by a large amount of news information from a wide range of sources, such as newspapers, the Internet, etc. The most common carrier of news is text, and text is the easiest way to obtain valuable information. Since news information is generated in various ways from different sources, the format and information contained in news texts are often disorganized, and the amount of news information generated is also extremely large. It is almost impossible to completely rely on manual detection of Chinese news events. Therefore, it is necessary to use computers to understand and analyze the semantics of texts and then extract effective information. Summary of the invention
[0003] In view of the problems existing in the prior art, an embodiment of the present invention proposes an entity linking method and device.
[0004] Specifically, the embodiment of the present invention provides the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides an entity linking method, comprising:
[0006] Perform entity discovery based on the dictionary to obtain entity mentions;
[0007] Perform entity linking based on the joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base;
[0008] The link relationship is subjected to branch pruning processing.
[0009] Furthermore, entity discovery is performed based on the dictionary to obtain entity mentions, including:
[0010] Constructing anchor text dictionary;
[0011] Based on the anchor text dictionary, an entity mention matching algorithm is adopted to identify entity mentions in the document.
[0012] Furthermore, an anchor text dictionary is constructed, including:
[0013] Extracting entities from the knowledge base, and extracting anchor text corresponding to the entities;
[0014] In the extracted anchor text m, the following filtering rules are applied for filtering:
[0015] Remove the anchor text whose length(m)≤length;
[0016] Remove the anchor texts with link_prob(m)≤prob;
[0017] Remove the anchor texts where count(m)≤count;
[0018] According to the anchor text obtained after filtering, the corresponding relationship between the entity and the anchor text is established, and the anchor text dictionary is constructed;
[0019] Among them, the values of length, prob, and count are preset; length(m) refers to the length of anchor text m, link_prob(m) refers to the prior probability of anchor text m, and the prior probability of anchor text m refers to the probability that anchor text m appears as an entity mention in the document; link_prob(m) = freq(m) / count(m), where freq(m) is the number of times m appears as an anchor text, and count(m) is the number of all occurrences of m in the corpus.
[0020] Further, based on the anchor text dictionary, an entity mention matching algorithm is used to identify entity mentions in the document, including:
[0021] Using the Aho-Corasick algorithm, identifying text segments of the document in the anchor text dictionary;
[0022] For the recognition results, if there is a conflict: an entity mention m1 is nested in another entity mention m2, or an entity mention m1 and another entity mention m2 overlap, the conflict is resolved as follows:
[0023] For m1 and m2 of different lengths, if length(m1)>length(m2), keep m1, otherwise keep m2;
[0024] For entity mentions of the same length, if link_prob(m1)>link_prob(m2), then m1 is retained, otherwise, m2 is retained.
[0025] Furthermore, entity linking is performed based on the joint representation of words and entities to obtain a link relationship between the entity mention and the entity in the knowledge base, including: establishing a joint representation model of words and entities;
[0026] Based on the joint representation model of the word and the entity, a probabilistic entity model is adopted to establish a link relationship between the entity mention and the entity in the knowledge base.
[0027] Furthermore, the joint representation model of words and entities includes a combination of a skip-gram model, a knowledge base model and an anchor text context model; accordingly, a joint representation model of words and entities is established, including:
[0028] Build a skip-gram model to learn the representation of words in a given text corpus by predicting the neighboring words of the word;
[0029] Build a knowledge base model to learn entity representation by predicting entities adjacent to the target entity;
[0030] Establish an anchor text context model, replace the anchor text with the corresponding entity, predict the words around the entity, and map the words and entities into the same semantic space;
[0031] When training the joint representation model of words and entities, the overall goal of the joint representation model of words and entities is to maximize the linear combination of three model objective functions.
[0032] Furthermore, based on the joint representation model of the word and the entity, a probabilistic entity model is adopted to establish a link relationship between the entity mention and the entity in the knowledge base, including:
[0033] Given an entity mention m i , find out the related entity e from the knowledge base according to the entity;
[0034] Based on entity e, generate entity mention m i context;
[0035] Generate entity mention m i Other entities in
[0036] Where, given an input document D and an entity mention m i , find out m in the knowledge base i The corresponding entity problem is determined to be of the following form:
[0037]
[0038] Among them, the generation process corresponding to each entity mention is independent of each other, where represents the context of the entity mention, and N represents the set of other unambiguous entities in the input document;
[0039] Given an input document D and an entity mention mi, the corresponding entity in the final knowledge base is the entity that maximizes the posterior probability P(ei|mi,D), so it is formalized as follows:
[0040]
[0041] P(e) is the prior distribution of the entity, which is defined as the prior distribution over the entire dataset. In order to control the impact of different priors in different fields, the impact factor α is introduced:
[0042]
[0043] Among them, A e,* is the set of anchor texts pointing to entity e, A *,* It is the set of all anchor texts in the knowledge base KB; α = 0 means that the entity prior is 1, and the value has no effect on the posterior probability P(e|m); α = 1 means that the prior probability is not controlled in any way;
[0044] is the context text distribution corresponding to e. An entity is more likely to appear in a context that matches its meaning. The context vector is represented by the average of the word vectors in the context of the entity mention:
[0045]
[0046] in, is the set of words in the context;
[0047] Create an Aho-Corasick index for the vocabulary corresponding to the word vector in advance, and directly use the Aho-Corasick algorithm to match the words in the entity mention context without the need for word segmentation.
[0048] is the cosine similarity between the candidate entity e and the context vector. Since the value range of cosine similarity is [-1, 1], it is mapped to the range of [0, 1];
[0049] P(N|e) is the probability distribution of context entities given entity e;
[0050] The method for calculating entity consistency includes: finding the initial unambiguous entity in the currently processed document, adding the initialized unambiguous entity set N, and determining the entity with a prior probability P^(e|m)>θ as an unambiguous entity, where P^(e|m)=|A e,m | / |A *,m |;
[0051] Process the found entity mentions {m1,m 2 ,,m |M|}, each time a disambiguated entity is obtained, it is added to set N, and the vector of set N is represented as the average of all entity vectors in it:
[0052]
[0053] Among them, E N Represents an unambiguous entity.
[0054] Furthermore, the pruning of the link relationship includes:
[0055] After the entity discovery and entity linking process, a result sequence R = {r1, r2, ..., r|M|}, ri = (mi, ei*, scorei) is obtained for each document D, where scorei is the value of P(e|m) in the entity linking result, which is regarded as the confidence of the entity linking;
[0056] Use the filtering algorithm to filter the final result: R is divided into i .score i Sort from high to low, retaining the first k% of the results Will link_prob(ri.m i )<∈ is removed, and the two parameters k and ∈ are preset.
[0057] In a second aspect, an embodiment of the present invention further provides an entity linking method, comprising:
[0058] The entity discovery module is used to discover entities based on the dictionary and obtain entity mentions;
[0059] An entity linking module is used to perform entity linking based on the joint representation of words and entities, and obtain the link relationship between the entity mention and the entity in the knowledge base;
[0060] A branch reduction processing module is used to perform branch reduction processing on the link relationship.
[0061] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the entity linking method as described in the first aspect is implemented.
[0062] It can be seen from the above technical scheme that the entity linking method and device provided by the embodiment of the present invention use a dictionary-based method to discover entities, and realize entity linking based on the method of joint representation of words and entities. The embodiment of the present invention uses a dictionary-based method in entity discovery, which effectively avoids the influence of Chinese word segmentation on entity discovery while increasing the recall rate. In addition, the embodiment of the present invention realizes entity linking based on the method of joint representation of words and entities, so that entity linking is more accurate and rich. Through the entity linking method of the embodiment of the present invention, auxiliary reading is realized, and text preprocessing can be assisted. For example, for auxiliary reading, news, documents or other texts with reading difficulties (such as entities or nouns that are not understood) can be entered into the page text box of the invention application, and entity recognition and linking will be returned. The URL corresponding to the entity in the knowledge base will be linked, and the user can click the URL to enter the entity details introduction page. In addition, for assisting researchers to do text preprocessing, entity recognition and linking are basic tasks in natural language processing. Entity linking links entities in text to the knowledge base, provides richer background knowledge for text, provides more semantic information for tasks such as text understanding and machine reading, and provides data basis for other natural language understanding research. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0064] Figure 1 is a flow chart of an entity linking method provided by an embodiment of the present invention;
[0065] Figure 2 is a schematic diagram of anchor text in Wikipedia provided by an embodiment of the present invention;
[0066] Figure 3 It is a schematic diagram of the processing process of entity linking provided by an embodiment of the present invention;
[0067] Figure 4 is a schematic diagram of the structure of a physical linking device provided by an embodiment of the present invention;
[0068] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0070] Figure 1 A flow chart of an entity linking method provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the entity linking method provided by the embodiment of the present invention specifically includes the following contents:
[0071] Step 101: Perform entity discovery based on a dictionary to obtain entity mentions;
[0072] Step 102: Perform entity linking based on the joint representation of words and entities to obtain a link relationship between the entity mention and the entity in the knowledge base;
[0073] Step 103: performing branch pruning processing on the link relationship.
[0074] Before introducing the solution of this embodiment, some background terms are introduced:
[0075] A knowledge base, also known as a knowledge graph, describes the relationship between entities and organizes knowledge into a directed graph, which represents all nodes of the knowledge graph. Each node represents an entity, and the entity has rich information descriptions, such as entity categories, information boxes, text descriptions, etc. It represents the set of relationships between two nodes. A knowledge graph can also be represented as a set of triples.
[0076] Entities represent specific things in the real world, or abstract concepts, such as people, organizations, places, or "machine learning", "artificial intelligence", etc. Different from the "named entities" in most studies, the entities referred to in this article include named entities (mainly people, organizations, places), common entities (such as movies, books, songs, cultural customs, food, materials, etc.) and abstract concepts (concepts without physical form generated by human abstract thinking). In the knowledge base, an entity may correspond to multiple concepts. For example, Michael Jordan belongs to both the category "basketball player" and the category "Presidential Medal of Freedom Recipient" in Wikipedia.
[0077] Documents, which are the input of entity discovery tasks, are word sequences. A word sequence is an ordered sequence of words (English) or characters (Chinese).
[0078] Entity mentions refer to text segments that mention entities. They may be a single word or several consecutive words. For example, basketball player "Michael Jordan" may have different entity mentions in different documents, such as "Jordan" or "Flying Man".
[0079] Anchor text refers to the hypertext in an encyclopedia page that points to another entity page. It is collaboratively edited by the creators of the encyclopedia content and is a natural entity mention-entity annotation data. Figure 2 As shown, the text with hyperlinks displayed in the Wikipedia page is anchor text. The hyperlink of the text "Charlotte Hornets" points to the "Charlotte Hornets" entry page in Wikipedia, and the hyperlink of the text "Chicago Bulls" points to the "Chicago Bulls" entry page in Wikipedia.
[0080] The anchor text dictionary is generated by aggregating the entity mentions and the corresponding relationships between entities represented by all anchor texts in the knowledge base. It is in the form of key-value pairs, where the key represents the entity mention and the value represents the entity. This dictionary is a one-to-many dictionary, and a key may correspond to multiple values. For example, "Michael Jordan" is a key, and its corresponding values are "Michael Jordan", "Michael Jordan (scholar)" and "Michael Jordan (football player)". At the same time, "flying man" is also a key, which has only one corresponding value - the entity "Michael Jordan".
[0081] Entity linking, given a document and a knowledge base, entity linking aims to identify all entity mentions in the text and find the entity corresponding to each entity mention in the knowledge base. If the knowledge base does not include the entity referred to by the entity mention, it needs to be mapped to an empty entity.
[0082] In this embodiment, it should be noted that the entity linking task is generally divided into three steps: entity discovery, candidate entity generation (corresponding to entity linking) and candidate entity disambiguation (corresponding to pruning). Entity discovery aims to identify all entity mentions in a document, and candidate entity generation finds the knowledge base entities that each entity mention may refer to, which is called a candidate entity set. Candidate entity disambiguation is to determine the knowledge base entity to which the entity mention refers.
[0083] like Figure 3 As shown, this embodiment mainly includes three parts: entity discovery, entity linking, and branch reduction. The entity discovery stage includes the construction of an anchor text dictionary and the matching of entity mentions; then the entity linking includes the joint representation learning of words and entities and the entity linking based on the probabilistic disambiguation model of the joint representation of words and entities, wherein the word and entity joint representation model part includes three parts: a conventional skip-gram model, a knowledge base model, and an anchor text context model; finally, the results of entity discovery and entity linking are subjected to branch reduction processing.
[0084] The following is a detailed explanation of entity discovery, entity linking and branch reduction:
[0085] In this embodiment, entity discovery mainly includes two parts: construction of anchor text dictionary and matching of entity mentions. The construction of anchor text dictionary is described in detail as follows:
[0086] Anchor text can be regarded as a manually annotated matching pair of entity mention-entity. Anchor text may be the title, alias, or synonym of an entity. For example, the anchor text "apple" may point to different entities "Apple" or "apple (fruit)" in different contexts and pages. The entity "Apple" may also be referred to by multiple anchor texts (such as "Apple" and "apple"). The natural many-to-many relationship between anchor text and entity coincides with the many-to-many relationship between anchor text and entity required for entity linking. Therefore, anchor text can be used as a good training corpus for entity discovery and entity linking. The data used can be a general encyclopedia database or a specific field database, such as Wikipedia in English, Baidu Encyclopedia in Chinese, Toutiao Encyclopedia, etc. Different languages have different knowledge bases, such as IMDB in the film field and DBLP in the scientific research field. However, the prerequisite of the knowledge base is that the information provided in the knowledge base includes: entity name, text description of entity, entity attributes and attribute values, entity category, and relationship between entities.
[0087] It is understandable that there will inevitably be erroneous noise in the database. Therefore, the extracted anchor text needs to be filtered. This embodiment introduces the prior probability of m, that is, the probability that m is linked to an entity in a knowledge base as an entity mention. In the case of anchor text, it is the probability that m appears as an anchor text. In probability theory, when the number of sampling times of a sample is large enough, the probability of an event occurring can be approximated by the frequency with which the event is sampled. Therefore, the prior probability is defined as link_prob(m)=freq(m) / count(m), where freq(m) is the number of times m appears as an anchor text, and count(m) is the number of times m appears in the corpus. By observing all the anchor text data, it is found that in the English anchor text, there are a large number of cases where one character refers to some entities. In this case, the ambiguity is too great, which will introduce too much noise to the entity link part, and considering that the entity mention discovery algorithm is based on string matching, a one-character anchor text will cause a waste of computing resources during matching. At the same time, for anchor texts with a very low probability of occurrence, that is, the number of times they appear as anchor texts is far less than the number of times they appear as ordinary text, it is believed that such anchor texts are more likely to be ordinary words rather than entities. In addition, some anchor texts appear very few times in total. Although their relative probability value may be 1, such anchor texts are considered to be very uncommon entity mentions and may also be some erroneous noise. Considering the efficiency of entity discovery and linking, these very rare anchor texts are deleted.
[0088] To this end, this embodiment applies the following filtering rules to filter all anchor texts:
[0089] 1) Remove the anchor text with length(m)≤length;
[0090] 2) Remove the anchor texts where link_prob(m)≤prob;
[0091] 3) Remove the anchor texts where count(m)≤count.
[0092] The values of length, prob, and count are preset, for example, they can be preset based on experience.
[0093] In this embodiment, for entity mention matching, its basic entity mention matching algorithm idea is: given the input text, identify the text fragments in the text in the anchor text dictionary. In order to speed up the matching of the string, this embodiment uses the Aho-Corasick algorithm. The algorithm is mainly implemented by constructing a finite state machine, that is, adding mismatch pointers in the Trie tree. These additional mismatch pointers allow fallback when the string search fails, and then turn to other branches to continue matching, which can effectively avoid repeated matching prefixes and improve matching efficiency. For example, suppose the Trie tree fails to match the word cat, but there is another word cart in the Trie tree, the mismatch pointer will point to the prefix ca, and continue to match from the "r" branch.
[0094] However, because the Aho-Corasick algorithm searches for all entity mentions in a given text at the same time, the present invention has introduced that entity mentions are nested, and then there may be conflicts in matching, including two types: 1) one entity mention is nested in another entity mention, 2) one entity mention and another entity mention overlap each other, for example, the anchor text dictionary matching results of "Nanjing Yangtze River Bridge" include "Nanjing City", "Mayor", "Yangtze River Bridge", "Jiang Bridge". For this reason, this embodiment proposes two assumptions: 1) It is assumed that the longer the length of the entity mention is, the more specific the entity it refers to is; 2) When the lengths of two conflicting entity references are the same, the mention with a larger link_prob(m) is more likely to refer to an entity. Therefore, the conflict resolution strategy of this embodiment is: for m1 and m2 of different lengths, if length(m1)>length(m2), this embodiment retains m1, otherwise, retains m2; for entity mentions of the same length, if link_prob(m1)>link_prob(m2), this embodiment retains m1, otherwise, retains m2. Finally, this embodiment inputs the reference m of the matched entity into the previously constructed dictionary to obtain its possible corresponding entity set {e1, e2, ..., e|c|}, which is input into the entity linking step for disambiguation processing.
[0095] In this embodiment, the entity linking part, for the entity discovery result {m 1 ,m 2 ,...,m |M|} and its corresponding candidate entity set C 1 ,C 2 ,...,C |M| , the entity link is for each m i In its corresponding candidate entity set C i Find a corresponding entity ei* in . This part mainly includes two tasks: 1) learning the joint representation of words and entities; 2) using a probabilistic disambiguation model for entity linking based on the joint representation of words and entities.
[0096] The joint representation of words and entities is explained and illustrated below. This embodiment uses a joint representation model of words and entities. The model is mainly based on the skip-gram model. Skip-gram was first proposed to learn the embedded representation of words, and its central idea is to use the target word to predict the words in its context. The joint representation model of words and entities used in the present invention has three parts based on the skip-gram model: 1) a conventional skip-gram model, which learns the representation of words in a given text corpus by predicting the adjacent words of the word; 2) a knowledge base model, which learns the representation of entities by predicting the adjacent entities of the target entity; 3) an anchor text context model, which replaces the anchor text with the corresponding entity, predicts the words in the context around the entity, and maps the words and entities into the same semantic space.
[0097] (1) Word Representation Learning
[0098] Given a word sequence w containing T words 1 ,w 2 ,...,w T , the goal of the skip-gram model is to maximize the objective function in the following formula:
[0099]
[0100] Where c is the size of the context window, w t represents the target word, w t+j Represents the context word. Conditional probability P(w t+j |w t ) is calculated according to softmax, as shown in the following formula:
[0101]
[0102] Among them, W is the set of all words, V w and U w Represents the vector of word w in matrix V and matrix U.
[0103] (2) Knowledge base model
[0104] In the electric customer service knowledge base, each entity has links to other entities, which the present invention calls "external links". The present invention uses the external link relationship between entities to learn the relevance between entities. Another method to measure the relevance between entities is the Wikipedia Link-based Measure (WLM), which is applied as a feature of entity links. WLM is calculated according to the following formula:
[0105]
[0106] Among them, E is the entity in the knowledge base KB, C e is a set of links pointing to entity e. The assumption of the WLM method is that entities with more intersections of link sets are more related. Inspired by the WLM method, based on the skip-gram model, the connection relationship between entities can be regarded as the contextual relationship between words. Therefore, the knowledge base model is formalized as follows:
[0107]
[0108] Similarly, the conditional probability P(e o |e i ) can also be calculated using softmax.
[0109] (3) Anchor Text Context Model
[0110] If we simply combine the skip-gram model of a word with the knowledge base model, the word and the entity are not in the same vector space. Therefore, we can use the anchor text to replace the anchor text with the entity it represents. Based on the skip-gram model, we can use the entity to predict the words in its context. The objective function of the model is as follows:
[0111]
[0112] Among them, A is the anchor text set, and Q is the set of context words around the anchor text. During training, the overall goal of the model is to maximize the linear combination of the three model objective functions, as shown in the following formula:
[0113] L=L w +L e +L a
[0114] The following is a detailed introduction to the probabilistic entity model. The entity linking process can be regarded as a generative process. Given an entity mention m i First, find a related entity e from the knowledge base KB according to the entity, and then generate entity mention m according to entity e i Finally, we generate entity mention m i Therefore, given an input document D and entity mention m i , find out m in the knowledge base i The corresponding entity problem can be inferred to be in the form of:
[0115]
[0116] This example assumes that the generation process of each entity mention is independent of each other. represents the context of the entity mention, and N represents the set of other unambiguous entities in the input document.
[0117] In this example, given an input document D and entity mention m i , the corresponding entity in the final knowledge base is the one that maximizes the posterior probability P(e i |mi,D) entity, therefore, can be formalized as follows:
[0118]
[0119] P(e) is the prior distribution of the entity. This embodiment defines the prior distribution of the entity as the prior distribution over the entire data set, for example, it can be the prior distribution in the field of electric power customer service. In a large-scale corpus, the more times an entity is mentioned, the more well-known this entity may be. However, in different fields, the prior probability of an entity may be different. For example, in the field of electric power customer service, the probability that the term "system internal overvoltage" refers to "power system content overvoltage" in the field of electric power customer service is greater than in the open field. Therefore, in order to control the impact of different priors in different fields, this embodiment introduces an impact factor α, as shown in the following formula:
[0120]
[0121] Among them, A e,* is the set of anchor texts pointing to entity e, A *,* is the set of all anchor texts in the KB. α=0 means that the entity prior is 1, that is, its value has no effect on the posterior probability P(e|m), and α=1 means that the prior probability is not controlled in any way.
[0122] is the context text distribution corresponding to e. An entity is more likely to appear in a context that matches its meaning. For example, when there are words such as "monthly fee" and "total fee" in the context, the entity mention "electricity fee" is more likely to refer to the entity "monthly electricity fee" rather than "electricity fee per kilowatt-hour". Therefore, this embodiment uses the average of the word vectors in the context of the entity mention to represent the context vector, that is, the following formula:
[0123]
[0124] in, It is a collection of words in the context. The present invention establishes an Aho-Corasick index in advance for the vocabulary corresponding to the word vector, so the Aho-Corasick algorithm can be directly used to match the words in the entity mention context without the need for operations such as word segmentation. The present invention regards it as the cosine similarity between the candidate entity e and the context vector. Since the value range of cosine similarity is [-1, 1], this embodiment maps it to the range of [0, 1].
[0125] P(N|e) is the probability distribution of context entities for a given entity e. In a related context, such as a news article, entities usually belong to the same topic, and these entities are usually close in the semantic space. Therefore, this distribution can also be regarded as the distribution of topic consistency of entities. This embodiment designs a two-step method for calculating entity consistency. First, the present invention finds the initial unambiguous entity in the currently processed document and adds it to the initialized unambiguous entity set N. This embodiment defines entities with prior probability P^(e|m)>θ as unambiguous entities, where P^(e|m)=|A e,m | / |A *,m |, in the system, this embodiment selects θ = 0.95; then, this embodiment processes the entity mentions of entity e in the order from left to right (L2R) or from simple to complex (S2C) {m 1 ,m 2 ,,m |M|}, each time a disambiguated entity is obtained, it is added to set N. The vector of set N is represented as the average of all entity vectors in it, that is, the following formula:
[0126]
[0127] Among them, E N Represents an unambiguous entity. P(N|e) is calculated by the cosine similarity of the vector of the set N and the vector of the candidate entity. In this embodiment, it is found that the difference in the results brought by the processing order of S2C and L2R is not obvious. Considering that the order of S2C needs to be sorted again, the present invention adopts the order of L2R in the specific implementation.
[0128] In addition, the following part is explained and illustrated about the result pruning. After the process of entity discovery and entity linking, for each document D, the present invention can obtain a result sequence R = {r1, r2, ..., r|M|}, ri = (m i ,e i *,score i ), where score i is the value of P(e|m) in the entity linking result, which is regarded as the confidence of entity linking in the present invention. Since the number of dictionaries built based on encyclopedias is huge, it is inevitable that some noise entities will be left if all entities are retained in entity discovery. Therefore, the present invention designs a simple filtering algorithm to filter the final results, and filters R according to ri .score i Sort from high to low, retaining the first k% of the results Will link_prob(r i .m i )<∈. The two parameters k and ∈ are determined by experience. i .score i Sort from high to low, retaining the first k% of the results "This is not considered a priority.
[0129] In this embodiment, examples of entity recognition and entity linking data can be referred to Table 1 and Table 2 below.
[0130] Table 1 Entity recognition
[0131]
[0132] Table 2 Entity linking
[0133]
[0134] The following are examples of Chinese and English. The knowledge base uses Wikipedia and Baidu Encyclopedia. The number of anchor texts is huge. According to statistics, there are nearly 10 million anchor texts in English Wikipedia pages and more than 3 million anchor texts in Baidu Encyclopedia. Rich anchor texts provide sufficient data support for entity discovery and entity linking. By extracting anchor texts from Baidu Encyclopedia and English Wikipedia, an anchor text dictionary is constructed. Each key in the dictionary can be regarded as a mention of an entity, and the corresponding value can be regarded as the entity that should be mentioned in the knowledge base.
[0135] Table 3: Display of some anchor text dictionaries
[0136]
[0137] In addition, since the English Wikipedia also includes disambiguation pages, that is, for an entity name, all possible entities that it may refer to are given, this part of data is also added to the English anchor text dictionary. Finally, the total amount of the anchor text dictionary obtained is: the English Wikipedia anchor text dictionary has a total of 4,843,616 entity mentions-entity matches, and Baidu Encyclopedia has a total of 2,895,610 entity mentions-entity matches.
[0138] The present invention applies the following filtering rules to all anchor texts: length is 1, prob is 0.01, and count is 2. (The range of numbers can be enlarged)
[0139] 1) Remove the anchor text where length(m) ≤ 1;
[0140] 2) Remove the anchor text where link_prob(m) ≤ 0.01;
[0141] 3) Remove the anchor text where count(m) ≤ 2.
[0142] The following is an example for illustration. For example, for the example where m1 is "Nanjing Yangtze River Bridge" and m2 is "Yangtze River Bridge", at this time, length(m1) and length(m2) are 7 and 4 respectively, so length(m1) > length(m2), and then m1 is retained. For the example where m1 is "Time-of-Use Tariff for Electric Heating" and m2 is "Tiered Tariff for Electric Heating", at this time, length(m1) and length(m2) are both 7, that is, length(m1) = length(m2), but link_prob(m1) < link_prob(m2), in this case, m2 should be retained.
[0143] For the result pruning part, the value of ∈ is taken as 0.0008. (The range can be enlarged) "Sort R according to r i .score i from high to low, and retain the top k% of the results as The rule does not perform filtering.
[0144] Table 4 shows the results of Chinese entity discovery and entity linking
[0145]
[0146] In the first sentence, "Li Na" is an ambiguous entity mention, which may refer to the female singer Li Na or the tennis player Li Na. The "tennis player" and the entity "Grand Slam" in the sentence help the entity to disambiguate when performing entity linking. The entity vector of tennis player Li Na has a high similarity with the context vector, and the entity similarity between the entity "Grand Slam" and "tennis player Li Na" is also high, so it can be successfully linked to "tennis player Li Na". In the second sentence, "Niu Zhihong" is basically unambiguous in Baidu Encyclopedia and refers to the entity "Li Na (pop singer)", so it can help the entity mention "Li Na" to link to the entity "Li Na (pop singer)". At the same time, the "song" in the context can help the entity mention "Li Na" and the entity mention "Qinghai-Tibet Plateau" to link. The results show that "Qinghai-Tibet Plateau" is linked to the song Qinghai-Tibet Plateau entity, but Baidu Encyclopedia also has two other entities "Qinghai-Tibet Plateau (songs sung by Li Na)" and "Qinghai-Tibet Plateau (songs written and composed by Zhang Yiqian)". By observing the three entities, we can find that they are all describing the song "Qinghai-Tibet Plateau". They are divided into three entities just because of different singers. In fact, they can be merged into one entity. It is considered that this is a data problem of Baidu Encyclopedia itself. Due to the "song" in the context and the entity "Li Na (pop singer)", the entity linking algorithm successfully distinguishes the song Qinghai-Tibet Plateau from the geographical location Qinghai-Tibet Plateau. In the third sentence, the entity "Microsoft" is basically unambiguous in the knowledge base, while the entity mentioning "Apple" is ambiguous. Since the entity vector of "Microsoft" and the entity vector of the entity "Apple" are closer in space than the vectors of other entities referred to by apple, it can be successfully linked to the entity "Apple".
[0147] According to the scheme of the full text, the embodiment of the present invention proposes an entity discovery and entity linking method based on the joint representation of words and entities. In addition, the embodiment of the present invention uses a dictionary-based approach in entity discovery, which effectively avoids the impact of Chinese word segmentation on entity discovery while increasing the recall rate. In addition, a simple selection strategy is designed to deal with the problem of conflicting entity discovery results. In addition, in the entity linking process, the embodiment of the present invention designs an unsupervised generative probability model based on the joint representation of words and entities to solve the ambiguity of entities. The purpose of the present invention is to achieve assisted reading and researchers can use it for text preprocessing through the entity discovery and entity linking method based on the joint representation of words and entities. 1. Assisted reading. News, documents or other texts with reading difficulties (such as those containing unknown entities or nouns) can be entered into the page text box of the invention application for entity recognition and linking, and the URL corresponding to the entity linked to the knowledge base will be returned. The user can click the URL to enter the entity details introduction page. 2. Assist researchers in text preprocessing. Entity recognition and linking are basic tasks in natural language processing. Entity linking links entities in text to the knowledge base, providing richer background knowledge for the text, more semantic information for tasks such as text comprehension and machine reading, and providing a data foundation for other natural language understanding research.
[0148] It can be seen from the above technical scheme that the entity linking method provided by the embodiment of the present invention uses a dictionary-based method to discover entities, and realizes entity linking based on the method of joint representation of words and entities. The embodiment of the present invention uses a dictionary-based method in entity discovery, which effectively avoids the influence of Chinese word segmentation on entity discovery while increasing the recall rate. In addition, the embodiment of the present invention realizes entity linking based on the method of joint representation of words and entities, so that entity linking is more accurate and rich. Through the entity linking method of the embodiment of the present invention, auxiliary reading is realized, and text preprocessing can be assisted. For example, for auxiliary reading, news, documents or other texts with reading difficulties (such as entities or nouns that are not understood) can be entered into the page text box of the invention application, and entity recognition and linking will be returned. The URL corresponding to the entity in the knowledge base will be linked, and the user can click the URL to enter the entity details introduction page. In addition, for assisting researchers to do text preprocessing, entity recognition and linking are basic tasks in natural language processing. Entity linking links entities in text to the knowledge base, provides richer background knowledge for text, provides more semantic information for tasks such as text understanding and machine reading, and provides data basis for other natural language understanding research.
[0149] Based on the content of the above embodiment, in this embodiment, entity discovery is performed based on a dictionary to obtain entity mentions, including:
[0150] Constructing anchor text dictionary;
[0151] Based on the anchor text dictionary, an entity mention matching algorithm is adopted to identify entity mentions in the document.
[0152] Based on the content of the above embodiment, in this embodiment, an anchor text dictionary is constructed, including:
[0153] Extracting entities from the knowledge base, and extracting anchor text corresponding to the entities;
[0154] In the extracted anchor text m, the following filtering rules are applied for filtering:
[0155] Remove the anchor text whose length(m)≤length;
[0156] Remove the anchor texts with link_prob(m)≤prob;
[0157] Remove the anchor texts where count(m)≤count;
[0158] According to the anchor text obtained after filtering, the corresponding relationship between the entity and the anchor text is established, and the anchor text dictionary is constructed;
[0159] Among them, the values of length, prob, and count are preset; length(m) refers to the length of anchor text m, link_prob(m) refers to the prior probability of anchor text m, and the prior probability of anchor text m refers to the probability that anchor text m appears as an entity mention in the document; link_prob(m) = freq(m) / count(m), where freq(m) is the number of times m appears as an anchor text, and count(m) is the number of all occurrences of m in the corpus.
[0160] Based on the content of the above embodiment, in this embodiment, based on the anchor text dictionary, an entity mention matching algorithm is adopted to identify entity mentions in the document, including:
[0161] Using the Aho-Corasick algorithm, identifying text segments of the document in the anchor text dictionary;
[0162] For the recognition results, if there is a conflict: an entity mention m1 is nested in another entity mention m2, or an entity mention m1 and another entity mention m2 overlap, the conflict is resolved as follows:
[0163] For m1 and m2 of different lengths, if length(m1)>length(m2), keep m1, otherwise keep m2;
[0164] For entity mentions of the same length, if link_prob(m1)>link_prob(m2), then m1 is retained, otherwise, m2 is retained.
[0165] Based on the content of the above embodiment, in this embodiment, entity linking is performed based on the joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base, including:
[0166] Establish a joint representation model of words and entities;
[0167] Based on the joint representation model of the words and entities, a probabilistic entity model is adopted to establish a link relationship between the entity mention and the entities in the knowledge base.
[0168] Based on the content of the above embodiment, in this embodiment, the joint representation model of words and entities includes a combination of a skip-gram model, a knowledge base model and an anchor text context model; accordingly, a joint representation model of words and entities is established, including:
[0169] Build a skip-gram model to learn the representation of words in a given text corpus by predicting the neighboring words of the word;
[0170] Build a knowledge base model to learn entity representation by predicting entities adjacent to the target entity;
[0171] Establish an anchor text context model, replace the anchor text with the corresponding entity, predict the words around the entity, and map the words and entities into the same semantic space;
[0172] When training the joint representation model of words and entities, the overall goal of the joint representation model of words and entities is to maximize the linear combination of three model objective functions.
[0173] Based on the content of the above embodiment, in this embodiment, based on the joint representation model of the word and the entity, a probabilistic entity model is adopted to establish a link relationship between the entity mention and the entity in the knowledge base, including:
[0174] Given an entity mention m i , find out the related entity e from the knowledge base according to the entity;
[0175] Based on entity e, generate entity mention m i context;
[0176] Generate entity mention m i Other entities in
[0177] Where, given an input document D and an entity mention m i , find out m in the knowledge base iThe corresponding entity problem is determined to be of the following form:
[0178]
[0179] Among them, the generation process corresponding to each entity mention is independent of each other, where represents the context of the entity mention, and N represents the set of other unambiguous entities in the input document;
[0180] Given an input document D and an entity mention mi, the corresponding entity in the final knowledge base is the entity that maximizes the posterior probability P(ei|mi,D), so it is formalized as follows:
[0181]
[0182] P(e) is the prior distribution of the entity, which is defined as the prior distribution over the entire dataset. In order to control the impact of different priors in different fields, the impact factor α is introduced:
[0183]
[0184] Among them, A e,* is the set of anchor texts pointing to entity e, A *,* It is the set of all anchor texts in the knowledge base KB; α = 0 means that the entity prior is 1, and the value has no effect on the posterior probability P(e|m); α = 1 means that the prior probability is not controlled in any way;
[0185] is the context text distribution corresponding to e. An entity is more likely to appear in a context that matches its meaning. The context vector is represented by the average of the word vectors in the context of the entity mention:
[0186]
[0187] in, is the set of words in the context;
[0188] Create an Aho-Corasick index for the vocabulary corresponding to the word vector in advance, and directly use the Aho-Corasick algorithm to match the words in the entity mention context without the need for word segmentation.
[0189] is the cosine similarity between the candidate entity e and the context vector. Since the value range of cosine similarity is [-1, 1], it is mapped to the range of [0, 1];
[0190] P(N|e) is the probability distribution of context entities given entity e;
[0191] The method for calculating entity consistency includes: finding the initial unambiguous entity in the currently processed document, adding the initialized unambiguous entity set N, and determining the entity with a prior probability P^(e|m)>θ as an unambiguous entity, where P^(e|m)=|A e,m | / |A *,m |;
[0192] Process the found entity mentions from left to right or from simple to complex. 1 ,m 2 ,,m |M|}, each time a disambiguated entity is obtained, it is added to set N, and the vector of set N is represented as the average of all entity vectors in it:
[0193]
[0194] Among them, E N Represents an unambiguous entity.
[0195] Based on the content of the above embodiment, in this embodiment, the entity linking method further includes:
[0196] After the entity discovery and entity linking process, a result sequence R = {r1, r2, ..., r|M|}, ri = (mi, ei*, scorei) is obtained for each document D, where scorei is the value of P(e|m) in the entity linking result, which is regarded as the confidence of the entity linking;
[0197] Use the filtering algorithm to filter the final result: R is divided into i .score i Sort from high to low, retaining the first k% of the results Will link_prob(ri.m i )<∈ is removed, and the two parameters k and ∈ are preset.
[0198] Figure 4 FIG. 1 shows a schematic diagram of the structure of the entity linking device provided by an embodiment of the present invention. Figure 4 As shown, the entity linking device provided by the embodiment of the present invention includes: an entity discovery module 21, an entity linking module 22 and a branch reduction processing module 23, wherein:
[0199] An entity discovery module 21 is used to perform entity discovery based on a dictionary to obtain entity mentions;
[0200] An entity linking module 22, configured to perform entity linking based on a joint representation of words and entities, and obtain a link relationship between the entity mention and the entity in the knowledge base;
[0201] The branch reduction processing module 23 is used to perform branch reduction processing on the link relationship.
[0202] Since the entity linking device provided in this embodiment can be used to execute the entity linking method provided in the above embodiments, its working principle and beneficial effects are similar and will not be described in detail here.
[0203] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, see Figure 5 , the electronic device specifically includes the following contents: a processor 301, a memory 302, a communication interface 303 and a communication bus 304;
[0204] The processor 301, the memory 302, and the communication interface 303 communicate with each other through the communication bus 304; the communication interface 303 is used to realize information transmission between various devices;
[0205] The processor 301 is used to call the computer program in the memory 302. When the processor executes the computer program, all steps of the above-mentioned entity linking method are implemented. For example, when the processor executes the computer program, the following steps are implemented: entity discovery is performed based on a dictionary to obtain entity mentions; entity linking is performed based on a joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base; and the link relationship is pruned.
[0206] Based on the same inventive concept, another embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, all the steps of the above-mentioned entity linking method are implemented. For example, when the processor executes the computer program, the following steps are implemented: entity discovery is performed based on a dictionary to obtain entity mentions; entity linking is performed based on a joint representation of words and entities to obtain the link relationship between the entity mentions and entities in the knowledge base; and the link relationship is pruned.
[0207] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0208] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. Those of ordinary skill in the art may understand and implement them without creative effort.
[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the entity linking method described in each embodiment or some parts of the embodiment.
[0210] In addition, in the present invention, terms such as "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0211] In addition, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0212] In addition, in the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0213] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An entity linking method, characterized in that: include: Perform entity discovery based on the dictionary to obtain entity mentions; Perform entity linking based on the joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base; Performing branch reduction processing on the link relationship; Entity discovery is performed based on the dictionary to obtain entity mentions, including: Constructing anchor text dictionary; Based on the anchor text dictionary, an entity mention matching algorithm is used to identify entity mentions in the document; Based on the anchor text dictionary, an entity mention matching algorithm is used to identify entity mentions in the document, including: Using the Aho-Corasick algorithm, identifying text segments of the document in the anchor text dictionary; For the recognition results, if there is a conflict: an entity mention m1 is nested in another entity mention m2, or an entity mention m1 and another entity mention m2 overlap, the conflict is resolved as follows: For m1 and m2 of different lengths, if length(m1)>length(m2), keep m1, otherwise keep m2; For entity mentions of the same length, if link_prob(m1)>link_prob(m2), keep m1, otherwise keep m2; Wherein, the values of length, prob, and count are preset; length(m) refers to the length of anchor text m, link_prob(m) refers to the prior probability of anchor text m, and the prior probability of anchor text m refers to the probability that anchor text m appears as an entity mention in the document; link_prob(m)=freq(m) / count(m), where freq(m) is the number of times m appears as an anchor text, and count(m) is the total number of times m appears in the corpus; Entity linking is performed based on the joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base, including: Establish a joint representation model of words and entities; Based on the joint representation model of the word and the entity, a probabilistic entity model is used to establish a link relationship between the entity mention and the entity in the knowledge base; The joint representation model of words and entities includes a combination of a skip-gram model, a knowledge base model and an anchor text context model; accordingly, a joint representation model of words and entities is established, including: Build a skip-gram model to learn the representation of words in a given text corpus by predicting the neighboring words of the word; Build a knowledge base model to learn entity representation by predicting entities adjacent to the target entity; Establish an anchor text context model, replace the anchor text with the corresponding entity, predict the words around the entity, and map the words and entities into the same semantic space; When training the joint representation model of words and entities, the overall goal of the joint representation model of words and entities is to maximize the linear combination of three model objective functions.
2. The entity linking method according to claim 1, characterized in that: Build an anchor text dictionary, including: Extracting entities from the knowledge base, and extracting anchor text corresponding to the entities; In the extracted anchor text m, the following filtering rules are applied for filtering: Remove the anchor text whose length(m)≤length; Remove the anchor texts with link_prob(m)≤prob; Remove the anchor texts where count(m)≤count; According to the anchor text obtained after filtering, the corresponding relationship between the entity and the anchor text is established, and the anchor text dictionary is constructed.
3. The entity linking method according to claim 1, characterized in that: Based on the joint representation model of the word and the entity, a probabilistic entity model is adopted to establish a link relationship between the entity mention and the entity in the knowledge base, including: Given an entity mention m i , find out the related entity e from the knowledge base according to the entity; Based on entity e, generate entity mention m i context; Generate entity mention m i Other entities in Where, given an input document D and an entity mention m i , find out m in the knowledge base i The corresponding entity problem is determined to be of the following form: ; Among them, the generation process corresponding to each entity mention is independent of each other. represents the context of the entity mention, and N represents the set of other unambiguous entities in the input document; Given an input document D and an entity mention mi, the corresponding entity in the final knowledge base is the entity that maximizes the posterior probability P(ei|mi, D), so it is formalized as follows: ; P(e) is the prior distribution of the entity, which is defined as the prior distribution over the entire dataset. In order to control the impact of different priors in different fields, the impact factor α is introduced: ; in, is the set of anchor texts pointing to entity e, is the set of all anchor texts in the knowledge base KB; α=0 means that the entity prior is 1, and the value is proportional to the posterior probability P ( e|m ) has no effect, α = 1 means that the prior probability is not subject to any control; is corresponding to e The context text distribution of an entity is higher in the context environment that matches its meaning. The context vector is represented by the average of the word vectors in the context of the entity mention: ; in, is the set of words in the context; Create an Aho-Corasick index for the vocabulary corresponding to the word vector in advance, and directly use the Aho-Corasick algorithm to match the words in the entity mention context without the need for word segmentation. is the cosine similarity between the candidate entity e and the context vector. Since the value range of cosine similarity is [-1, 1], it is mapped to the range of [0, 1]; P ( N | e ) is a given entity e The probability distribution of context entities; The method for calculating entity consistency includes: finding the initial unambiguous entity in the currently processed document, adding the initialized unambiguous entity set N, and determining the prior probability The entity of is an unambiguous entity, where ; Process the found entity mentions from left to right or from simple to complex { m 1, m 2, , m |M| }, each time a disambiguated entity is obtained, it is added to set N, and the vector of set N is represented as the average of all entity vectors in it: ; Among them, E N Represents an unambiguous entity.
4. The entity linking method according to claim 3, characterized in that: The link relationship is subjected to branch reduction processing, including: After the entity discovery and entity linking process, a result sequence is obtained for each document D , , where scorei is the value of P(e|m) in the entity link result, which is regarded as the confidence of the entity link; Use the filtering algorithm to filter the final result: R is filtered according to r i . score i Sort from high to low, keep the first k The result of % is ,Will middle The result is removed, and the two parameters k and Preset.
5. A physical linking device, characterized in that: include: The entity discovery module is used to discover entities based on the dictionary and obtain entity mentions; An entity linking module is used to perform entity linking based on the joint representation of words and entities, and obtain the link relationship between the entity mention and the entity in the knowledge base; A branch reduction processing module, used for performing branch reduction processing on the link relationship; Entity discovery is performed based on the dictionary to obtain entity mentions, including: Constructing anchor text dictionary; Based on the anchor text dictionary, an entity mention matching algorithm is used to identify entity mentions in the document; Based on the anchor text dictionary, an entity mention matching algorithm is used to identify entity mentions in the document, including: Using the Aho-Corasick algorithm, identifying text segments of the document in the anchor text dictionary; For the recognition results, if there is a conflict: an entity mention m1 is nested in another entity mention m2, or an entity mention m1 and another entity mention m2 overlap, the conflict is resolved as follows: For m1 and m2 of different lengths, if length(m1)>length(m2), keep m1, otherwise keep m2; For entity mentions of the same length, if link_prob(m1)>link_prob(m2), keep m1, otherwise keep m2; Wherein, the values of length, prob, and count are preset; length(m) refers to the length of anchor text m, link_prob(m) refers to the prior probability of anchor text m, and the prior probability of anchor text m refers to the probability that anchor text m appears as an entity mention in the document; link_prob(m)=freq(m) / count(m), where freq(m) is the number of times m appears as an anchor text, and count(m) is the total number of times m appears in the corpus; Entity linking is performed based on the joint representation of words and entities to obtain the link relationship between the entity mention and the entity in the knowledge base, including: Establish a joint representation model of words and entities; Based on the joint representation model of the word and the entity, a probabilistic entity model is used to establish a link relationship between the entity mention and the entity in the knowledge base; The joint representation model of words and entities includes a combination of a skip-gram model, a knowledge base model and an anchor text context model; accordingly, a joint representation model of words and entities is established, including: Build a skip-gram model to learn the representation of words in a given text corpus by predicting the neighboring words of the word; Build a knowledge base model to learn entity representation by predicting entities adjacent to the target entity; Establish an anchor text context model, replace the anchor text with the corresponding entity, predict the words around the entity, and map the words and entities into the same semantic space; When training the joint representation model of words and entities, the overall goal of the joint representation model of words and entities is to maximize the linear combination of three model objective functions.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 4 are implemented.
