An entity recognition field migration method, device, equipment and storage medium

CN116451694BActive Publication Date: 2026-09-18BEIJING UNISOUND INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310336440.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2026-09-18
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提出一种实体识别领域迁移方法、装置、设备和存储介质,旨在解决现有技术中缺乏对无标注数据的合理使用方法,无法将无标注数据运用到模型训练中

Benefits of technology

[0020] This invention provides a domain transfer method for entity recognition based on course learning. First, the source model in the original domain is optimized using a small number of labeled samples in the target domain. Then, the optimized first model is used to filter a large number of unlabeled samples to obtain a batch of high-quality unlabeled samples, generating pseudo-labeled samples. Finally, the domain transfer is completed using these pseudo-labeled samples through course learning. This solves the problem that the scale of labeled data in domain transfer tasks is generally small, maximizes the use of unlabeled data, and makes the transferred model less prone to overfitting and has strong generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116451694B_ABST
    Figure CN116451694B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for domain transfer in entity recognition. The method includes: training a source model using a labeled sample set from the target domain to obtain a first model; using the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set of the target domain, and filtering a pseudo-labeled sample set from the unlabeled sample set based on the entity recognition results; training the first model using the pseudo-labeled sample set to obtain a second model; using the first model and the second model to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and sorting the pseudo-labeled samples based on the entity recognition results; and training the second model for a target number of rounds according to a preset course learning method based on the sorted pseudo-labeled samples to obtain an entity recognition model. This invention solves the problem of generally limited labeled data in domain transfer tasks and maximizes the utilization of unlabeled data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for transferring data in the field of entity recognition. Background Technology

[0002] Domain migration refers to transferring a model that performs well in its original domain to another target domain, so that the model can also achieve better performance in the target domain.

[0003] However, in the field of entity recognition, the performance of entity recognition models is positively correlated with the scale of labeled data. When transferring models to entity recognition, a large amount of labeled data is required for training. However, the labeled data currently used for entity recognition training is small in scale and difficult to obtain. Although a large amount of unlabeled data exists, existing technologies lack reasonable methods for using unlabeled data, making it impossible to apply unlabeled data to model training. Under these circumstances, even if models from the original domain are transferred to entity recognition, the small scale of labeled data will lead to insufficient model training and poor recognition results. Summary of the Invention

[0004] The main objective of this invention is to propose a method, apparatus, device, and storage medium for transferring data in the field of entity recognition, aiming to solve the problem that the existing technology lacks a reasonable method for using unlabeled data and cannot apply unlabeled data to model training.

[0005] To address the aforementioned technical problems, the present invention is implemented through the following technical solution:

[0006] This invention provides a domain transfer method for entity recognition, comprising: acquiring a labeled sample set and an unlabeled sample set corresponding to a target domain; training a source model for domain transfer using the labeled sample set to obtain a first model; performing entity recognition on each unlabeled sample in the unlabeled sample set using the first model, and filtering a pseudo-labeled sample set in the unlabeled sample set based on the entity recognition results corresponding to each unlabeled sample; training the first model using the pseudo-labeled sample set to obtain a second model; performing entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model respectively, and sorting the pseudo-labeled samples based on the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model; and training the second model for a target number of rounds according to a preset course learning method based on the sorted pseudo-labeled samples to obtain an entity recognition model.

[0007] The method of training a source model for domain transfer using the labeled sample set includes: in each training round, inputting multiple labeled samples from the labeled sample set sequentially into the source model, causing the source model to perform the following steps for each labeled sample: preprocessing the received labeled sample to obtain the character vector corresponding to each character in the labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the source model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the source model and the transfer probability between the character and its preceding character; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; adjusting the source model based on the predicted label probability set corresponding to each character and the real label corresponding to each character in the labeled sample, until the training of the source model for the first preset number of rounds is completed, thus obtaining a first model.

[0008] The process involves using the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set, and filtering a pseudo-labeled sample set based on the entity recognition results for each unlabeled sample. This includes: for each unlabeled sample in the unlabeled sample set, the first model determines a predicted label probability set corresponding to each character in the unlabeled sample; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; for each character in the unlabeled sample, the maximum label probability in the predicted label probability set corresponding to the character is determined, and the character is labeled as the entity label corresponding to the maximum label probability; based on the maximum label probability corresponding to each character in the unlabeled sample, a predicted score corresponding to the unlabeled sample is determined; and for each unlabeled sample in the unlabeled sample set, the unlabeled sample with a predicted score greater than a preset score threshold is designated as a pseudo-labeled sample in the pseudo-labeled sample set.

[0009] The method of training the first model using the pseudo-labeled sample set to obtain the second model includes: in each training round, inputting multiple pseudo-labeled samples from the pseudo-labeled sample set sequentially into the first model, causing the first model to perform the following steps for each pseudo-labeled sample: preprocessing the received pseudo-labeled sample to obtain the character vector corresponding to each character in the pseudo-labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the first model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the first model and the transmission probability between the character and its preceding character; adjusting the first model based on the predicted label probability set corresponding to each character and the entity label corresponding to each character in the pseudo-labeled sample, until the training of the first model for a second preset number of rounds is completed, thereby obtaining the second model.

[0010] Specifically, the first model and the second model are used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model. This includes performing the following steps for each pseudo-labeled sample in the pseudo-labeled sample set: determining the predicted label probability set corresponding to each character in the pseudo-labeled sample using the first model; determining the maximum label probability in the predicted label probability set corresponding to each character; and determining the first level corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character. The predicted label probability set includes multiple label probabilities, each corresponding to an entity label. The predicted label probability set for each character in the pseudo-labeled sample is determined using the second model. The maximum label probability in the predicted label probability set for each character is determined, and based on the maximum label probability for each character, the second average label probability corresponding to the pseudo-labeled sample is determined. For each pseudo-labeled sample in the pseudo-labeled sample set, the absolute value of the difference between the first average label probability and the second average label probability of the same pseudo-labeled sample is determined. Based on the absolute values ​​of the differences between each pseudo-labeled sample in the pseudo-labeled sample set, the pseudo-labeled samples in the pseudo-labeled sample set are sorted.

