Entity linking method, entity linking model training method and electronic device

By obtaining weak supervision and real data samples in specific fields, and using meta-learning rules to adjust weights, the problem of difficulty in training entity link models in specific fields is solved, and the accuracy of the model is improved.

CN114298042BActive Publication Date: 2024-10-15TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111444208.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-10-15
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

Existing entity link models are difficult to train stably in specific domain knowledge bases, and lack training data and auxiliary information, resulting in insufficient model accuracy.

Method used

By obtaining weakly supervised data samples and real data samples in the target domain, meta-learning rules are used to adjust the weights of weakly supervised data samples to generate target training weights for training the entity link model.

Benefits of technology

It achieves more accurate entity linking under small sample data and improves the link accuracy of the model in specific fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298042B_ABST
    Figure CN114298042B_ABST
Patent Text Reader

Abstract

The present invention provides an entity linking method, an entity linking model training method and an electronic device. The method comprises the following steps: obtaining an entity to be linked in a text; inputting the entity to be linked into an entity linking model, and obtaining a matching score between the entity to be linked output by the entity linking model and each entity in a knowledge base; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through a meta-learning rule, the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions, and the first preset number is greater than the second preset number; the entity to be linked is linked to an entity with the highest matching score in the knowledge base, the accuracy of the entity linking model is improved through a small number of real data samples, and the entity linking is achieved more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model training technology, and in particular to an entity linking method, an entity linking model training method and an electronic device. Background Art

[0002] Entity linking is an important task in the field of natural language processing. It aims to correctly link the mention of an entity in unstructured text to the corresponding entity in the knowledge base. Entity linking introduces rich knowledge base information to unstructured text, which can help many other natural language processing tasks, such as relation extraction and question answering. The current entity linking model can achieve a high linking accuracy for some typical knowledge bases, but there are relatively few studies on entity linking for knowledge bases in specific fields.

[0003] The linking of domain-specific knowledge bases mainly faces the following challenges: First, there is a lack of a large amount of training data, which makes it difficult to stably train a neural network model. Second, there is a lack of auxiliary information in the knowledge base. Previous studies often used auxiliary information such as alias tables, structured relationships between entities, and link prior probabilities, which are difficult to obtain in domain-specific knowledge bases.

[0004] Therefore, how to obtain an entity linking model through small sample training has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The present invention provides an entity linking method, an entity linking model training method and an electronic device, which are used to solve the defect of difficulty in obtaining entity linking model training samples in the prior art, and to obtain an entity linking model through training with small sample data, thereby realizing entity linking more accurately.

[0006] The present invention provides an entity linking method, comprising:

[0007] Get the entity to be linked in the text;

[0008] The entity to be linked is input into an entity linking model, and a matching score between the entity to be linked and each entity in the knowledge base output by the entity linking model is obtained; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in the target domain, and the first preset number is greater than the second preset number;

[0009] The entity to be linked is linked to the entity with the highest matching score in the knowledge base.

[0010] According to an entity linking method provided by the present invention, the training process of the entity linking model includes:

[0011] Obtain a first preset number of weakly supervised data samples in the target domain;

[0012] Based on a second preset number of real data samples and meta-learning rules in the target domain, adjusting the weights of the weakly supervised data samples to target training weights;

[0013] The weakly supervised data samples corresponding to the target training weights are used as training samples to train the neural network model to obtain an entity linking model.

[0014] According to an entity linking method provided by the present invention, the step of obtaining a first preset number of weakly supervised data samples in a target domain includes:

[0015] Acquire a first preset number of initial training samples in a knowledge base corresponding to the target domain, wherein the initial training samples include entity names, entity mentions, and contexts of entity mentions;

[0016] Inputting a description document corresponding to the entity name into a pre-trained model for semantic generalization, and obtaining a new entity mention corresponding to the entity name output by the pre-trained model, wherein the pre-trained model is trained based on entity training samples in a general field;

[0017] The new entity mention is used to replace the entity mention in the initial training sample to obtain a first preset number of weakly supervised data samples.

[0018] According to an entity linking method provided by the present invention, after replacing the entity mentions in the initial training sample with the new entity mentions to obtain a first preset number of weakly supervised data samples, the method further includes:

[0019] Based on the task type, updating the pre-trained model;

[0020] Inputting the weakly supervised data sample into the updated pre-trained model to obtain entity mentions output by the updated pre-trained model;

[0021] A first preset number of weakly supervised data samples are obtained according to the entity mentions output by the updated pre-trained model, wherein the weakly supervised data samples include entity names, entity mentions output by the updated pre-trained model, and entity mention contexts.

[0022] According to an entity linking method provided by the present invention, the step of obtaining a first preset number of initial training samples from a knowledge base corresponding to a target domain includes:

[0023] Identify entity mentions for each description document in the knowledge base corresponding to the target domain;

[0024] The entity mention is linked to an entity with a consistent entity name in the knowledge base to obtain a first preset number of initial training samples, where the initial training samples are samples where the entity mention is consistent with the entity name.

[0025] According to an entity linking method provided by the present invention, adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and meta-learning rules in the target domain includes:

[0026] According to the weakly supervised data samples with initial weights, the neural network model is updated to obtain an updated neural network model;

[0027] Optimizing the parameters of the updated neural network model as initial model parameters according to the loss of the updated neural network model;

[0028] Based on the meta-learning rule, the initial weights are adjusted to the target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples.

[0029] According to an entity linking method provided by the present invention, the meta-learning rule-based method adjusts the initial weights to target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples, including:

[0030] Inputting a second preset number of real data samples into the neural network model corresponding to the initial model parameters, and calculating the loss of the neural network model corresponding to the initial model parameters;

[0031] Optimizing the initial weights of the weakly supervised data according to the loss of the neural network model corresponding to the initial model parameters;

[0032] Based on the meta-learning rule, the optimized initial weights are updated to the target training weights.

[0033] According to an entity linking method provided by the present invention, after obtaining the entity linking model, the method further includes:

[0034] Performing performance evaluation on the recall phase of the entity linking model through recall rate;

[0035] The performance of the re-ranking stage of the entity linking model is evaluated by normalized accuracy.

[0036] The present invention also provides an entity linking model training method, comprising:

[0037] Obtain a first preset number of weakly supervised data samples in the target domain;

[0038] adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and meta-learning rules of the target domain, the weakly supervised data sample and the real data sample both comprising entity name samples, entity mention samples, and context samples of entity mentions, the first preset number being greater than the second preset number;

[0039] The weakly supervised data samples after the target training weights are adjusted are used as training samples to train the neural network model to obtain an entity linking model.

[0040] 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 the processor implements the steps of any of the above methods when executing the program.

[0041] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the steps of any of the above-described methods.

[0042] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above methods are implemented.

[0043] The present invention provides an entity linking method, an entity linking model training method and an electronic device. The method obtains entities to be linked in text; inputs the entities to be linked into an entity linking model, and obtains matching scores between the entities to be linked output by the entity linking model and each entity in a knowledge base; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and predetermined entity labels, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and both the weakly supervised data samples and the real data samples include entity name samples, entity mention samples and context samples of entity mentions in a target field, and the first preset number is greater than the second preset number; the entity to be linked is linked to the entity with the highest matching score in the knowledge base, and since the weight of the weakly supervised data is adjusted based on the second preset number, i.e., a small number of manually annotated real data samples, the method combined with meta-learning can improve the accuracy of the entity linking model through a small number of real data samples, and more accurately achieve entity linking. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] 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.

