Entity linking method, device, electronic device and storage medium
By calculating the co-occurrence probability of entity mentions and candidate entities and the co-occurrence probability of candidate entities and texts, entity links are determined, which solves the problem of insufficient accuracy and reliability of entity links in the existing technology and expands the scale of the knowledge graph.
Patent Information
- Application Number
- CN202110529673.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-05-14
AI Technical Summary
Existing entity linking technology is difficult to accurately link entities when there is no similar semantic vocabulary set between the entity mention context and the candidate entity description context in the knowledge graph, resulting in insufficient link accuracy and reliability.
By extracting the entity mentions of the text to be analyzed and the candidate entity set in the knowledge graph, calculate the co-occurrence probability of the entity mentions and the description information of the candidate entities and the co-occurrence probability of the candidate entities and the text to be analyzed, and obtain the first correlation degree and the third Two degrees of association, and obtain a comprehensive association measure value through a weighted average, and determine the target entity for linking.
It improves the accuracy and reliability of entity linking, expands the scale of the knowledge graph, and can accurately link entities without similar semantic words.
Smart Images

Figure CN113157946B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an entity linking method, device, electronic device and storage medium. Background Art
[0002] In the process of knowledge graph construction, entity linking is required. Entity linking is to associate external entity mentions with corresponding entities in the existing knowledge graph. At present, entity linking technology includes semantic or text structure comparison based on the context of entity mention and the description context of candidate entities in the knowledge graph, calculating similarity, and then judging whether to link. However, in many cases, there is no vocabulary set with similar semantics between the context of entity mention and the description context of candidate entities in the knowledge graph. For example, in the article "Sun Wukong Makes Trouble in Heaven", "Sun Wukong" is an entity mention, and there is a candidate entity "Monkey Brother" in the knowledge graph, which is described as "Monkey Brother Goes to the West to Journey to the West". At this time, entity linking technology based on semantic calculation and vocabulary comparison based on text structure cannot link the entity mention "Sun Wukong" with the candidate entity "Monkey Brother" in the knowledge graph. Summary of the invention
[0003] The present invention provides an entity linking method, device, electronic device and storage medium, which can improve the accuracy and reliability of entity linking and effectively expand the scale of knowledge graphs.
[0004] The present invention provides an entity linking method, comprising:
[0005] Extract entity mentions from the text to be analyzed;
[0006] Obtaining a candidate entity set mentioned by the entity from the knowledge graph, wherein the candidate entity set includes at least one candidate entity, and the candidate entity includes description information;
[0007] Obtaining a first correlation between the entity mention and the description information of each candidate entity, and obtaining a second correlation between each candidate entity and the text to be analyzed;
[0008] Based on the first degree of association and the second degree of association, a target entity is obtained from the candidate entity set, and the entity mention is associated with the target entity.
[0009] According to an entity linking method provided by the present invention, the obtaining of a first correlation between the entity mention and the description information of each candidate entity, and the obtaining of a second correlation between each candidate entity and the text to be analyzed, comprises:
[0010] Obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of each candidate entity and the text to be analyzed;
[0011] According to the co-occurrence probability of the entity mention and the description information of each candidate entity, a first correlation degree between the entity mention and the description information of each candidate entity is obtained, and according to the co-occurrence probability of each candidate entity and the text to be analyzed, a second correlation degree between each candidate entity and the text to be analyzed is obtained.
[0012] According to an entity linking method provided by the present invention, obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of each candidate entity and the text to be analyzed includes:
[0013] Obtaining the frequency of bigrams obtained by combining each word in the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity based on the frequency of bigrams obtained by combining each word in the entity mention and the description information of each candidate entity;
[0014] The frequency of the bigrams obtained by combining each candidate entity with each word in the text to be analyzed is obtained, and based on the frequency of the bigrams obtained by combining each candidate entity with each word in the text to be analyzed, the co-occurrence probability of each candidate entity and the text to be analyzed is obtained.
[0015] According to an entity linking method provided by the present invention, the frequency of the bigram vocabulary group is obtained based on text statistics in a preset basic corpus.
[0016] According to an entity linking method provided by the present invention, the step of obtaining a candidate entity set mentioned by the entity from the knowledge graph includes:
[0017] Get the aliases mentioned by the entity;
[0018] Based on the entity mention and the alias, a candidate entity set of the entity mention is matched from the knowledge graph.
[0019] According to an entity linking method provided by the present invention, obtaining a target entity from the candidate entity set based on the first degree of association and the second degree of association includes:
[0020] Obtaining a weighted average value of the first degree of association and the second degree of association, and using the weighted average value as a comprehensive association measurement value;
[0021] The target entity is obtained based on the comprehensive association metric and a first degree of association between the entity mention and the description information of each candidate entity.
[0022] According to an entity linking method provided by the present invention, obtaining the target entity based on the comprehensive association metric value and the first association between the entity mention and the description information of each candidate entity includes:
[0023] Obtaining a first degree of association greater than the comprehensive association metric value;
[0024] The candidate entity corresponding to the maximum first degree of association among the first degrees of association that are greater than the comprehensive association metric value is taken as the target entity.
[0025] The present invention also provides a physical linking device, comprising:
[0026] The extraction module is used to extract entity mentions from the text to be analyzed;
[0027] A candidate entity acquisition module, used to acquire a candidate entity set mentioned by the entity from the knowledge graph, wherein the candidate entity set includes at least one candidate entity, and the candidate entity includes description information;
[0028] A relevance calculation module, used to obtain a first relevance between the entity mention and the description information of each candidate entity, and to obtain a second relevance between each candidate entity and the text to be analyzed;
[0029] An entity linking module is used to obtain a target entity from the candidate entity set based on the first degree of association and the second degree of association, and associate the entity mention with the target entity.
[0030] The present invention also 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 program, the steps of any of the above-mentioned entity linking methods are implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the entity linking methods described above are implemented.
[0032] The entity linking method, device, electronic device and storage medium provided by the present invention first obtain multiple candidate entities such as names related to entity mentions from the knowledge graph, and then, based on big data, determine the co-occurrence of entity mentions and each word appearing in the description information of each candidate entity to obtain a first correlation, and the co-occurrence of each candidate entity with each word in the text to be analyzed of the entity mention to obtain a second correlation. Furthermore, the correlation between the entity mention and the multiple candidate entities can be accurately captured based on the closeness of the correlation between the first correlation and the second correlation, and the linked entities are determined based on the correlation between the entity mention and the multiple candidate entities, thereby ensuring that the entity mention can be accurately linked to the corresponding entity in the knowledge graph, improving the accuracy and reliability of entity linking, and effectively expanding the scale of the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0034] Figure 1 It is a flowchart of the entity linking method provided by the present invention;
[0035] Figure 2 is a schematic diagram of the entity linking method provided by the present invention;
[0036] Figure 3 It is a structural schematic diagram of the entity linking device provided by the present invention;
[0037] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] The following describes the entity linking method, device, electronic device and storage medium according to the embodiments of the present invention in conjunction with the accompanying drawings.
[0040] Among them, entity linking is to associate external entity mentions with the corresponding entities in the existing knowledge graph. In this way, on the one hand, the semantic information of entity mentions can be expanded, and on the other hand, the scale of the knowledge graph can be expanded more accurately.
[0041] In the above description, entity mention refers to entity information extracted from the text to be analyzed, such as the subject in the text to be analyzed. The entity mention serves as an object to be linked, that is, to be associated with the corresponding entity in the existing knowledge graph.
[0042] Figure 1 FIG. 1 is a flow chart of an entity linking method according to an embodiment of the present invention. Figure 1 As shown, the entity linking method according to an embodiment of the present invention includes the following steps:
[0043] S101: Extract entity mentions from the text to be analyzed.
[0044] like Figure 2 As shown, entity mentions in the text to be analyzed can be extracted by entity recognition. For example: automatic extraction of entity mentions is achieved based on a pre-prepared named entity recognition model (NER model for short), wherein a named entity recognition algorithm is used in the named entity recognition model to extract entity mentions in the text to be analyzed. Thus, after character-level preprocessing of the text to be analyzed and obtaining input data for the named entity recognition model, the named entity recognition model will automatically complete the named entity sequence annotation, and then, complete the extraction of entity mentions in the text to be analyzed according to the predicted annotation sequence.
[0045] For example, if the text to be analyzed is "Zhang San graduated from the Performance Department of the Central Academy of Drama, and is a male actor from Liaoning, China", the entity mentions extracted by the named entity recognition model may include "Zhang San", "China", "actor", etc.
[0046] S102: Obtain a candidate entity set of entity mentions from the knowledge graph, where the candidate entity set includes at least one candidate entity, and the candidate entity includes description information.
[0047] The knowledge graph includes multiple entities, and the candidate entity set is a set of one or more entities selected from the multiple entities in the knowledge graph, wherein the entity that the entity mention needs to be associated with is the entity in the candidate entity set. Therefore, in an embodiment of the present invention, the entity in the candidate entity set is called a candidate entity.
[0048] like Figure 2As shown, the generation of candidate entities, i.e., obtaining a candidate entity set of entity mentions from the knowledge graph, includes: obtaining an alias for entity mentions; based on entity mentions and aliases, matching the candidate entity set of entity mentions from the knowledge graph. The candidate entities in the candidate entity set include description information, which is the entity attribute of the candidate entity, usually a piece of text. For example, for a piece of text that has been linked to the knowledge graph, "The plot of Monkey King's havoc in heaven is very exciting", for this text, the entity in the knowledge graph can be "Sun Wukong", and its corresponding description information is "The plot of havoc in heaven is very exciting". Of course, the entity attributes of each candidate entity can also be obtained separately, and the candidate entity set corresponds to a candidate entity attribute set.
[0049] In one embodiment of the present invention, candidate entities can be generated based on entity mentions and aliases, and a set of names matched from the knowledge graph through regular expressions. That is, these name sets correspond to the names of entities in the knowledge graph, that is, the names in the name and combination correspond to the entities in the knowledge graph. The specific process is as follows:
[0050] According to the entity mention query, the pre-stored alias library contains entity mentions and their aliases. The alias library can expand the possible names of entity mentions. Since the aliases of entity mentions may have no intersection with the Chinese characters used in the real name of the entity mention, it is impossible to match and query using regular expressions. Therefore, first obtain the aliases of entity mentions, and then match and query based on the aliases and entity mentions respectively. For example: the alias of the movie entity name "Paradise Cinema" is "Starlight Accompanies My Heart". The alias library records the aliases corresponding to each entity, in the format of but not limited to two-tuple form, such as: <Paradise Cinema, Starlight Accompanies My Heart>.
[0051] After obtaining the aliases of entity mentions, a candidate entity set is obtained from the knowledge graph by applying regular expressions or edit distance based on the entity mentions and aliases. The regular expression matching methods include but are not limited to the following forms:
[0052] The name of a candidate entity in the candidate entity set is an entity that contains an entity mention or its alias, or the entity mention or alias contains the name of a candidate entity in the candidate entity set in the knowledge graph.
[0053] The edit distance describes the number of character-level changes that transform one character sequence into another. By calculating the edit distance between the names of two entities and comparing it with a set threshold, possible entity sets are screened out from the knowledge graph as candidate entity sets.
[0054] S103: Obtain a first correlation between the entity mention and the description information of each candidate entity, and obtain a second correlation between each candidate entity and the text to be analyzed.
[0055] In one embodiment of the present invention, a first degree of association between an entity mention and the description information of each candidate entity is obtained, and a second degree of association between each candidate entity and the text to be analyzed is obtained, including: obtaining the co-occurrence probability between the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability between each candidate entity and the text to be analyzed; obtaining the first degree of association between the entity mention and the description information of each candidate entity based on the co-occurrence probability between the entity mention and the description information of each candidate entity, and obtaining the second degree of association between each candidate entity and the text to be analyzed based on the co-occurrence probability between each candidate entity and the text to be analyzed.
[0056] In this example, the co-occurrence probability of entity mentions and the description information of each candidate entity is obtained, and the co-occurrence probability of each candidate entity and the text to be analyzed is obtained, including: obtaining the frequency of the two-gram vocabulary groups obtained by combining the entity mentions and each word in the description information of each candidate entity, and based on the frequency of the two-gram vocabulary groups obtained by combining the entity mentions and each word in the description information of each candidate entity, obtaining the co-occurrence probability of the entity mentions and the description information of each candidate entity; obtaining the frequency of the two-gram vocabulary groups obtained by combining each candidate entity with each word in the text to be analyzed, and based on the frequency of the two-gram vocabulary groups obtained by combining each candidate entity with each word in the text to be analyzed, obtaining the co-occurrence probability of each candidate entity with the text to be analyzed.
[0057] In the above example, the frequency of the bigram is obtained based on text statistics in a preset basic corpus, wherein the basic corpus includes multiple texts, that is, multiple texts are recorded, and the recorded texts can be collected in advance, for example, manually or online.
[0058] In the above description, the first degree of association represents the closeness of the association between the entity mention and the words in the description information of each candidate entity. For example, the closeness of the association can be determined by the probability of co-occurrence in big data. The greater the probability of co-occurrence, the greater the closeness, which means that the association between the entity mention and the candidate entity is stronger. Similarly, the second degree of association represents the closeness of the association between each candidate entity and the words in the text to be analyzed.
[0059] The first correlation degree and the second correlation degree are related to the co-occurrence probability. Therefore, the co-occurrence probability needs to be determined first, where the co-occurrence probability is the probability of co-occurrence. Specifically, Figure 2As shown in the figure, the co-occurrence probability generation is based on the basic corpus (i.e., big data). In other words, the co-occurrence probability is generated mainly based on the text records in the basic corpus, and the frequency of different bigram word combinations is counted as the co-occurrence probability and stored. The generation process is as follows:
[0060] First, the text is segmented and the number of times each word appears is counted. Then, each word is used as the head word in turn, and the number of times the head word and any other words form a binary word group, and then the statistical information corresponding to each word in the text record is obtained, for example: <word i, word j>: <number of times word i appears, number of times word i and word j appear together>. Among them, co-occurrence describes the situation of simultaneous appearance in the text. The text can be segmented and entity recognized first, and stop words are removed from the segmentation results. Stop words include but are not limited to: auxiliary words, adverbs, prepositions and other function words, to obtain the deduplicated vocabulary set and entity set. The statistical results obtained for the text are usually that each entity appears once, and each entity co-occurs with each word once.
[0061] For example, for text S1: "Zhang San graduated from the Performance Department of the Central Academy of Drama, a male actor from Liaoning, China." The operation steps are divided into step 1 and step 2, where step 1 is:
[0062] For word segmentation, the word segmentation results of S1 are "Zhang San", "graduation", "Central", "drama", "college", "performance department", "China", "Liaoning", "nationality", and "actor".
[0063] Entity recognition, the entity recognition result of S1 is: Zhang San.
[0064] To count the frequency, first get for each entity:
[0065] Zhang San: 1
[0066] Then combine the binary co-occurrence of entities and words to get:
[0067] <Zhang San, graduated>: <1, 1>;
[0068] <Zhang San, center>: <1, 1>;
[0069] <Zhang San, drama>: <1, 1>;
[0070] <Zhang San, College>: <1, 1>;
[0071] <Zhang San, Department of Performance>: <1, 1>;
[0072] <Zhang San, China>: <1, 1>;
[0073] <Zhang San, Liaoning>: <1, 1>;
[0074] <Zhang San, Nationality>: <1,1>;
[0075] <Zhang San, actor>: <1, 1>.
[0076] Step 2: Traverse each text record in the basic corpus. Repeat step 1 above for each text record, and perform a merge operation after obtaining the statistical results. During the merging process, add the number of occurrences of the corresponding words and bigrams to obtain the statistical results. If there is no new entity statistical information or bigram co-occurrence statistical information, add the information, otherwise perform an update operation in the original record statistical results.
[0077] The frequency matrix of the two-word combination in the statistical results is converted into a probability form, where the co-occurrence probability p is the corresponding frequency, that is:
[0078]
[0079] Among them, count() indicates the number of statistics.
[0080] The calculation of the relevance is divided into the calculation of the first relevance and the second relevance. The first is to calculate the relevance between the entity mention and the attribute set of each candidate entity, and the second is to calculate the relevance between each candidate entity and the context of the entity mention (i.e., the remaining text in the text to be analyzed except the entity mention). The calculation method of the relevance r is as follows:
[0081]
[0082] Where n represents the number of words after the text is segmented. Finally, the first relevance and the second relevance are obtained, and the weighted average of the first relevance and the second relevance is used as the comprehensive relevance measurement value of each candidate entity. The co-occurrence probability of each bigram group can be obtained by querying.
[0083] The specific calculation process of correlation is as follows:
[0084] Entity mentioned: Zhang San. The text to be analyzed S2 is: In 2011, Zhang San played the role of Little Li Guang Hua Rong in "New Water Margin".
[0085] Segmenting S2 yields: Zhang San, New Water Margin, played by, Little Li Guang, Hua Rong.
[0086] According to the entity mention and word segmentation results, we get the bigram vocabulary groups: <Zhang San, New Water Margin>, <Zhang San, plays>, <Zhang San, Little Li Guang>, <Zhang San, Hua Rong>.
[0087] According to the obtained two-word group, the co-occurrence probability p1 (Zhang San, New Water Margin), co-occurrence probability p2 (Zhang San, played by), co-occurrence probability p3 (Zhang San, Xiao Li Guang) and co-occurrence probability p4 (Zhang San, Hua Rong) are obtained, and then the correlation is obtained as follows:
[0088]
[0089] The above is to calculate the relevance between an entity and a text. In the embodiment of the present invention, the comprehensive relevance R is calculated by the weighted average of the relevance r1...m between the entity mention and each candidate entity attribute set (usually concatenated into a text form), and the relevance R1...m between each candidate entity and the entity mention context, where m represents the number of candidate entities.
[0090]
[0091] Among them, w1 and w2 are weights, w1 and w2 are values between 0 and 1, and can be set as needed.
[0092] S104: Based on the first degree of association and the second degree of association, a target entity is obtained from the candidate entity set, and the entity mention is associated with the target entity.
[0093] In one embodiment of the present invention, based on the first degree of association and the second degree of association, a target entity is obtained from the candidate entity set, including: obtaining a weighted average of the first degree of association and the second degree of association, and using the weighted average as a comprehensive association metric; based on the comprehensive association metric and the first degree of association between the entity mention and the descriptive information of each candidate entity, the target entity is obtained.
[0094] In this example, the target entity is obtained based on the comprehensive association metric and the first association between the entity mention and the description information of each candidate entity, including: obtaining a first association greater than the comprehensive association metric; taking the candidate entity corresponding to the maximum first association among the first associations greater than the comprehensive association metric as the target entity. That is to say, after obtaining the comprehensive association metric of the candidate entity set corresponding to the entity mention, the largest first association greater than the comprehensive association metric is taken and compared with the comprehensive association metric. If it exceeds the comprehensive association metric, it indicates that it can be linked, that is, the entity mention is associated with the corresponding entity, thereby accurately expanding the scale of the knowledge graph.
[0095] According to the entity linking method of an embodiment of the present invention, first, multiple candidate entities such as those related to the names of entity mentions are obtained from the knowledge graph. Then, based on big data, the co-occurrence of entity mentions and each word appearing in the description information of each candidate entity can be determined to obtain a first correlation, and the co-occurrence of each candidate entity with each word in the text to be analyzed of the entity mention can be determined to obtain a second correlation. Furthermore, the correlation between the entity mention and the multiple candidate entities can be accurately captured based on the closeness of the correlation between the first correlation and the second correlation, and the linked entities are determined based on the correlation between the entity mention and the multiple candidate entities. Furthermore, it is ensured that the entity mention can be accurately linked to the corresponding entity in the knowledge graph, thereby improving the accuracy and reliability of entity linking and effectively expanding the scale of the knowledge graph.
[0096] Compared with the existing entity linking technology, for example, in the article "Sun Wukong makes trouble in heaven", "Sun Wukong" is an entity mention, and there is a candidate entity "Monkey Brother" in the knowledge graph, which is described as "Monkey Brother goes to the West to obtain Buddhist scriptures". At this time, in the existing technology, the entity linking technology based on semantic computing and the lexical comparison based on text structure cannot link the entity mention "Sun Wukong" with the candidate entity "Monkey Brother" in the knowledge graph, but in fact the two can be linked. Through the entity linking method of the embodiment of the present invention, the correlation between "Sun Wukong" and "obtaining Buddhist scriptures from the West" can be analyzed. Similarly, the correlation between "Monkey Brother" and "making trouble in heaven" can be determined, and then, it can ensure that the entity mention is accurately linked to the corresponding entity in the knowledge graph.
[0097] The entity linking device provided by the present invention is described below. The entity linking device described below and the entity linking method described above can be referred to each other.
[0098] like Figure 3 As shown, the entity linking device according to an embodiment of the present invention includes: an extraction module 310, a candidate entity acquisition module 320, a relevance calculation module 330 and an entity linking module 340, wherein:
[0099] An extraction module 310 for extracting entity mentions from the text to be analyzed;
[0100] A candidate entity acquisition module 320 is used to acquire a candidate entity set mentioned by the entity from the knowledge graph, wherein the candidate entity set includes at least one candidate entity, and the candidate entity includes description information;
[0101] A relevance calculation module 330 is used to obtain a first relevance between the entity mention and the description information of each candidate entity, and to obtain a second relevance between each candidate entity and the text to be analyzed;
[0102] The entity linking module 340 is configured to obtain a target entity from the candidate entity set based on the first degree of association and the second degree of association, and associate the entity mention with the target entity.
[0103] According to the entity linking device of the embodiment of the present invention, first, multiple candidate entities such as names related to entity mentions are obtained from the knowledge graph, and then, based on big data, the co-occurrence of entity mentions and words appearing in the description information of each candidate entity can be determined to obtain a first correlation, and the co-occurrence of each candidate entity with words in the text to be analyzed of the entity mentions can be determined to obtain a second correlation. Furthermore, the correlation between the entity mention and the multiple candidate entities can be accurately captured based on the closeness of the correlation between the first correlation and the second correlation, and the linked entities are determined based on the correlation between the entity mention and the multiple candidate entities, thereby ensuring that the entity mentions can be accurately linked to the corresponding entities in the knowledge graph, improving the accuracy and reliability of entity linking, and effectively expanding the scale of the knowledge graph.
[0104] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the entity linking method, which includes: extracting entity mentions of the text to be analyzed; obtaining a candidate entity set of the entity mentions from the knowledge graph, the candidate entity set including at least one candidate entity, and the candidate entity including description information; obtaining a first degree of association between the entity mention and the description information of each candidate entity, and obtaining a second degree of association between each candidate entity and the text to be analyzed; based on the first degree of association and the second degree of association, obtaining a target entity from the candidate entity set, and associating the entity mention with the target entity.
[0105] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable 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: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the entity linking method provided by the above methods, and the method includes: extracting entity mentions from the text to be analyzed; obtaining a candidate entity set of the entity mentions from a knowledge graph, the candidate entity set including at least one candidate entity, and the candidate entity including description information; obtaining a first correlation between the entity mentions and the description information of each candidate entity, and obtaining a second correlation between each candidate entity and the text to be analyzed; based on the first correlation and the second correlation, obtaining a target entity from the candidate entity set, and associating the entity mention with the target entity.
[0107] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned entity linking methods, the method comprising: extracting entity mentions from the text to be analyzed; obtaining a candidate entity set of the entity mentions from a knowledge graph, the candidate entity set including at least one candidate entity, the candidate entity including description information; obtaining a first degree of association between the entity mentions and the description information of each candidate entity, and obtaining a second degree of association between each candidate entity and the text to be analyzed; based on the first degree of association and the second degree of association, obtaining a target entity from the candidate entity set, and associating the entity mentions with the target entity.
[0108] The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or 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 solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0109] 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, it can also be implemented 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 methods described in each embodiment or some parts of the embodiments.
[0110] 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: Extract entity mentions from the text to be analyzed; Obtaining a candidate entity set mentioned by the entity from the knowledge graph, wherein the candidate entity set includes at least one candidate entity, and the candidate entity includes description information; Obtaining a first correlation between the entity mention and the description information of each candidate entity, and obtaining a second correlation between each candidate entity and the text to be analyzed; Based on the first degree of association and the second degree of association, obtaining a target entity from the candidate entity set, and associating the entity mention with the target entity; The obtaining of a first correlation between the entity mention and the description information of each candidate entity, and obtaining a second correlation between each candidate entity and the text to be analyzed, includes: Obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of each candidate entity and the text to be analyzed; According to the co-occurrence probability of the entity mention and the description information of each candidate entity, a first correlation degree between the entity mention and the description information of each candidate entity is obtained, and according to the co-occurrence probability of each candidate entity and the text to be analyzed, a second correlation degree between each candidate entity and the text to be analyzed is obtained.
2. The entity linking method according to claim 1, characterized in that: The obtaining of the co-occurrence probability of the entity mention and the description information of each candidate entity, and the obtaining of the co-occurrence probability of each candidate entity and the text to be analyzed, includes: Obtaining the frequency of bigrams obtained by combining each word in the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity based on the frequency of bigrams obtained by combining each word in the entity mention and the description information of each candidate entity; The frequency of the bigrams obtained by combining each candidate entity with each word in the text to be analyzed is obtained, and based on the frequency of the bigrams obtained by combining each candidate entity with each word in the text to be analyzed, the co-occurrence probability of each candidate entity and the text to be analyzed is obtained.
3. The entity linking method according to claim 2, characterized in that: The frequency of the bigrams is obtained based on text statistics in a preset basic corpus.
4. The entity linking method according to claim 1, characterized in that: The step of obtaining a candidate entity set mentioned by the entity from the knowledge graph includes: Get the aliases mentioned by the entity; Based on the entity mention and the alias, a candidate entity set of the entity mention is matched from the knowledge graph.
5. The entity linking method according to any one of claims 1 to 4, characterized in that: The obtaining a target entity from the candidate entity set based on the first degree of association and the second degree of association includes: Obtaining a weighted average value of the first degree of association and the second degree of association, and using the weighted average value as a comprehensive association measurement value; The target entity is obtained based on the comprehensive association metric and a first degree of association between the entity mention and the description information of each candidate entity.
6. The entity linking method according to claim 5, characterized in that: The obtaining the target entity based on the comprehensive association metric value and the first association degree between the entity mention and the description information of each candidate entity comprises: Obtaining a first degree of association greater than the comprehensive association metric value; The candidate entity corresponding to the maximum first degree of association among the first degrees of association that are greater than the comprehensive association metric value is taken as the target entity.
7. A physical linking device, characterized in that: include: The extraction module is used to extract entity mentions from the text to be analyzed; A candidate entity acquisition module, used to acquire a candidate entity set mentioned by the entity from the knowledge graph, wherein the candidate entity set includes at least one candidate entity, and the candidate entity includes description information; A relevance calculation module, used to obtain a first relevance between the entity mention and the description information of each candidate entity, and to obtain a second relevance between each candidate entity and the text to be analyzed; an entity linking module, configured to obtain a target entity from the candidate entity set based on the first degree of association and the second degree of association, and associate the entity mention with the target entity; The obtaining of a first correlation between the entity mention and the description information of each candidate entity, and obtaining a second correlation between each candidate entity and the text to be analyzed, includes: Obtaining the co-occurrence probability of the entity mention and the description information of each candidate entity, and obtaining the co-occurrence probability of each candidate entity and the text to be analyzed; According to the co-occurrence probability of the entity mention and the description information of each candidate entity, a first correlation degree between the entity mention and the description information of each candidate entity is obtained, and according to the co-occurrence probability of each candidate entity and the text to be analyzed, a second correlation degree between each candidate entity and the text to be analyzed is obtained.
8. 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 entity linking method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the entity linking method according to any one of claims 1 to 6 are implemented.