[0011] The process of training the second model for a target number of rounds according to the sorted pseudo-labeled samples and a preset course learning method includes: in each round of training, obtaining the pseudo-labeled samples corresponding to the current round in ascending order of absolute difference value from the sorted pseudo-labeled samples; wherein the training rounds and their corresponding proportions are positively correlated; and training the second model using the pseudo-labeled samples corresponding to the current round.

[0012] Before obtaining the pseudo-labeled samples corresponding to each round, the method further includes:

[0013] The proportion for each round is determined using the following formula:

[0014]

[0015] Among them, C linear (t) represents the ratio; t represents the current round; T represents the value of the target round; c0 represents the preset initial value of the ratio; the min function represents taking the minimum value.

[0016] This invention also provides an entity recognition domain transfer apparatus, comprising: an acquisition module for acquiring a labeled sample set and an unlabeled sample set corresponding to a target domain; a first training module for training a source model to be transferred to the target domain using the labeled sample set to obtain a first model; a filtering module for performing entity recognition on each unlabeled sample in the unlabeled sample set using the first model, and filtering a pseudo-labeled sample set in the unlabeled sample set according to the entity recognition results corresponding to each unlabeled sample; a second training module for training the first model using the pseudo-labeled sample set to obtain a second model; a sorting module for performing entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model, and sorting the pseudo-labeled samples according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model; and a third training module for training the second model to a target number of rounds according to a preset course learning method based on the sorted pseudo-labeled samples to obtain an entity recognition model.

[0017] This invention also provides an entity recognition domain migration device, which includes a processor and a memory; the processor is used to execute an entity recognition domain migration program stored in the memory to implement the entity recognition domain migration method described above.

[0018] This invention also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the entity recognition domain transfer method described in any of the preceding embodiments.

[0019] The beneficial effects of this invention are as follows:

[0020] This invention provides a domain transfer method for entity recognition based on course learning. First, the source model in the original domain is optimized using a small number of labeled samples in the target domain. Then, the optimized first model is used to filter a large number of unlabeled samples to obtain a batch of high-quality unlabeled samples, generating pseudo-labeled samples. Finally, the domain transfer is completed using these pseudo-labeled samples through course learning. This solves the problem that the scale of labeled data in domain transfer tasks is generally small, maximizes the use of unlabeled data, and makes the transferred model less prone to overfitting and has strong generalization ability. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0022] Figure 1 This is a flowchart of an entity recognition domain migration method according to an embodiment of the present invention;

[0023] Figure 2 This is a flowchart illustrating the training steps of a source model according to an embodiment of the present invention.

[0024] Figure 3 This is a flowchart illustrating the steps for forming a pseudo-labeled sample set according to an embodiment of the present invention.

[0025] Figure 4 This is a flowchart illustrating the training steps of a first model according to an embodiment of the present invention.

[0026] Figure 5 This is a flowchart of the sorting steps for pseudo-labeled samples according to an embodiment of the present invention;

[0027] Figure 6 This is a flowchart illustrating the steps of training a second model using a course-based learning method according to an embodiment of the present invention.

[0028] Figure 7 This is a structural diagram of an entity recognition domain migration device according to an embodiment of the present invention;

[0029] Figure 8 This is a structural diagram of an entity recognition domain migration device according to an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0031] According to an embodiment of the present invention, a domain migration method for entity recognition is provided.

[0032] like Figure 1 The diagram shown is a flowchart of an entity recognition domain migration method according to an embodiment of the present invention.

[0033] Step S110: Obtain the labeled sample set and the unlabeled sample set corresponding to the target domain.

[0034] In this embodiment of the invention, it is necessary to migrate the source model from the original domain to the target domain. The target domain can be an entity recognition domain. After the source model is migrated to the target domain, it can be used to perform named entity recognition tasks. However, those skilled in the art should understand that the target domain of this embodiment is not limited to the entity recognition domain; other domains can also refer to this embodiment of the invention for domain migration of the model.

[0035] The labeled sample set includes labeled samples from multiple target domains. Further, the labeled samples can be word sequences. Each word in the labeled samples corresponds to a pre-labeled ground truth label. The ground truth label is used to represent the entity type corresponding to the word. In this embodiment of the invention, the BIEO system can be used for entity recognition and labeling. Entity types include: entity beginning (B), entity middle (I), entity end (E), and non-entity (O). When labeling, B, I, E, and O can be used to represent the corresponding entity types, respectively.

[0036] The unlabeled sample set includes unlabeled samples from multiple target domains. Furthermore, unlabeled samples can be word sequences. The words in the unlabeled samples are not labeled with the actual tags.

[0037] Step S120: Using the labeled sample set, train the source model to be transferred to the domain to obtain the first model.

[0038] The purpose of this step is to train the source model of the original domain using the labeled sample set of the target domain, so as to fine-tune the source model in the target domain and obtain the first model.

[0039] The steps for training the source model will be described in detail later, so they will not be repeated here.

[0040] Step S130: Use the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set, and filter the pseudo-labeled sample set in the unlabeled sample set according to the entity recognition results corresponding to each unlabeled sample.

[0041] The pseudo-annotated sample set includes pseudo-annotated samples from multiple target domains. Furthermore, the pseudo-annotated samples can be word sequences. Each word in the pseudo-annotated sample corresponds to a temporarily labeled entity tag. The entity tag is used to represent the entity type corresponding to the word.

[0042] The purpose of this step is to use the first model to generate and filter pseudo-labeled samples from multiple unlabeled samples in the target domain, forming a pseudo-labeled sample set.

[0043] The steps for filtering pseudo-labeled sample sets will be described in detail later, so they will not be repeated here.