[0045] Figure 1 It is a flowchart of an entity linking method provided by an embodiment of the present invention;

[0046] Figure 2 It is a flowchart of the entity linking model training method provided by an embodiment of the present invention;

[0047] Figure 3 yes Figure 2 Schematic diagram of the principle of the entity linking model training method in ;

[0048] Figure 4 is a schematic diagram of the link principle of the BLINK structure provided in this embodiment;

[0049] Figure 5 A schematic diagram of the results of a verification experiment on the effectiveness of meta-learning provided in this embodiment;

[0050] Figure 6 is a schematic diagram of the structure of a physical linking device provided by an embodiment of the present invention;

[0051] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] 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.

[0053] Combine the following Figure 1-Figure 7 An entity linking method, an entity linking model training method and an electronic device of the present invention are described.

[0054] First, the following terms are explained: Meta-learning methods are often used in small sample scenarios, which means that a small number of samples from other categories or other fields can be used to quickly adapt the model to new categories or fields, so that better results can be achieved in the target category or field. Although there are many different methods of meta-learning, they essentially hope to make the model converge to a better point in the parameter space based on the existing training data. This embodiment uses the meta-learning method to adjust the weights of the training data using a small number of real data samples in the target domain, so that the model can quickly adapt to the field when fine-tuning with a small number of real data samples in the target field.

[0055] A small sample (few-shot) is a type of sample, which is the opposite of a "large sample". It usually refers to a sample with a sample size less than or equal to 50. The exact distribution of the statistic must be used for statistical inference.

[0056] The goal of the entity linking task is to correctly match the entity names appearing in the text to the corresponding entities in the knowledge base. End-to-end entity linking includes two parts: named entity recognition (NER) and entity disambiguation. NER identifies the location of entity appearance in the text, but does not specify the corresponding entity. Entity disambiguation further matches the identified entity name to the corresponding knowledge base entity. Since these two stages are relatively independent, there are also a large number of studies that equate entity linking with entity disambiguation. The present invention also follows this setting, assuming that the location of entity appearance in the text is clear, and only focuses on the performance of the model linking to the correct entity. Here, the special terms involved are first defined as follows, and then the terms are uniformly expressed in the following descriptions: entity name (title), the name of the entity in the knowledge base, generally there will be no entities with the same name in the knowledge base. Entity description (description), in addition to the name, the entity in the knowledge base often has a text to describe the meaning of the entity. For example, each entity in Wikipedia has a complete page, which can be used as a description of the entity. Entity mention refers to the text form of an entity in a knowledge base in a sentence. Entity mention may be exactly the same as the entity name, or it may be an alias or abbreviation. The context of entity mention refers to the context text within a certain range of entity mention. These texts contain rich information and can be used as a basis for inferring the corresponding entity of entity mention.

[0057] The task of candidate entity generation is to recall a small set of entities that are most likely to be the correct answer from the knowledge base for a certain entity mention in the context. The number of entities in this set is often within one hundred, and in most cases the correct answer will be in this set. Candidate entity generation is the first stage of entity linking. It reduces the scope of selection from tens of thousands to tens of thousands, and is the basis for the next step of candidate entity ranking. The indicator for measuring the candidate entity generation stage is the recall rate (Recall, R), which refers to the probability that the correct answer is in the candidate entity set. When the number of recalls is the same, the higher the recall rate, the better. Choosing the number of recalled entities is also a trade-off process, because the more recalls, the greater the probability of the correct answer in the set, but it will also cause greater difficulties in the second stage of candidate entity ranking. Traditional models use statistical methods or auxiliary information in the first stage, but in recent years, some researchers have proposed using neural networks for recall.

[0058] The task of candidate ranking is to re-rank the candidate entities that have been screened in the first step according to the semantic relevance between the context of the entity mention and the entity's own description. It can be regarded as a more refined screening. Similarly, although it is impossible to determine which entity matches the entity mention literally, it is easy to determine the entity that should be linked to the real match based on the meaning of the context of the entity mention and the information described by each entity. Candidate ranking uses the entity with the highest relevance as the predicted answer, so the accuracy can be used to measure the effect of this module. Since the correct answer is not necessarily in the candidate entity set recalled in the first stage, the accuracy can be further divided into normalized accuracy (N.Acc.) and unnormalized accuracy (U.Acc.), where the normalized accuracy only considers the accuracy of the ranking when the candidate entity set contains the correct answer, while the unnormalized accuracy also takes into account the case where the candidate entity set does not contain the correct answer. Therefore, it can be considered that the normalized accuracy measures the performance of the second module, and the unnormalized accuracy measures the overall performance of the model.

[0059] Figure 1 It is a flowchart of the entity linking method provided by an embodiment of the present invention.

[0060] like Figure 1 As shown, an entity linking method provided by an embodiment of the present invention includes the following steps:

[0061] 101. Get the entity to be linked in the text.

[0062] The entities to be linked include entity names, entity mentions, and contexts of entity mentions.

[0063] 102. Input the entity to be linked into the entity linking model, and obtain the matching score between the entity to be linked output by the entity linking model and each entity in the knowledge base; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and predetermined entity labels, and the real data samples are used to adjust the weights of the weakly supervised data samples to the target training weights through meta-learning rules, and the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in the target field, and the first preset number is greater than the second preset number.

[0064] After obtaining the entity to be linked, it is input into the pre-trained entity linking model, and the entity linking model will output the matching scores between each entity in the knowledge base and the entity to be linked, because the entity linking model may find multiple matching entities in the knowledge base, and distinguish them by the specific matching degree, i.e., the matching score. The purpose of adjusting the weights of weakly supervised data samples as target training weights through real data samples is to ensure the accuracy of the entity linking model. When the weights of weakly supervised data samples are not adjusted as target training weights, an entity linking model can also be obtained, but the model is inaccurate, so the weights corresponding to the inaccurate model need to be adjusted to the target training weights corresponding to the more accurate entity linking model.

[0065] 103. Link the entity to be linked to the entity with the highest matching score in the knowledge base.

[0066] Finally, the entity to be linked is linked to the entity with the highest matching score in the knowledge base, thus completing the final entity linking task.

[0067] The present invention provides an entity linking method, which comprises the following steps: obtaining an entity to be linked in a text; inputting the entity to be linked into an entity linking model, and obtaining a matching score between the entity to be linked output by the entity linking model and each entity in a knowledge base; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, and the real data samples are used to adjust the weight of the weakly supervised data samples to a target training weight through a meta-learning rule, and both the weakly supervised data samples and the real data samples include entity name samples, entity mention samples and context samples of entity mentions in a target field, and the first preset number is greater than the second preset number; linking the entity to be linked to the entity with the highest matching score in the knowledge base, and since the weight of the weakly supervised data is adjusted based on the second preset number, i.e., a small number of manually annotated real data samples, in combination with the meta-learning method, the accuracy of the entity linking model can be improved through a small number of real data samples, and entity linking is achieved more accurately.