[0044] Step S140: Using the pseudo-labeled sample set, train the first model to obtain the second model.

[0045] The purpose of this step is to train the first model using a pseudo-labeled sample set in the target domain, and then further refine the first model to obtain the second model.

[0046] The steps for training the first model will be described in detail later, so they will not be repeated here.

[0047] Step S150: Entity recognition is performed on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model respectively, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model respectively.

[0048] The purpose of this step is to determine the sample difficulty of the pseudo-labeled samples by combining the entity recognition results output by the first model and the second model. Sort the pseudo-labeled samples according to the entity recognition results output by the first and second models; this is equivalent to sorting the pseudo-labeled samples according to their sample difficulty.

[0049] Sample difficulty measures how easy or difficult it is for a model to learn from samples. Furthermore, the lower the sample difficulty, the smaller the gap between the model's entity recognition results and the labeled data, meaning the more accurate the recognition; conversely, the higher the sample difficulty, the greater the gap between the model's entity recognition results and the labeled data.

[0050] Step S160: Based on the sorted pseudo-labeled samples, the second model is trained for the target round according to a preset course learning method to obtain the entity recognition model.

[0051] The course learning method refers to training the second model in stages, from easy to difficult, according to the difficulty of the pseudo-labeled samples. Each round corresponds to one stage.

[0052] Furthermore, the improvement process of model capability follows a simple linear function or square root function; as the number of training iterations increases, the model capability gradually improves. Therefore, in this embodiment of the invention, the pseudo-labeled samples are sorted according to their difficulty. In each round of training, some or all of the pseudo-labeled samples are obtained in order of increasing difficulty. The second model is first trained using pseudo-labeled samples with lower difficulty, and then trained using pseudo-labeled samples with higher difficulty.

[0053] Furthermore, the pseudo-labeled samples can be sorted once beforehand, and during the training of the second model according to the course learning method, pseudo-labeled samples can be obtained in each round of training with reference to the sorting order of the pseudo-labeled samples. Alternatively, during the training of the second model according to the course learning method, the pseudo-labeled samples can be re-sorted after each round of training (when re-sorting, the entity recognition result newly output by the second model for each pseudo-labeled sample is used), and the pseudo-labeled samples can be obtained in the next round of training according to the new sorting order of the pseudo-labeled samples.

[0054] This invention provides a domain transfer method for entity recognition based on course learning. First, the source model in the original domain is optimized using a small number of labeled samples in the target domain. Then, the optimized first model is used to filter a large number of unlabeled samples to obtain a batch of high-quality unlabeled samples, generating pseudo-labeled samples. Finally, the domain transfer is completed using these pseudo-labeled samples through course learning. This solves the problem that the scale of labeled data in domain transfer tasks is generally small, maximizes the use of unlabeled data, and makes the transferred model less prone to overfitting and has strong generalization ability.

[0055] The following describes in detail the steps for training the source model.

[0056] In this embodiment, training is performed on the source model for a first preset number of rounds. The first preset number of rounds is an empirical value or a value obtained through experiments.

[0057] In each training round, multiple labeled samples from the labeled sample set are sequentially input into the source model, causing the source model to perform operations for each labeled sample. Figure 2 The steps are shown.

[0058] like Figure 2 The diagram shown is a flowchart of the training steps of the source model according to an embodiment of the present invention.

[0059] Step S210: Perform preprocessing on the received labeled samples to obtain the character vector corresponding to each character in the labeled samples.

[0060] The labeled samples are input into the source model as a sequence of characters, and the source model performs preprocessing on each character. This preprocessing is used to generate a vector corresponding to each character.

[0061] For example: Define x = [x1, x2, ..., x...] i ,…,x n [x] represents the word sequence of the labeled sample x. i Let represent the i-th character, where i > 0. After preprocessing the source model, we can obtain X = [v1, v2, ..., v...]. i ,…,v n ], X represents the matrix obtained after the input word sequence has been preprocessed by the source model, v i Let L represent the vector corresponding to the i-th character. Define L = [l1, l2, ..., l...] i ,…,l n ] represents the sequence corresponding to the true label of the labeled sample, l i This represents the actual label corresponding to the i-th character.

[0062] Step S220: Determine the highest-level encoding of the character vector corresponding to each character in the source model.

[0063] The source model has a multi-layer coding structure, and the highest-level coding refers to the coding of the character vector in the highest layer of the source model. The highest-level coding can be obtained by iteratively coding the character vector corresponding to each character.

[0064] For example, BERT_A() is the encoder computation unit of the source model, and the encoded representation of the word vector is as follows:

[0065]

[0066] in, Representing word vector v i The encoded representation at layer m of the source model. 0 < m ≤ M. Then, v i The highest level encoding can be represented as

[0067] Step S230: For each character, determine the predicted label probability set corresponding to the character based on the highest layer encoding of the character vector corresponding to the character in the source model, and the transmission probability between the character and its preceding character.

[0068] The predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label.

[0069] The predicted label probability set is the probability distribution of entity labels. For example, the predicted label probability set includes: the label probability corresponding to label B, the label probability corresponding to label I, the label probability corresponding to label E, and the label probability corresponding to label O.

[0070] In this embodiment of the invention, the tag probability is determined based on the predicted probability value and the transmission probability value.

[0071] Furthermore, a linear chain of CRF (Conditional Random Field) can be used to determine the label probability distribution corresponding to the word sequence of the labeled sample, which includes the predicted label probability set corresponding to each word.

[0072] For example, the following formula can be used to determine the probability set of predicted labels for each character in the labeled samples:

[0073]

[0074] Among them, Prob l|x This represents the set of predicted label probabilities for each character in the labeled samples; This represents the highest-level encoding corresponding to the i-th character; Let k(l) represent the predicted probability value (unnormalized softmax) of the i-th word corresponding to each entity type (B, I, E, O) predicted by the source model. i-1 ,l i ) represents the transmission probability between the i-th word and the (i-1)-th word, and π(x) represents the normalization factor.