[0068] Figure 2It is a flowchart of the entity linking model training method provided by an embodiment of the present invention.

[0069] 201. Obtain a first preset number of weakly supervised data samples in the target domain.

[0070] Specifically, a special field where it is difficult to obtain a large number of training samples and auxiliary information is lacking is defined as the target field. If only a small number of training samples are used for model training, it is easy to cause overfitting of the neural network model due to the small number of training samples in the target field, and it is difficult to achieve good results. Therefore, a new method is used to generate weak supervision data in the target field. The first preset number refers to a large number of weak supervision data samples, which are mainly obtained through two steps. First, training samples are generated based on text matching, and then a large number of weak supervision data samples are generated in the target field based on the natural language generation model. Among them, the weak supervision data samples are data samples of the target field obtained by domain migration of the training samples of the general field by the pre-training model, and the target field is the field where the entity to be linked is located.

[0071] 202. Based on a second preset number of real data samples in the target domain and the meta-learning rule, adjust the weights of the weakly supervised data samples to target training weights.

[0072] After obtaining a large number of weakly supervised data samples, i.e., the first preset number, the weights of the weakly supervised data samples are adjusted to the target training weights through the second preset number of real data samples and meta-learning rules. That is, based on the small number of real data samples already in the target field, i.e., the second preset number, the weights of the generated weakly supervised data samples are adjusted in the training through meta-learning, so as to select supervised samples that are closer to the real samples in the target field for training, so as to ensure that the obtained neural network model is more accurate. Among them, weakly supervised data samples refer to samples that are not labeled or inaccurately labeled, and real data samples are accurate data samples that are manually labeled.

[0073] 203. The weakly supervised data samples corresponding to the target training weights are used as training samples to train the neural network model and obtain an entity linking model.

[0074] After obtaining the weakly supervised data samples after weight adjustment, the neural network model can be trained through the weakly supervised data samples to obtain the entity linking model. Since the target training weights of the weakly supervised data samples have been adjusted, it can be ensured that the entity linking model obtained after model training using the weakly supervised data samples after weight adjustment is more accurate.

[0075] Figure 3 yes Figure 2 Schematic diagram of the principle of the entity linking model training method in .

[0076] Further, such as Figure 3 As shown, the generation of supervised samples, i.e., weakly supervised data samples whose weights are adjusted to the target training weights, mainly includes two major links, one is the generation of a large number of weakly supervised data samples in the target domain, and the other is to adjust the weights of weakly supervised data samples based on meta-learning. In the process of obtaining weakly supervised data samples, specifically: obtaining a first preset number of initial training samples in the knowledge base corresponding to the target domain, the initial training samples include entity names, entity mentions, and contexts of entity mentions, which may include: identifying entity mentions of each description document in the knowledge base corresponding to the target domain; the known information in the target domain is only the description document corresponding to each entity in the entity library, so the first step is to use the named entity recognition (Named Entity Recognition, NER) tool to identify the entity mentions in the document, and then link the entity mentions to the knowledge base to obtain the first preset number of initial training samples that are consistent with the entity name. The difference here is that since there is no more auxiliary information in the target domain for further screening, in order to reduce noise, the embodiment only selects samples in which the entity mentions are completely consistent with the entity name, and in this way, each target domain can generate thousands of initial training samples.

[0077] After obtaining thousands of training samples in the general field, the entity mentions of the initial training samples are rewritten through the pre-training model to obtain updated training samples to correct the initial training samples in the general field. The updated training samples are closer to the real sample distribution. That is, the description document corresponding to the entity name is input into the pre-training model for semantic generalization to obtain the new entity mention corresponding to the entity name output by the pre-training model. The pre-training model is trained based on the entity training samples in the general field. Wherein, m represents entity mention, c represents the context of entity mention, e represents entity name and its text description, (m, c, e) represents training samples, m is the mention in context c, e is the entity corresponding to m, and m' is the updated entity mention.

[0078] The specific process of updating the training samples may be to determine the pre-trained model; for example, it may be the T5 pre-trained model, which converts both the Natural Language Understanding (NLU) task and the Natural Language Generation (NLG) task into text-to-text form, thereby achieving the use of a unified model architecture, training objectives, and training processes to cope with different downstream tasks, such as text translation, question answering, sentiment classification, document summarization, etc. The architecture of T5 is still based on the Transformer encoder-decoder structure. The key to its ability to train different tasks indiscriminately is to add a prefix of the specified task category to the original input text sequence: for example, T5 will add the prefix "translate languageA to languageB:" to the text of the translation task; and add "summarize:" to the text of the document summarization task. In this way, the model can adjust its internal strategies according to different prefixes and finally output the answer to the corresponding task. T5 was pre-trained on the C4 (The Colossal Clean Crawled Corpus) dataset, which is a huge natural language corpus with a size of 750GB after data cleaning. The large-scale corpus and huge number of parameters enable T5 to learn rich grammatical and semantic knowledge. There are two main reasons why T5 is selected in this embodiment: first, this task involves the migration of domains. The topics and writing styles of different domains may be very different. Since T5 has been pre-trained on a huge corpus, it can be considered that it contains rich semantic knowledge and can cope with changes in the domain well. In addition, T5 has superior performance and can reach advanced levels in a variety of NLG tasks. The "summarize" task it excels in is just suitable for this embodiment.