[0075] In this embodiment, the transfer probability function is the CRF algorithm function.

[0076] In this embodiment, each character in the labeled sample corresponds to a predicted label probability set, and each label probability set includes multiple label probabilities, where π(x) is the sum of all label probabilities.

[0077] Step S240: Adjust the source model according to the predicted label probability set corresponding to each character and the real label corresponding to each character in the labeled sample until the training of the source model for the first preset number of rounds is completed, and obtain the first model.

[0078] The predicted label probability set for each character includes the label probability for each type of entity label.

[0079] In the predicted label probability set corresponding to each character, the entity label corresponding to the highest label probability is determined. The entity label corresponding to the highest label probability for each character is then compared sequentially with the true label corresponding to that character. If the entity labels corresponding to each character match their corresponding true labels, the source model continues to be trained. If the entity labels corresponding to some characters do not match their corresponding true labels, the parameters in the source model are tuned, and then the source model continues to be trained. Further, the tuning process involves training the model to make the predicted label distribution continuously approach the true label distribution. The true label distribution has a probability of 1 for the true label and 0 for all others. The training process aims to make the probability of the true label continuously approach 1, while the probability of other labels gradually decreases.

[0080] The source model is trained once for each labeled sample in the labeled sample set, which constitutes one round of training. After one round of training, it is determined whether the number of training rounds has reached the first preset number of rounds. If not, a new round of training begins; if the first preset number of rounds has been reached, the tuning training of the source model stops. After tuning the source model, the corresponding first model is obtained.

[0081] In this embodiment of the invention, after obtaining the first model, pseudo-labeled samples are generated and filtered from the unlabeled samples to form a pseudo-labeled sample set.

[0082] like Figure 3 The diagram shown is a flowchart illustrating the steps for forming a pseudo-labeled sample set according to an embodiment of the present invention.

[0083] Step S310: For each unlabeled sample in the unlabeled sample set, the first model determines the predicted label probability set corresponding to each character in the unlabeled sample.

[0084] To enable the first model to determine the predicted label probability set for each character in the unlabeled samples, refer to the above. Figure 2 The steps are shown below. Specifically, multiple unlabeled samples from the unlabeled sample set are sequentially input into the first model, causing the first model to perform the following steps for each unlabeled sample:

[0085] Step S1: Perform preprocessing on the received unlabeled samples to obtain the character vector corresponding to each character in the unlabeled samples.

[0086] The word sequence of an unlabeled sample can be defined as y = [y1, y2, ..., y]. i ,…,y n ], y i This represents the i-th character.

[0087] The preprocessed vector matrix can be defined as Y = [u1, u2, ..., u i ,…,un ], u i This represents the vector corresponding to the i-th character.

[0088] Step S2: Determine the highest-level encoding of the character vector corresponding to each character in the first model.

[0089] For example, BERT_B() is the encoder computation unit of the first model, and the encoded representation of the word vector is as follows:

[0090]

[0091] at this time, Representing word vector u i The encoded representation of the m-th layer in the first model. Then, u i The highest level encoding can be represented as

[0092] Step S3: For each character, determine the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector in the first model and the transmission probability between the character and its preceding character. The predicted label probability set includes multiple label probabilities, each label probability corresponding to an entity label.

[0093] For example, the following formula can be used to determine the predicted label probability set for each character in an unlabeled sample:

[0094]

[0095] Among them, Prob l|y This represents the set of predicted label probabilities for each character in an unlabeled sample. This represents the highest-level encoding corresponding to the i-th character; k(l) represents the predicted probability value of the i-th character in the first model for each entity type. i-1 ,l i ) represents the transmission probability between the i-th word and the (i-1)-th word, and π(y) represents the normalization factor.

[0096] Step S320: For each character in the unlabeled sample, determine the maximum label probability in the predicted label probability set corresponding to the character, and label the character as the entity label corresponding to the maximum label probability.

[0097] In this embodiment of the invention, the entity label corresponding to the highest label probability is selected as u. i (y i The corresponding entity tag. That is to say, y i The corresponding entity label l = Max(Prob l|yThis process generates entity label sequences corresponding to the word sequences of unlabeled samples. By merging the word sequences of unlabeled samples and the entity label sequences, each word can be labeled.

[0098] Step S330: Determine the prediction score corresponding to the unlabeled sample based on the maximum label probability corresponding to each character in the unlabeled sample.

[0099] For each unlabeled sample, perform the following operations: sum the maximum label probabilities corresponding to each character in the unlabeled sample to obtain the total label probabilities; divide the total label probabilities by the number of characters in the unlabeled sample to obtain the average label probabilities; and use the average label probabilities as the prediction score for the unlabeled sample.

[0100] Step S340: For each unlabeled sample in the unlabeled sample set, the unlabeled sample with a predicted score greater than a preset score threshold is taken as a pseudo-labeled sample in the pseudo-labeled sample set.

[0101] The score threshold is used to filter out high-quality unlabeled samples. The score threshold can be an empirical value or a value obtained through experimentation. Specifically, the higher the predicted score of an unlabeled sample, the closer it is to the model, and the closer the temporarily labeled entity labels are to reality, resulting in higher quality. Conversely, the lower the predicted score of an unlabeled sample, the greater the difference between it and the model, and the less the temporarily labeled entity labels are to reality, resulting in lower quality.

[0102] Unlabeled samples with predicted scores greater than a preset score threshold are retained as pseudo-labeled samples; unlabeled samples with predicted scores less than or equal to the score threshold are discarded.

[0103] After forming the pseudo-labeled sample set, this embodiment of the invention trains a first model using the pseudo-labeled sample set to obtain a second model. The first model can be trained for a second preset number of rounds. The second preset number of rounds is an empirical value or a value obtained through experimentation. In each round of training, multiple pseudo-labeled samples from the pseudo-labeled sample set are sequentially input into the first model, causing the first model to perform the following operations for each pseudo-labeled sample: Figure 4 The steps shown (and) Figure 2 The steps are similar and can be referred to. Figure 2 (The process).

[0104] like Figure 4 The diagram shown is a flowchart of the training steps for a first model according to an embodiment of the present invention.

[0105] Step S410: Perform preprocessing on the received pseudo-annotated samples to obtain the character vector corresponding to each character in the pseudo-annotated samples.

[0106] Step S420: Determine the highest-level encoding of the character vector corresponding to each character in the first model.

[0107] Step S430: For each character, determine the predicted label probability set corresponding to the character based on the highest layer encoding of the character vector corresponding to the character in the first model, and the transmission probability between the character and its preceding character.

[0108] Step S440: Adjust the first model according to the predicted label probability set corresponding to each character and the entity label corresponding to each character in the pseudo-label sample until the training of the first model for the second preset number of rounds is completed, and obtain the second model.

[0109] After obtaining the second model, the entity recognition results of the pseudo-labeled samples are used to sort the pseudo-labeled samples using the first and second models respectively. For each pseudo-labeled sample in the pseudo-labeled sample set, the following steps are performed: Figure 5 The steps are shown.

[0110] like Figure 5 The diagram shown is a flowchart of the sorting steps for pseudo-labeled samples according to an embodiment of the present invention.

[0111] Step S510: Determine the predicted label probability set corresponding to each character in the pseudo-labeled sample through the first model, determine the maximum label probability in the predicted label probability set corresponding to each character, and determine the first average label probability corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character.

[0112] The predicted label probability set includes: multiple label probabilities, each label probability corresponding to an entity label.

[0113] To enable the first model to determine the predicted label probability set for each character in the pseudo-labeled samples, the steps for determining the predicted label probability set described above can be followed, such as:

[0114] Step S1: Perform preprocessing on the received pseudo-annotated samples to obtain the character vector corresponding to each character in the pseudo-annotated samples.

[0115] Step S2: Determine the highest-level encoding of the character vector corresponding to each character in the first model.

[0116] Step S3: For each character, determine the predicted label probability set corresponding to the character based on the highest layer encoding of the character vector corresponding to the character in the first model, and the transmission probability between the character and its preceding character.

[0117] After determining the predicted label probability set corresponding to each character in the pseudo-labeled sample, the maximum label probability in each predicted label probability set is determined. Based on the maximum label probability corresponding to each character in the pseudo-labeled sample and the number of characters in the pseudo-labeled sample, the first average label probability corresponding to the pseudo-labeled sample is determined.

[0118] Step S520: Determine the predicted label probability set corresponding to each character in the pseudo-labeled sample through the second model, determine the maximum label probability in the predicted label probability set corresponding to each character, and determine the second average label probability corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character.

[0119] To enable the second model to determine the predicted label probability set for each character in the pseudo-labeled samples, the steps for determining the predicted label probability set described above can be followed, such as:

[0120] Step S1: Perform preprocessing on the received pseudo-annotated samples to obtain the character vector corresponding to each character in the pseudo-annotated samples.

[0121] Step S2: Determine the highest-level encoding of the character vector corresponding to each character in the second model.

[0122] Step S3: For each character, determine the predicted label probability set corresponding to the character based on the highest layer encoding of the character vector corresponding to the character in the second model, and the transmission probability between the character and its preceding character.

[0123] After determining the predicted label probability set corresponding to each character in the pseudo-labeled sample, the maximum label probability in each predicted label probability set is determined. Based on the maximum label probability corresponding to each character in the pseudo-labeled sample and the number of characters in the pseudo-labeled sample, the second average label probability corresponding to the pseudo-labeled sample is determined.

[0124] Step S530: For each pseudo-labeled sample in the pseudo-labeled sample set, determine the absolute value of the difference between the first average label probability and the second average label probability of the same pseudo-labeled sample.

[0125] Steps S510 and S520 can be parallel steps. After steps S510 and S520, each pseudo-labeled sample in the pseudo-labeled sample set will correspond to a first average label probability and a second average label probability; for each pseudo-labeled sample, the absolute value of the difference between its first average label probability and its second average label probability is calculated.

[0126] Step S540: Sort the pseudo-labeled samples in the pseudo-labeled sample set according to the absolute value of the difference between each pseudo-labeled sample in the pseudo-labeled sample set.

[0127] In this embodiment, the absolute value of the difference can be used to reflect the sample difficulty of the pseudo-labeled sample. Therefore, when sorting, the pseudo-labeled samples in the pseudo-labeled sample set can be sorted in order of the absolute value of the difference from smallest to largest.

[0128] A small absolute value of the difference indicates that the pseudo-labeled sample is a sample whose distribution differs little from the source model, and is also a sample that the model can learn more easily.

[0129] A large absolute value of the difference indicates that the pseudo-labeled sample is a sample whose distribution differs significantly from that of the source model, and is also a sample that is difficult for the model to learn.

[0130] After sorting the pseudo-labeled samples in the pseudo-labeled sample set, the second model is trained in multiple rounds using a course learning approach.

[0131] like Figure 6 The diagram shown is a flowchart illustrating the steps of training a second model using a course-based learning approach according to an embodiment of the present invention.

[0132] Step S610: In each training round, according to the order of the absolute value of the difference from smallest to largest, obtain the pseudo-labeled samples corresponding to the proportion of the current round from each of the sorted pseudo-labeled samples; wherein, the training round and its corresponding proportion are positively correlated.

[0133] In this embodiment of the invention, a corresponding proportion can be pre-selected for each round. For example, the first round corresponds to 20%, the second round corresponds to 40%, and so on.

[0134] In this embodiment of the invention, before obtaining the pseudo-labeled samples corresponding to each round, the proportion corresponding to each round can be determined using the following formula:

[0135]

[0136] Among them, C linear (t) represents the ratio; t represents the current round; T represents the value of the target round; c0 represents the preset initial value of the ratio; the min function represents taking the minimum value.

[0137] In this embodiment of the invention, each pseudo-labeled sample in the pseudo-labeled sample set corresponds to an absolute value of difference; the pseudo-labeled samples in the pseudo-labeled sample set are sorted in ascending order of absolute value of difference; starting from the smallest absolute value of difference, the pseudo-labeled samples corresponding to the current round are obtained.

[0138] Step S620: Train the second model using the pseudo-labeled samples corresponding to the current round proportion.

[0139] For example: Preset c0 to 20%, T to 5; when t = 0, C linearIf (0) = 20%, then in the first round, the first 20% of pseudo-labeled samples can be obtained from the pseudo-labeled sample set in order of increasing absolute value of the difference to train the second model until the training of the second model for 5 rounds is completed.

[0140] This invention also provides an entity recognition domain migration device, such as... Figure 7 The diagram shown is a structural diagram of an entity recognition domain migration device according to an embodiment of the present invention.

[0141] The device includes:

[0142] The acquisition module 710 is used to acquire the labeled sample set and the unlabeled sample set corresponding to the target domain.

[0143] The first training module 720 is used to train the source model to be transferred to the domain using the labeled sample set, so as to obtain the first model.

[0144] The filtering module 730 is used to perform entity recognition on each unlabeled sample in the unlabeled sample set using the first model, and to filter a pseudo-labeled sample set in the unlabeled sample set according to the entity recognition results corresponding to each unlabeled sample.

[0145] The second training module 740 is used to train the first model using the pseudo-labeled sample set to obtain the second model.

[0146] The sorting module 750 is used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model respectively, and to sort each pseudo-labeled sample according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model.

[0147] The third training module 760 is used to train the second model for the target round according to the sorted pseudo-labeled samples and a preset course learning method to obtain the entity recognition model.

[0148] The functions of the device described in the embodiments of the present invention have been described in the above method embodiments. Therefore, for any parts not described in detail in this embodiment, please refer to the relevant descriptions in the foregoing embodiments, which will not be repeated here.

[0149] This embodiment provides a domain migration device for entity recognition. For example... Figure 8 The diagram shown is a structural diagram of an entity recognition domain migration device according to an embodiment of the present invention.

[0150] In this embodiment, the entity recognition domain migration device includes, but is not limited to, a processor 810 and a memory 820.

[0151] The processor 810 is used to execute the entity recognition domain migration program stored in the memory 820 to implement the above-described entity recognition domain migration method.

[0152] Specifically, the processor 810 executes an entity recognition domain transfer program stored in the memory 820 to perform the following steps: obtaining a labeled sample set and an unlabeled sample set corresponding to the target domain; using the labeled sample set to train a source model for domain transfer, obtaining a first model; using the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set, and filtering a pseudo-labeled sample set in the unlabeled sample set according to the entity recognition results corresponding to each unlabeled sample; using the pseudo-labeled sample set to train the first model, obtaining a second model; using the first model and the second model to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and sorting each pseudo-labeled sample according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model; and training the second model for a target number of rounds according to a preset course learning method based on the sorted pseudo-labeled samples, obtaining an entity recognition model.

[0153] The method of training a source model for domain transfer using the labeled sample set includes: in each training round, inputting multiple labeled samples from the labeled sample set sequentially into the source model, causing the source model to perform the following steps for each labeled sample: preprocessing the received labeled sample to obtain the character vector corresponding to each character in the labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the source model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the source model and the transfer probability between the character and its preceding character; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; adjusting the source model based on the predicted label probability set corresponding to each character and the real label corresponding to each character in the labeled sample, until the training of the source model for the first preset number of rounds is completed, thus obtaining a first model.

[0154] The process involves using the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set, and filtering a pseudo-labeled sample set based on the entity recognition results for each unlabeled sample. This includes: for each unlabeled sample in the unlabeled sample set, the first model determines a predicted label probability set corresponding to each character in the unlabeled sample; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; for each character in the unlabeled sample, the maximum label probability in the predicted label probability set corresponding to the character is determined, and the character is labeled as the entity label corresponding to the maximum label probability; based on the maximum label probability corresponding to each character in the unlabeled sample, a predicted score corresponding to the unlabeled sample is determined; and for each unlabeled sample in the unlabeled sample set, the unlabeled sample with a predicted score greater than a preset score threshold is designated as a pseudo-labeled sample in the pseudo-labeled sample set.

[0155] The method of training the first model using the pseudo-labeled sample set to obtain the second model includes: in each training round, inputting multiple pseudo-labeled samples from the pseudo-labeled sample set sequentially into the first model, causing the first model to perform the following steps for each pseudo-labeled sample: preprocessing the received pseudo-labeled sample to obtain the character vector corresponding to each character in the pseudo-labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the first model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the first model and the transmission probability between the character and its preceding character; adjusting the first model based on the predicted label probability set corresponding to each character and the entity label corresponding to each character in the pseudo-labeled sample, until the training of the first model for a second preset number of rounds is completed, thereby obtaining the second model.

[0156] Specifically, the first model and the second model are used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model. This includes performing the following steps for each pseudo-labeled sample in the pseudo-labeled sample set: determining the predicted label probability set corresponding to each character in the pseudo-labeled sample using the first model; determining the maximum label probability in the predicted label probability set corresponding to each character; and determining the first level corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character. The predicted label probability set includes multiple label probabilities, each corresponding to an entity label. The predicted label probability set for each character in the pseudo-labeled sample is determined using the second model. The maximum label probability in the predicted label probability set for each character is determined, and based on the maximum label probability for each character, the second average label probability corresponding to the pseudo-labeled sample is determined. For each pseudo-labeled sample in the pseudo-labeled sample set, the absolute value of the difference between the first average label probability and the second average label probability of the same pseudo-labeled sample is determined. Based on the absolute values ​​of the differences between each pseudo-labeled sample in the pseudo-labeled sample set, the pseudo-labeled samples in the pseudo-labeled sample set are sorted.

[0157] The process of training the second model for a target number of rounds according to the sorted pseudo-labeled samples and a preset course learning method includes: in each round of training, obtaining the pseudo-labeled samples corresponding to the current round in ascending order of absolute difference value from the sorted pseudo-labeled samples; wherein the training rounds and their corresponding proportions are positively correlated; and training the second model using the pseudo-labeled samples corresponding to the current round.

[0158] Before obtaining the pseudo-labeled samples corresponding to each round, the method further includes:

[0159] The proportion for each round is determined using the following formula:

[0160]

[0161] Among them, C linear (t) represents the ratio; t represents the current round; T represents the value of the target round; c0 represents the preset initial value of the ratio; the min function represents taking the minimum value.

[0162] This invention also provides a computer-readable storage medium. This computer-readable storage medium stores one or more programs. The computer-readable storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.

[0163] When one or more programs in a computer-readable storage medium can be executed by one or more processors to implement the above-described entity recognition domain transfer method.

[0164] Specifically, the processor executes an entity recognition domain transfer program stored in memory to perform the following steps: acquiring a labeled sample set and an unlabeled sample set corresponding to the target domain; training a source model for domain transfer using the labeled sample set to obtain a first model; performing entity recognition on each unlabeled sample in the unlabeled sample set using the first model, and filtering a pseudo-labeled sample set in the unlabeled sample set based on the entity recognition results corresponding to each unlabeled sample; training the first model using the pseudo-labeled sample set to obtain a second model; performing entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model respectively, and sorting each pseudo-labeled sample according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model; and training the second model for a target number of rounds according to a preset course learning method based on the sorted pseudo-labeled samples to obtain an entity recognition model.

[0165] The method of training a source model for domain transfer using the labeled sample set includes: in each training round, inputting multiple labeled samples from the labeled sample set sequentially into the source model, causing the source model to perform the following steps for each labeled sample: preprocessing the received labeled sample to obtain the character vector corresponding to each character in the labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the source model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the source model and the transfer probability between the character and its preceding character; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; adjusting the source model based on the predicted label probability set corresponding to each character and the real label corresponding to each character in the labeled sample, until the training of the source model for the first preset number of rounds is completed, thus obtaining a first model.

[0166] The process involves using the first model to perform entity recognition on each unlabeled sample in the unlabeled sample set, and filtering a pseudo-labeled sample set based on the entity recognition results for each unlabeled sample. This includes: for each unlabeled sample in the unlabeled sample set, the first model determines a predicted label probability set corresponding to each character in the unlabeled sample; wherein the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; for each character in the unlabeled sample, the maximum label probability in the predicted label probability set corresponding to the character is determined, and the character is labeled as the entity label corresponding to the maximum label probability; based on the maximum label probability corresponding to each character in the unlabeled sample, a predicted score corresponding to the unlabeled sample is determined; and for each unlabeled sample in the unlabeled sample set, the unlabeled sample with a predicted score greater than a preset score threshold is designated as a pseudo-labeled sample in the pseudo-labeled sample set.

[0167] The method of training the first model using the pseudo-labeled sample set to obtain the second model includes: in each training round, inputting multiple pseudo-labeled samples from the pseudo-labeled sample set sequentially into the first model, causing the first model to perform the following steps for each pseudo-labeled sample: preprocessing the received pseudo-labeled sample to obtain the character vector corresponding to each character in the pseudo-labeled sample; determining the highest-level encoding of the character vector corresponding to each character in the first model; for each character, determining the predicted label probability set corresponding to the character based on the highest-level encoding of the character vector corresponding to the character in the first model and the transmission probability between the character and its preceding character; adjusting the first model based on the predicted label probability set corresponding to each character and the entity label corresponding to each character in the pseudo-labeled sample, until the training of the first model for a second preset number of rounds is completed, thereby obtaining the second model.

[0168] Specifically, the first model and the second model are used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model. This includes performing the following steps for each pseudo-labeled sample in the pseudo-labeled sample set: determining the predicted label probability set corresponding to each character in the pseudo-labeled sample using the first model; determining the maximum label probability in the predicted label probability set corresponding to each character; and determining the first level corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character. The predicted label probability set includes multiple label probabilities, each corresponding to an entity label. The predicted label probability set for each character in the pseudo-labeled sample is determined using the second model. The maximum label probability in the predicted label probability set for each character is determined, and based on the maximum label probability for each character, the second average label probability corresponding to the pseudo-labeled sample is determined. For each pseudo-labeled sample in the pseudo-labeled sample set, the absolute value of the difference between the first average label probability and the second average label probability of the same pseudo-labeled sample is determined. Based on the absolute values ​​of the differences between each pseudo-labeled sample in the pseudo-labeled sample set, the pseudo-labeled samples in the pseudo-labeled sample set are sorted.

[0169] The process of training the second model for a target number of rounds according to the sorted pseudo-labeled samples and a preset course learning method includes: in each round of training, obtaining the pseudo-labeled samples corresponding to the current round in ascending order of absolute difference value from the sorted pseudo-labeled samples; wherein the training rounds and their corresponding proportions are positively correlated; and training the second model using the pseudo-labeled samples corresponding to the current round.

[0170] Before obtaining the pseudo-labeled samples corresponding to each round, the method further includes:

[0171] The proportion for each round is determined using the following formula:

[0172]

[0173] Among them, C linear (t) represents the ratio; t represents the current round; T represents the value of the target round; c0 represents the preset initial value of the ratio; the min function represents taking the minimum value.

[0174] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A method for transferring knowledge from entity recognition domains, characterized in that, include: Obtain the labeled and unlabeled sample sets corresponding to the target domain; Using the labeled sample set, the source model to be transferred to the target domain is trained to obtain the first model; The first model is used to perform entity recognition on each unlabeled sample in the unlabeled sample set, and a pseudo-labeled sample set is selected from the unlabeled sample set based on the entity recognition results corresponding to each unlabeled sample. Using the pseudo-labeled sample set, the first model is trained to obtain the second model; The first model and the second model are used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model. Based on the sorted pseudo-labeled samples, the second model is trained for the target round according to the preset course learning method to obtain the entity recognition model; Using the labeled sample set, train the source model for domain transfer, including: In each training round, multiple labeled samples from the labeled sample set are sequentially input into the source model, causing the source model to perform the following steps for each labeled sample: Preprocessing is performed on the received labeled samples to obtain the character vector corresponding to each character in the labeled samples; Determine the highest-level encoding of the character vector corresponding to each character in the source model; For each character, the predicted label probability set corresponding to the character is determined based on the highest-level encoding of the character vector in the source model and the transmission probability between the character and its preceding character. Based on the predicted label probability set corresponding to each character and the real label corresponding to each character in the labeled sample, the source model is adjusted until the training of the source model for the first preset number of rounds is completed, and the first model is obtained. The first model and the second model are used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set, and the pseudo-labeled samples are sorted according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model, including: For each pseudo-labeled sample in the pseudo-labeled sample set, perform the following steps: The first model determines the predicted label probability set corresponding to each character in the pseudo-labeled sample, determines the maximum label probability in the predicted label probability set corresponding to each character, and determines the first average label probability corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character; wherein, the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; The second model is used to determine the predicted label probability set corresponding to each character in the pseudo-labeled sample, determine the maximum label probability in the predicted label probability set corresponding to each character, and determine the second average label probability corresponding to the pseudo-labeled sample based on the maximum label probability corresponding to each character. For each pseudo-labeled sample in the pseudo-labeled sample set, determine the absolute value of the difference between the first average label probability and the second average label probability of the same pseudo-labeled sample; The pseudo-labeled samples in the pseudo-labeled sample set are sorted according to the absolute value of the difference between each pseudo-labeled sample in the pseudo-labeled sample set.

2. The method according to claim 1, characterized in that, The first model is used to perform entity recognition on each unlabeled sample in the unlabeled sample set, and based on the entity recognition results corresponding to each unlabeled sample, a pseudo-labeled sample set is filtered from the unlabeled sample set, including: For each unlabeled sample in the unlabeled sample set, the first model determines the predicted label probability set corresponding to each character in the unlabeled sample; wherein, the predicted label probability set includes multiple label probabilities, and each label probability corresponds to an entity label; For each character in the unlabeled sample, determine the maximum label probability in the predicted label probability set corresponding to the character, and label the character as the entity label corresponding to the maximum label probability; The prediction score corresponding to the unlabeled sample is determined based on the maximum label probability corresponding to each character in the unlabeled sample. For each unlabeled sample in the unlabeled sample set, the unlabeled sample with a predicted score greater than a preset score threshold is regarded as a pseudo-labeled sample in the pseudo-labeled sample set.

3. The method according to claim 2, characterized in that, Using the pseudo-labeled sample set, the first model is trained to obtain the second model, including: In each round of training, multiple pseudo-labeled samples from the pseudo-labeled sample set are sequentially input into the first model, causing the first model to perform the following steps for each pseudo-labeled sample: Preprocessing is performed on the received pseudo-annotated samples to obtain the character vector corresponding to each character in the pseudo-annotated samples; Determine the highest-level encoding of the character vector corresponding to each character in the first model; For each character, the predicted label probability set corresponding to the character is determined based on the highest layer encoding of the character vector corresponding to the character in the first model, and the transmission probability between the character and its preceding character; Based on the predicted label probability set corresponding to each character and the entity label corresponding to each character in the pseudo-labeled sample, the first model is adjusted until the training of the first model for a second preset number of rounds is completed, thus obtaining the second model.

4. The method according to claim 1, characterized in that, Based on the sorted pseudo-labeled samples, the second model is trained for the target round according to a preset course learning method, including: In each training round, pseudo-labeled samples of the current round are obtained from the sorted pseudo-labeled samples in ascending order of absolute difference value; wherein, the training round and its corresponding proportion are positively correlated. The second model is trained using the pseudo-labeled samples corresponding to the current round.

5. The method according to claim 4, characterized in that, Before obtaining the pseudo-labeled samples corresponding to each round, the process also includes: The proportion for each round is determined using the following formula: ; in, Indicates proportion; Indicates the current round; This represents the value of the target round; This indicates the preset initial value of the ratio; The function represents taking the minimum value.

6. A domain migration device for entity recognition, employing the method according to any one of claims 1 to 5, characterized in that, include: The acquisition module is used to acquire the labeled and unlabeled sample sets corresponding to the target domain. The first training module is used to train the source model to be transferred to the domain using the labeled sample set, so as to obtain the first model; The filtering module is used to perform entity recognition on each unlabeled sample in the unlabeled sample set using the first model, and to filter the pseudo-labeled sample set in the unlabeled sample set according to the entity recognition results corresponding to each unlabeled sample. The second training module is used to train the first model using the pseudo-labeled sample set to obtain the second model; The sorting module is used to perform entity recognition on each pseudo-labeled sample in the pseudo-labeled sample set using the first model and the second model respectively, and to sort each pseudo-labeled sample according to the entity recognition results corresponding to each pseudo-labeled sample output by the first model and the entity recognition results corresponding to each pseudo-labeled sample output by the second model. The third training module is used to train the second model for the target round according to the sorted pseudo-labeled samples and a preset course learning method to obtain the entity recognition model.

7. A device for transferring knowledge in the field of entity recognition, characterized in that, The entity recognition domain migration device includes a processor and a memory; the processor is used to execute the entity recognition domain migration program stored in the memory to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device, computer equipment and readable storage medium

    CN115687910A

  • Pseudo label labeling method and device, electronic equipment, medium and program product

    CN115761312A