[0079] After the pre-training model is determined, the description document e corresponding to the entity name is input into the pre-training model for semantic generalization, and a new entity mention m' corresponding to the entity name output by the pre-training model is obtained; according to the semantically summarized entity mention m', a first preset number of weakly supervised data samples (m', c, e) are obtained. Since the pre-training model has rich grammatical and semantic knowledge, the mention m' generated by it will be more consistent with the distribution of natural text, and at the same time, it has a strong connection with the entity at the semantic level, so the quality of the training sample is higher.

[0080] In order to better ensure the application in the target field, after obtaining the weakly supervised data samples, the pre-trained model is updated based on the task type. First, T5 is fine-tuned on the training samples in the general field. The general field data can come from Wikipedia or other fields with rich samples, such as formula (1):

[0081] m=T5(summarize∶e) (1)

[0082] The prefix “summarize” is added so that T5 can clarify the task type and converge better. e represents the description text of an entity, and m represents the real entity mention in the general domain training samples.

[0083] After determining the task type, the pre-trained model is inferred to the target domain to obtain weakly supervised data samples, that is, the generative model fine-tuned in the general domain can be inferred in the target domain, that is, the weakly supervised data samples are input into the updated pre-trained model to obtain the entity mention output by the updated pre-trained model, as shown in formula (2):

[0084] m'=T5(summarize∶e) (2)

[0085] Among them, e is the description text of the entity in the target field, and the generated m' will be inserted into the context as a new entity mention, so as to obtain a first preset number of weakly supervised data samples according to the entity mention output by the updated pre-trained model, and the weakly supervised data samples include the entity name, the entity mention output by the updated pre-trained model, and the entity mention context.

[0086] Further, based on the above embodiment, this embodiment explains adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and meta-learning rules in the target domain, such as Figure 3 As shown, it can include: updating the neural network model according to the weakly supervised data samples with initial weights to obtain an updated neural network model; optimizing the parameters of the updated neural network model to the initial model parameters according to the loss of the updated neural network model; based on the meta-learning rules, adjusting the initial weights to the target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples.

[0087] In this embodiment, a small number of real data samples {(m i , c i , e i ), 1≤i≤M} is defined as the Meta Set, and a large amount of weakly supervised data {(m' j ,c' j,e' j ), 1≤j≤N}(M<<N) is defined as a weakly supervised data set (Syn Set). The goal of the meta-learning module is to find an optimal weight w for each weakly supervised data sample. * , so that the model trained with weighted samples can achieve the best in the target domain. However, since we cannot have all the information in the target domain and only have a small number of real samples, we can determine the weight given to the weakly supervised data samples by observing the loss of the model updated with weakly supervised data on real data samples, so as to find an approximate solution. Figure 3 As shown in the right half, there are two nested updates in the whole process: forward update and backward derivative update, and the objects of these two updates are different. Assuming the initial weights of weakly supervised data samples, the first update is to update the neural network model with weakly supervised data samples, and the second update is to update the initial weights based on the loss of the model after the first update on the real data samples.

[0088] Wherein, updating the neural network model according to the weakly supervised data sample with the initial weight to obtain an updated neural network model, and then optimizing the parameters of the updated neural network model as the initial model parameters according to the loss of the updated neural network model may include: copying the initial parameters θ of the neural network model, and the copied parameters are defined as The initial parameter θ is determined by the neural network model based on the weakly supervised data sample with the initial weight; for the jth weakly supervised data sample (m' j ,c' j ,e' j ), define its loss l' j (θ), the formula shown in the figure represents the total loss of j weakly supervised data samples, then The optimization goal is formula (3):

[0089]

[0090] This method uses a small batch gradient update method to achieve an approximate effect. For example, after the update in step t, the model parameters are θ t , then for the small batch of n samples taken from the weakly supervised data sample, give them an initial weight Then the updated parameters are as follows:

[0091]

[0092] Among them, α is the learning rate. It should be noted that for the convenience of explanation, the most basic Mini-Batch Gradient Descent (MBGD) method can be used to describe it. In the actual training process, different optimizers can be used. Finally, the parameters of the updated neural network model are optimized as the initial model parameters according to the loss of the updated neural network model.

[0093] Specifically, based on the meta-learning rules, according to the loss of the neural network model corresponding to the initial model parameters on the second preset number of real data samples, adjusting the initial weight to the target training weight can include: inputting the second preset number of real data samples into the neural network model corresponding to the initial model parameters, calculating the loss of the neural network model corresponding to the initial model parameters, optimizing the initial weight of the weakly supervised data according to the loss of the neural network model corresponding to the initial model parameters, and updating the optimized initial weight to the target training weight based on the meta-learning rules. That is, the pseudo-updated parameters are obtained. After that, the initial weights of the weakly supervised data samples can be optimized by the loss on a small number of second preset real data samples in the target domain as shown in formula (5):

[0094]

[0095] Among them, l i (θ) is the i-th true sample (m i , c i , e i ) on the model loss.

[0096] Similarly, under the optimization of MBGD, the updated optimized initial weights are the target training weights, which can be, assuming that m small batch samples are taken from a small amount of real data, the target training weights The update method is as follows:

[0097]

[0098] Among them, η is the learning rate of weight update.

[0099] Specifically, the initial weights of the samples in the mini-batch can be reset to zero to obtain new intermediate weights, as shown in formula (7):

[0100]

[0101] Since the derivative can be positive or negative, and the sample weight is negative, it has no practical significance. Therefore, the intermediate weights of the weakly supervised data samples with negative intermediate weights are reset to zero, as shown in formula (8):

[0102]

[0103] At the same time, in order to maintain the stability of the training process, the intermediate weights of all weakly supervised data samples are normalized to obtain the target training weights of the weakly supervised data samples, as shown in formula (9):

[0104]

[0105] in, Only in When it is 0, it is 1 to prevent the weights of all training samples in a small batch from being 0.

[0106] Train on the weighted weakly supervised data and obtain the new weight w of the sample through meta-learning * After that, the model can be updated according to the normal training process, and the optimization objective is as follows:

[0107]

[0108] In general, a complete update process is that the model first takes a small batch of data from the weakly supervised data samples, weights them according to their impact on a small number of real samples, and finally updates the model with the weighted small batch data. Although these small amounts of real data samples do not directly participate in the training, they supervise the training process as regularization terms.

[0109] It should be noted that the entity linking model is generally divided into two parts: the candidate entity generation model and the candidate entity ranking model. This embodiment uses the above-mentioned meta-learning method to optimize both parts of the model. During the effect verification process, due to the limitation of video memory, the batch size of the candidate entity ranking model can only be 1, that is, there is only one sample in a batch. At this time, the weight calculation formula degenerates into formula (11):

[0110]

[0111] Among them, sign is the sign function.

[0112] The core idea of ​​the entity linking model MetaLinker is to generate weakly supervised data samples in the target domain, and then use the meta-learning method to assign the optimal weights to these data, without relying on the specific model structure. Therefore, MetaLinker can be used for almost any existing entity linking model. Specifically, in the scenario of entity linking in a specific domain, for example, the BLINK model is selected as the basic linking model, and its parameters correspond to θ in the meta-learning module in the above embodiment. The following is a brief introduction to the linking method of BLINK.

[0113] Figure 4is a schematic diagram of the link principle of the BLINK structure provided in this embodiment. BLINK is a link structure with sample-free link capability proposed recently. Figure 4 The linking process of BLINK is summarized as follows: In the first stage, BI-ENCODER is used to refer to entity mentions T B The entities in the context and knowledge base are encoded as dense vectors (dense space), and the candidate entity set is determined by vector distance; the second stage uses CROSS-ENCODER, the input is the concatenation of the entity mention context and the entity description, and the output is the entity T with matching scores of 0.8 and 0.2 C , by comparing the scores, we directly determine that the entity corresponding to 0.8 is the final answer.

[0114] BI-ENCODER contains two independent Transformer structures. For a training sample (m, c, e), it first converts the entity mention information and entity description information into the following character representations, respectively, as shown in equations (12) and (13):

[0115] τ m =[CLS]ctxt l [M s ]mention[M e ]ctxt r [SEP] (12)

[0116] τ e =[CLS]title[ENT]description[SEP] (13)

[0117] Among them, [CLS], [SEP], M s 、M e For special characters, ctxt l 、ctxt r Represents contextual and precedent characters.

[0118] Then the entity mention and entity representation are encoded into dense vectors by Transformer and the dot product similarity is calculated, as shown in Equations (14), (15) and (16):

[0119] y m = red(Transformer(τ m )) (14)

[0120] y e = red(Transformer(τ e )) (15)

[0121] sim(m,c,e)=y m *y e(16)

[0122] Among them, red means taking out the hidden layer code of [CLS] as the semantic representation of the text.

[0123] The goal of the loss function is set to maximize the score of correct samples and minimize the score of incorrect samples, as shown in formula (17):

[0124]

[0125] Among them, (m i ,c i ,e j ) represents an error sample, that is, the entity mention does not match the entity. The strategy of negative sampling is to remove e from a batch. i All entities outside of i It should be noted that during reasoning, the dense vectors of all entities in the knowledge base can be pre-computed and stored for fast similarity calculation.

[0126] CROSS-ENCODER is still a pre-trained Transformer architecture, but here the representations of entity mentions and entity descriptions are concatenated as input, and a linear layer is added on top to directly give the matching score, as shown in Equations (18), (19), and (20):

[0127] τ m,e =[CLS]ctxt l [M s ]mention[M e ]ctxt r [SEP]title[ENT]description[SEP] (18)

[0129] y m,e = red(Transformer(τ m,e )) (19)

[0130] score(m,c,e)=y m,e W (20)

[0131] Since BI-ENCODER has given a set of candidate entities corresponding to a mention, the optimization goal of CROSS-ENCODER is to maximize the matching score between the mention and the correct entity and minimize the matching score with other candidate entities.

[0132] In summary, BLINK uses a very simple similarity calculation method, but relies on the powerful semantic encoding ability of the pre-trained model to achieve a good linking effect.

[0133] Furthermore, the current mainstream entity linking model is generally divided into two stages: the recall stage and the re-ranking stage. In this embodiment, after using the supervised samples to train the model and obtain the entity linking model, it can also include: evaluating the performance of the recall stage of the entity linking model through the recall rate (Recall@k); evaluating the performance of the re-ranking stage of the entity linking model through the normalized accuracy (NormalizedAccuracy), thereby ensuring the accuracy of the model.

[0134] The effect of the entity linking model obtained by the model training method of the present invention is specifically described below by way of examples.

[0135] The dataset used is a sample-free entity link dataset, which is briefly described here. The dataset comes from Wikia, which is a website similar to Wikipedia and is edited and maintained by the community. The difference is that Wikia is classified by multiple topics, such as an animation or a game. The entities under each topic are related to the topic, and there is no intersection between entities in different fields, thus naturally forming a knowledge base in a specific field. In addition, Wikia pages also contain rich hyperlinks, so training samples can be automatically constructed using hyperlinks. The dataset contains a total of 16 domain-specific entity libraries, 8 of which are used for training models, 4 fields as validation sets, and the remaining 4 fields as test sets. Detailed information is shown in Table 1.

[0136]

[0137] Table 1. Unsampled entity linking dataset

[0138] 1. High Overlap: The entity mention and the entity name are exactly the same. This type of samples only accounts for 5% of the total number.

[0139] 2. Multiple Categories: The entity name has an additional phrase for subdivision based on the entity mention, such as the entity mention is Batman, and the corresponding entity name is Batman(Lego). This category accounts for 28%.

[0140] 3. Ambiguous Substring: Entity mention is a substring of the corresponding entity name. This proportion accounts for 8%.

[0141] 4. Low Overlap: Samples that do not meet the above three categories, accounting for 59%.

[0142] It can be seen that there is no clear pattern between the entity mentions and entity names in a considerable proportion of samples in the dataset, which increases the difficulty of entity linking. This embodiment selects 4 datasets used for testing in the original dataset as the evaluation benchmark, and makes adjustments based on the scenario of small sample entity linking: 50 samples are used as small samples of the target field, another 50 as validation sets, and the remaining samples as test sets. The small sample entity linking dataset is formed as shown in Table 2.

[0143]

[0144] Table 2. Small sample entity linking dataset

[0145] The current mainstream entity linking model is generally divided into two stages: the recall stage and the re-ranking stage. The corresponding indicators of these two stages are the recall rate (Recall@k) and the normalized accuracy (NormalizedAccuracy, abbreviated as N.Acc.), and the product of the two is the unnormalized accuracy (Unnormalized Accuracy, abbreviated as U.Acc.).

[0146] Taking the BLINK model framework as the main comparison object, when solving the problem of no samples in the field, the heuristic method is used to generate noise data first, and then a noise detection module is proposed to reduce noise during training. This embodiment refers to its noise reduction method as DL4EL. The core idea of ​​DL4EL is to assume that the proportion of noise data in the data ( is a hyperparameter), and the KL divergence term of the assumed noise ratio and the model predicted noise ratio is added to the training loss term as shown in formula (21):

[0147]

[0148] Among them, p N (1|m, c, e) represents the probability that the training sample is a noise sample, which is determined by a forward neural network. The second loss constrains the model to predict the proportion of noise samples not to be too high or too low. At the same time, the first loss represents the loss of the real sample after the noise data is "filtered".

[0149] The meta-learning method proposed in the present invention can also be regarded as a kind of denoising for weakly supervised data, so the meta-learning method is compared with DL4EL. It should be noted that the LSTM-encoded features are used as the input of the noise detection module in the original DL4EL, and this embodiment replaces them with Transformer-encoded features, and the other hyperparameters are basically the same as the original.

[0150] In this embodiment, the small sample entity linking model based on meta-learning is called MetaLinker. In order to make a fair comparison with the baseline, the hyperparameters of MetaLinker except the meta-learning module are the same as those of the original model. Taking Metalinker based on BLINK as an example, the detailed hyperparameters are shown in Tables 3 and 4. It should be noted that MetaLinker in this embodiment will be fine-tuned on the metadata dataset after using the metadata dataset to weight the training data.

[0151]

[0152] Table 3. Metalinker recall model hyperparameters

[0153]

[0154] Table 4. Metalinker reranking model hyperparameters

[0155] In order to verify the effectiveness of the MetaLinker framework, we first tested the effect of MetaLinker in a scenario with only a small amount of training data in a specific field. During the experiment, this embodiment used the proposed meta-learning method to optimize both BI-ENCODER and CROSS-ENCODER, and reported the recall rate of the first stage and the normalized accuracy of the second stage. The results are shown in Tables 5 and 6:

[0156]

[0157] Table 5. Detailed results on Lego and Yugioh domains

[0158]

[0159] Table 6. Overall effects on Forgotten Realms and Star Trek realms

[0160] Among them, Meta represents a small number of real samples in the target field, and Syn represents samples generated using the weakly supervised data module of this embodiment. The baseline methods for comparison are as follows:

[0161] Name Matching, the most basic text matching method: if an entity mention is contained in an entity name, the entity mention is considered to be linked to the entity. If there are multiple entities that meet the requirements, the first one that matches is selected according to the order of entities in the knowledge base.

[0162] BLINK+Meta, fine-tunes BLINK directly on a small number of samples. BLINK+Meta is similar to BLINK+Syn+Meta.

[0163] DL4EL is a denoising method based on probability constraints. CROSS-ENCODER cannot use DL4EL for in-batch denoising because the batch size is 1. Its normalized accuracy is equivalent to the best result among the above baseline models.

[0164] The following observations can be made based on the performance of different methods in the test field:

[0165] 1. Since the correlation between entity mentions and entity names in the text is deliberately weakened when the dataset is constructed, the Name Matching method performs extremely poorly on this dataset, which requires that the entity linking system must be able to model the semantic correlation between entity mentions and entities.

[0166] 2. Comparing the fine-tuning results of BLINK on a small number of real samples Meta and a large number of weakly supervised data samples Syn, it can be found that the small number of Meta samples makes it difficult for BI-ENCODER to learn the ability to screen candidate entities from tens of thousands of entities, and the recall rate is lower than the result of training with a large number of weakly supervised data samples; however, the sorting model CROSS-ENCODER is more sensitive to data quality, and the normalized accuracy obtained by using a small number of high-quality samples for training can greatly exceed the effect of weakly supervised data. This shows that the quality of weakly supervised data generated by this embodiment is uneven, and samples with lower quality have a greater impact on sorting accuracy.

[0167] 3. The results of the BLINK+Syn+Meta column reflect the significance of weakly supervised data. Syn and Meta data sources each have advantages in quantity and quality. Fine-tuning BLINK on a large amount of weakly supervised data and then further fine-tuning it on high-quality Meta can combine the advantages of both, allowing the model to converge stably while making full use of the information of a small number of samples, which can achieve huge improvements compared to training only on a small number of samples.

[0168] 4. The DL4EL method did not bring any improvement, and even caused some results to decline. This example believes that this is because, on the one hand, the weakly supervised data is constructed by the Exact Match method, and there is no obvious "noise". In addition, the essence of DL4EL is to learn noise reduction by itself, and lacks the supervision of real sample signals, so it may lead to the wrong optimization direction.

[0169] 5. Compared with fine-tuning directly on weakly supervised data of varying quality, MetaLinker uses meta-learning to maximize the value of weakly supervised signals. Under the supervision of a small number of high-quality samples, the model will increase the weight of samples that are more helpful for training and reduce the weight of unhelpful samples, thereby training a better model. Compared with direct fine-tuning, MetaLinker can basically achieve further improvements in both stages.

[0170] In summary, MetaLinker introduces more information in the target field by generating weakly supervised data, effectively avoiding the overfitting of the neural network model under the original small sample condition. In addition, MetaLinker's meta-learning mechanism can further screen valuable weakly supervised signals, which can achieve further improvement compared to existing denoising methods.

[0171] From the experimental results, we can see that although MetaLinker has significantly improved compared to the model fine-tuned on a small number of samples, the overall accuracy is still very low. Therefore, this section considers following the sample-free entity linking setting and introducing a large number of training samples in the general domain as auxiliary information, but there are no existing annotated samples in the target domain. The experimental results show that MetaLinker can enable the model to better perform domain transfer with the assistance of general domain information. The specific experimental process is as follows:

[0172] Experimental setup

[0173] 1. This experiment regards the set of the first 8 training domains in the sample-free entity linking dataset as the general domain, and takes the results of BLINK trained on the general domain as the baseline.

[0174] 2. The experiment found that the recall rate of BI-ENCODER after training in general fields is already very high and cannot reflect obvious effects. Therefore, this section only reports the normalized accuracy of CROSS-ENCODER corresponding to the second stage.

[0175] 3. Since MetaLinker requires a small number of high-quality samples as a metadata set (Meta Set), and there are no labeled samples in the target domain, this embodiment adopts the following two methods as a metadata set: (1) Filter weakly supervised data to obtain a small amount of high-quality data. The rule constraints adopted are: entity mentions and entity names do not have the same words, entity mentions are correct words, and entity mentions do not contain numbers. Through the above constraints, dozens of high-quality data can be obtained as a metadata set. (2) Self Match. According to the above description, a large proportion of samples in the dataset are of the Multiple Categories type, so this embodiment adopts a heuristic method: if the entity name conforms to the Multiple Categories type (that is, it contains words for segmentation) and the entity name appears in its text description, then this mention-entity pair is used as a training sample. The process ensures that the context of the mention and the description text of the entity do not overlap. This embodiment selects different methods to generate the target domain metadata set based on the performance on the validation set, which is called Syn_Meta.

[0176] Preliminary experiment

[0177] As mentioned above, the entities in each domain in the dataset are about a specific topic, and there is no intersection between entities in different domains. Due to the above two reasons, each domain can be imagined as a cluster of mentions and corresponding entity sample pairs in the semantic space. The experimental goal of this section can be expressed as how to better migrate to other specific clusters after the model has fully learned using data in the general domain (8 clusters). If the target cluster is very close to the general domain in the semantic space, then the model already has the ability to process the target cluster samples. If the target cluster is far away from the general domain, then the effect of the model in the target domain will be greatly reduced. In order to better analyze the experimental results of domain transfer, the pre-experiment in this section starts from the model capability and characterizes the gap (gap) in the semantic space between the clusters of the four test domains and the general domain.

[0178] Specifically, the samples in the target domain are first further divided into 500 training samples and the remaining test samples. Then the model trained on the general domain is trained on these 500 samples. At this point, it can be considered that the model has fully adapted to the target domain, that is, it has filled the gap between the general domain and this domain. Equivalently, the improvement in the accuracy of the model on the test samples can be used as a measure of the size of the gap. The greater the improvement, the greater the semantic distance between the target domain and the general domain.

[0179] As shown in Table 7, after fine-tuning on 500 samples in the target domain, both the Lego domain and the Yugioh domain have achieved an improvement of nearly 10%, indicating that some features of these domains cannot be learned by the model in the general domain, while the model effect in the Forgotten realms domain and the Star Trek domain has been improved less, only less than 5%, and Logeswaran mentioned in the paper that the test results of CROSS-ENCODER in the same domain on seen and unseen entities have a 5% difference, which shows that the general domain already contains the knowledge of the Forgotten realms domain and the Star Trek domain, which also determines that the model has little room for improvement in migration in these two domains. Based on the above observations, this experiment screened out the Forgotten realms and Star Trek domains when reporting the domain migration effect, and only reported the results of the Lego and Yugioh domains.

[0180]

[0181] Table 7. GAP between the four test areas and the general area

[0182] Experimental results analysis

[0183] The target domain metadata set is Syn_Meta obtained by heuristic methods. When there are training samples in the general domain, the source of training data can be either weakly supervised data (Syn) or general domain data (General). We first use weakly supervised data as the data source to prove the good performance of MetaLinker in domain migration. Then, we also consider general domain data and get further improvement.

[0184] The experimental results when the weak supervision signal is used as the data source and the data source is weak supervision data are shown in Table 8. Among them, BLINK+Syn_Meta represents the result of BLINK after fine-tuning on the target domain metadata dataset, and MetaLinker(Syn) represents the result of training on weak supervision data with Syn_Meta as the metadata dataset. According to the data in the table, the following findings can be made: (1) The model can be improved by more than one percentage point after fine-tuning on Syn_Meta, which proves the effectiveness of heuristically generating metadata datasets. (2) MetaLinker has achieved further improvement compared to both the baseline and the fine-tuned model, indicating that the model has obtained more useful information from the weak supervision data. In summary, MetaLinker, which uses both weak supervision data information and metadata information, can effectively perform domain transfer and can achieve a 2.6% improvement in normalized accuracy compared to the baseline.

[0185]

[0186] Table 8. Domain transfer effect using weakly supervised data training

[0187] When the general domain is used as the data source, although the entities in the general domain have no intersection with the entities in the target domain, the quality of the samples is relatively high. Therefore, this section also tries to use the training samples in the general domain as the training data source, as shown in Table 9. The experimental results of using weakly supervised data and general domain data at the same time are shown in Table 10. The last column tries two data sources separately and takes the best result.

[0188]

[0189] Table 9. Transfer effects on Lego and Yugioh domains

[0190]

[0191] Table 10. Domain transfer effect considering both weak supervision and general domain data

[0192] Comparing the data in Table 9 and Table 10, we can make the following observations:

[0193] 1. With the help of samples from the general domain, the effect of the Lego domain has been further improved, but the Yugioh domain still has the best effect with weakly supervised data as the data source. This embodiment believes that this is because the Yugioh domain is relatively far away from the general domain in the semantic space and cannot provide more effective training information.

[0194] 2. By considering both weakly supervised data and general domain data, MetaLinker can achieve an improvement of about 3% compared to the baseline model, demonstrating the effectiveness of meta-learning methods in domain transfer.

[0195] Verify the effectiveness of generated weakly supervised data. Continue to design experiments to prove the effectiveness of MetaLinker's two modules: the weakly supervised data generation module and the meta-learning module. First, compare the training effect of the model on the data generated by the heuristic Exact Match method and the weakly supervised data (Syn) rewritten using the pre-trained model.

[0196] As shown in Table 11, BLINK is fine-tuned using the same number of Exact Match data and Syn data. The test results in the Lego and Yugioh fields show that the recall rate of the model trained with Syn data in the first stage and the normalized accuracy rate in the second stage are significantly higher than those of Exact Match data. This embodiment believes that this is due to the bias that the text form of entity mentions and entity names in Exact Match data is completely consistent, which causes the model to tend to directly consider the text similarity between mentions and entity names, while ignoring the deep semantic connection. In addition, it can be observed that the improvement brought by Syn is not as high as expected. This embodiment believes that this is because there are some poor quality samples in Syn that affect the optimization direction of the model. Improving the way to generate weak supervision data should bring greater improvement.

[0197]

[0198] Table 11, the effectiveness of weakly supervised data on the Yugioh domain verifies the effectiveness of the meta-learning method. The above has explained the superiority of the meta-learning method used in this embodiment compared to the previous denoising method (DL4EL). This section conducts a verification experiment to more intuitively show the effectiveness of the meta-learning method in the training process.

[0199] Figure 5 A schematic diagram of the results of the meta-learning effectiveness verification experiment provided in this embodiment, Figure 5The middle left figure shows the difference in the selection ratio of Normal data and Bad data for the meta-learning mechanism under the supervision of a small number of real samples, where Normal data refers to the weakly supervised data generated normally, and Bad data refers to the wrong data after the entity mentions and entity correspondences are disrupted. The right figure shows that the loss of the model on the meta-data set decreases as the number of samples in the meta-data set increases according to the preset step size.

[0200] From the above two figures, it can be seen that, as assumed in this embodiment, the model can distinguish the quality of data by relying on the supervision of the metadata data set, and give a greater weight to high-quality data. At the same time, the loss of the model on the metadata data set will continue to decrease, indicating that the model has learned the knowledge of the target field through weighted weak supervision data.

[0201] The experiments in this embodiment show that when there are only a few real data samples in a specific field, the method of this embodiment has a huge improvement over the baseline method. At the same time, in the scenario of domain migration with additional general domain training data, this method can also be used as a way to improve domain migration capabilities and achieve better linking effects on sample-free datasets.

[0202] Based on the same general inventive concept, the present application also protects a physical link device. The physical link device provided by the present invention is described below. The physical link device described below and the physical link device described above can be referenced to each other.

[0203] Figure 6 It is a schematic diagram of the structure of a physical linking device provided in an embodiment of the present invention.

[0204] like Figure 6 As shown, an embodiment of the present invention provides a physical linking device, comprising:

[0205] An acquisition module 61 is used to acquire the entity to be linked in the text;

[0206] A big data module 62 is used to input the entity to be linked into an entity linking model, and obtain the matching score between the entity to be linked and each entity in the knowledge base output by the entity linking model; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in the target domain, and the first preset number is greater than the second preset number;

[0207] The matching module 63 is used to link the to-be-linked entity to the entity with the highest matching score in the knowledge base.

[0208] The present embodiment provides an entity linking device, which obtains entities to be linked in text; inputs the entities to be linked into an entity linking model, and obtains matching scores between the entities to be linked output by the entity linking model and each entity in a knowledge base; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and predetermined entity labels, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and both the weakly supervised data samples and the real data samples include entity name samples, entity mention samples and context samples of entity mentions in the target field, and the first preset number is greater than the second preset number; the entity to be linked is linked to the entity with the highest matching score in the knowledge base, and since the weight of the weakly supervised data is adjusted based on the second preset number, i.e., a small number of manually annotated real data samples, in combination with the meta-learning method, the accuracy of the entity linking model can be improved through a small number of real data samples, and entity linking is achieved more accurately.

[0209] Furthermore, the big data module 62 in this embodiment includes:

[0210] A weak supervision data generation unit, used to obtain a first preset number of weak supervision data samples in the target domain;

[0211] A meta-learning-based training unit is used to adjust the weights of the weakly supervised data samples to target training weights based on a second preset number of real data samples in the target field and meta-learning rules; and to train a neural network model using the weakly supervised data samples corresponding to the target training weights as training samples to obtain an entity linking model.

[0212] Furthermore, the weak supervision data generating unit in this embodiment is specifically used for:

[0213] Acquire a first preset number of initial training samples in a knowledge base corresponding to the target domain, wherein the initial training samples include entity names, entity mentions, and contexts of entity mentions;

[0214] Inputting a description document corresponding to the entity name into a pre-trained model for semantic generalization, and obtaining a new entity mention corresponding to the entity name output by the pre-trained model, wherein the pre-trained model is trained based on entity training samples in a general field;

[0215] The new entity mention is used to replace the entity mention in the initial training sample to obtain a first preset number of weakly supervised data samples.

[0216] Furthermore, the weak supervision data generating unit in this embodiment is further used for:

[0217] Based on the task type, updating the pre-trained model;

[0218] Inputting the weakly supervised data sample into the updated pre-trained model to obtain entity mentions output by the updated pre-trained model;

[0219] A first preset number of weakly supervised data samples are obtained according to the entity mentions output by the updated pre-trained model, wherein the weakly supervised data samples include entity names, entity mentions output by the updated pre-trained model, and entity mention contexts.

[0220] Furthermore, the weak supervision data generating unit in this embodiment is further used for:

[0221] Identify entity mentions for each description document in the knowledge base corresponding to the target domain;

[0222] The entity mention is linked to an entity with a consistent entity name in the knowledge base to obtain a first preset number of initial training samples, where the initial training samples are samples where the entity mention is consistent with the entity name.

[0223] Furthermore, the meta-learning-based training unit in this embodiment is specifically used for:

[0224] According to the weakly supervised data samples with initial weights, the neural network model is updated to obtain an updated neural network model;

[0225] Optimizing the parameters of the updated neural network model as initial model parameters according to the loss of the updated neural network model;

[0226] Based on the meta-learning rule, the initial weights are adjusted to the target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples.

[0227] Furthermore, the meta-learning-based training unit in this embodiment is also specifically used for:

[0228] Inputting a second preset number of real data samples into the neural network model corresponding to the initial model parameters, and calculating the loss of the neural network model corresponding to the initial model parameters;

[0229] Optimizing the initial weights of the weakly supervised data according to the loss of the neural network model corresponding to the initial model parameters;

[0230] Based on the meta-learning rule, the optimized initial weights are updated to the target training weights.

[0231] Furthermore, this embodiment also includes an evaluation module, which is used to:

[0232] Performing performance evaluation on the recall phase of the entity linking model through recall rate;

[0233] The performance of the re-ranking stage of the entity linking model is evaluated by normalized accuracy.

[0234] Based on the same general inventive concept, this embodiment also provides an entity linking model training method, comprising the following steps:

[0235] Obtain a first preset number of weakly supervised data samples in the target domain;

[0236] adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and meta-learning rules of the target domain, the weakly supervised data sample and the real data sample both comprising entity name samples, entity mention samples, and context samples of entity mentions, the first preset number being greater than the second preset number;

[0237] The weakly supervised data samples after the target training weights are adjusted are used as training samples to train the neural network model to obtain an entity linking model.

[0238] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0239] like Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the entity linking method, which includes: obtaining the entity to be linked in the text; inputting the entity to be linked into the entity linking model, and obtaining the matching score between the entity to be linked and each entity in the knowledge base output by the entity linking model; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, the real data sample is used to adjust the weight of the weakly supervised data sample to the target training weight through a meta-learning rule, the weakly supervised data sample and the real data sample both include entity name samples, entity mention samples and context samples of entity mentions in the target field, and the first preset number is greater than the second preset number; linking the entity to be linked to the entity with the highest matching score in the knowledge base.

[0240] In addition, the logic instructions in the above-mentioned memory 730 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 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, and the computer software product is stored in a storage medium, including a number of 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: 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.

[0241] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the entity linking method provided by the above methods, which includes: obtaining an entity to be linked in a text; inputting the entity to be linked into an entity linking model, and obtaining a matching score between the entity to be linked and each entity in a knowledge base output by the entity linking model; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and predetermined entity labels, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in a target field, and the first preset number is greater than the second preset number; linking the entity to be linked to the entity with the highest matching score in the knowledge base.

[0242] 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 entity linking method provided by the above-mentioned methods, the method comprising: obtaining an entity to be linked in a text; inputting the entity to be linked into an entity linking model, and obtaining a matching score between the entity to be linked and each entity in a knowledge base output by the entity linking model; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and predetermined entity labels, the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in a target field, and the first preset number is greater than the second preset number; linking the entity to be linked to the entity with the highest matching score in the knowledge base.

[0243] 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 scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0244] 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.

[0245] 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: Get the entity to be linked in the text; The entity to be linked is input into an entity linking model, and a matching score between the entity to be linked and each entity in the knowledge base output by the entity linking model is obtained; wherein the entity linking model is obtained after training based on a first preset number of weakly supervised data samples, a second preset number of real data samples and a predetermined entity label, and the real data samples are used to adjust the weights of the weakly supervised data samples to target training weights through meta-learning rules, and the weakly supervised data samples and the real data samples both include entity name samples, entity mention samples and context samples of entity mentions in the target domain, and the first preset number is greater than the second preset number; Linking the to-be-linked entity to the entity with the highest matching score in the knowledge base; The training process of the entity linking model includes: Obtain a first preset number of weakly supervised data samples in the target domain; Based on a second preset number of real data samples and meta-learning rules in the target domain, adjusting the weights of the weakly supervised data samples to target training weights; Using the weakly supervised data samples corresponding to the target training weights as training samples to train a neural network model, to obtain an entity linking model; The step of adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and a meta-learning rule in the target domain comprises: According to the weakly supervised data samples with initial weights, the neural network model is updated to obtain an updated neural network model; Optimizing the parameters of the updated neural network model as initial model parameters according to the loss of the updated neural network model; Based on the meta-learning rule, the initial weights are adjusted to the target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples.

2. The entity linking method according to claim 1, characterized in that: The step of obtaining a first preset number of weakly supervised data samples in the target domain includes: Acquire a first preset number of initial training samples in a knowledge base corresponding to the target domain, wherein the initial training samples include entity names, entity mentions, and contexts of entity mentions; Inputting a description document corresponding to the entity name into a pre-trained model for semantic generalization to obtain a new entity mention corresponding to the entity name output by the pre-trained model, wherein the pre-trained model is trained based on entity training samples in a general field; The new entity mention is used to replace the entity mention in the initial training sample to obtain a first preset number of weakly supervised data samples.

3. The entity linking method according to claim 2, characterized in that: After replacing the entity mentions in the initial training sample with the new entity mentions to obtain a first preset number of weakly supervised data samples, the method further includes: Based on the task type, updating the pre-trained model; Inputting the weakly supervised data sample into the updated pre-trained model to obtain entity mentions output by the updated pre-trained model; A first preset number of weakly supervised data samples are obtained according to the entity mentions output by the updated pre-trained model, wherein the weakly supervised data samples include entity names, entity mentions output by the updated pre-trained model, and entity mention contexts.

4. The entity linking method according to claim 2, characterized in that: The step of obtaining a first preset number of initial training samples from a knowledge base corresponding to the target domain includes: Identify entity mentions for each description document in the knowledge base corresponding to the target domain; The entity mention is linked to an entity with a consistent entity name in the knowledge base to obtain a first preset number of initial training samples, where the initial training samples are samples where the entity mention is consistent with the entity name.

5. The entity linking method according to claim 1, characterized in that: The method of adjusting the initial weights to target training weights based on the meta-learning rule according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples includes: Inputting a second preset number of real data samples into the neural network model corresponding to the initial model parameters, and calculating the loss of the neural network model corresponding to the initial model parameters; Optimizing the initial weights of the weakly supervised data according to the loss of the neural network model corresponding to the initial model parameters; Based on the meta-learning rule, the optimized initial weights are updated to the target training weights.

6. The entity linking method according to any one of claims 1 to 5, characterized in that: After obtaining the entity linking model, the method further includes: Performing performance evaluation on the recall phase of the entity linking model through recall rate; The performance of the re-ranking stage of the entity linking model is evaluated by normalized accuracy.

7. A method for training an entity linking model, for linking a to-be-linked entity in a text to an entity in a knowledge base, characterized in that: include: Obtain a first preset number of weakly supervised data samples in the target domain; adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and meta-learning rules of the target domain, the weakly supervised data sample and the real data sample both comprising entity name samples, entity mention samples, and context samples of entity mentions, the first preset number being greater than the second preset number; The weakly supervised data samples after the target training weights are adjusted are used as training samples to train a neural network model to obtain an entity linking model; The step of adjusting the target training weight of the weakly supervised data sample based on a second preset number of real data samples and a meta-learning rule in the target domain comprises: According to the weakly supervised data samples with initial weights, the neural network model is updated to obtain an updated neural network model; Optimizing the parameters of the updated neural network model as initial model parameters according to the loss of the updated neural network model; Based on the meta-learning rule, the initial weights are adjusted to the target training weights according to the loss of the neural network model corresponding to the initial model parameters on a second preset number of real data samples.

8. 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 the method according to any one of claims 1 to 7 are implemented.