Improved method and system for cross-lingual named entity recognition

WO2024221383A9PCT designated stage expired Publication Date: 2024-12-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/091463
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-12-19

Smart Images

  • Figure CN2023091463_19122024_PF_FP_ABST
    Figure CN2023091463_19122024_PF_FP_ABST
Patent Text Reader

Abstract

A first dataset corresponding to a source language and a second dataset corresponding to a target language are obtained. A machine learning model is employed to generate entity representations including source language representations based on the first dataset and target language representations based on the second dataset. The entity representations are inputted into a classifier for outputting preliminary values associated with a plurality of entity classes. The preliminary values are converted into predicted probability values corresponding to the plurality of entity classes. A prototype representation for each of the plurality of entity classes is generated based on the source language representations. A similarity metric for the prototype representation and its associated entity representations is calculated and probability values based on the similarity metric are generated. A loss metric is computed by comparing the generated probability values and the predicted probability values and parameters of the machine learning model are updated based on the loss metric to provide an updated machine learning model.
Need to check novelty before this filing date? Find Prior Art

Description

IMPROVED METHOD AND SYSTEM FOR CROSS-LINGUAL NAMED ENTITY RECOGNITIONTECHNICAL FIELD

[0001] The present application relates generally to artificial intelligence and machine learning systems and more particularly to methods and systems for improving Cross-lingual Named Entity Recognition (NER) performance for zero-resource or low-resource languages.BACKGROUND

[0002] Named Entity Recognition (NER) is a critical task in Natural Language Processing, which involves identifying and classifying named entities such as people, organizations, locations, dates, and other specific types of information within a given text. NER has various applications, including information extraction, question-answering systems, text summarization, and sentiment analysis. With the increasing availability of multilingual content on the internet, there is a growing need for NER systems that can effectively process and analyze texts in different languages. While significant progress has been made in developing NER systems for high-resource languages, such as English and Spanish, the performance of these systems in zero-resource or low-resource languages remains unsatisfactory. The zero-resource or low-resource challenge arises due to the lack of sufficient annotated training data in many languages, which hampers the development of high-performing NER systems. Collecting and annotating data for each language can be expensive, time-consuming, and challenging, especially for languages with a limited number of speakers or specialized domains.

[0003] To overcome this challenge, cross-lingual NER approaches have been proposed that leverage voluminous labeled data from high-resource languages to improve NER performance in low-resource languages. These approaches often rely on techniques such as transfer learning, representation transfer, or machine translation to adapt models trained on high-resource languages to low-resource languages. Nonetheless, current cross-lingual NER approaches aimed at tackling the zero-resource or low-resource problem encounter limitations such as laborious training procedures that result in increased computational expenses or an absence of explicit optimization tailored to the NER operation.

[0004] Thus, it is desirable to provide a method and system for Cross-lingual Named Entity Recognition to address the disadvantages or limitations of the existing art or to at least provide the public with a useful choice.

[0005] SUMMARY

[0006] The present invention aims to provide new and useful methods and systems for Cross-lingual Named Entity Recognition (NER) for zero-resource or low-resource languages.

[0007] In broad terms, the present invention proposes a computer-implemented method for named entity recognition (NER) configured to obtain a first dataset corresponding to a source language and a second dataset corresponding to a target language. One way of implementing this method is employing a machine learning model to generate entity representations including source language representations based on the first dataset and target language representations based on the second dataset. As it can be appreciated from the described embodiment, the method may input the entity representations into a classifier for outputting preliminary values associated with a plurality of entity classes and convert the preliminary values into predicted probability values corresponding to the plurality of entity classes. A prototype representation may be generated for each of the plurality of entity classes based on the source language representations and a similarity metric for the prototype representation and its associated entity representations may be calculated and probability values from the similarity metric may be generated. A loss metric may be computed by comparing the generated probability values and the predicted probability  values. Parameters of the machine learning model may be updated to provide an updated machine learning model based on the loss metric.

[0008] In particular embodiments, the updated machine learning model may perform a named entity recognition (NER) function by generating a label sequence comprising a plurality of labels based on an input sentence inputted into the updated machine learning model for processing, wherein the input sentence comprises a plurality of input tokens and each of the plurality of labels corresponds to one of the input tokens.

[0009] In implementations, the first dataset corresponding to the source language may include annotated training data comprising input token data and label data associated with the input token data and the parameters of the machine learning model may be updated for performing cross-lingual NER based on the annotated training data.

[0010] The second dataset corresponding to the target language may include unlabeled target language data without associated named entity class labels, the unlabeled target language data being further utilized for updating the machine learning model to adapt or learn cross-lingual representations.

[0011] In some embodiments, the second dataset corresponding to the target language may further include a subset of labeled data annotated with correct named entity classes for a plurality of input tokens, wherein the subset of labeled data may be used to test the performance of the updated machine learning model in performing cross-lingual NER tasks.

[0012] In implementations, the method may include tokenizing input data from the first dataset and unlabeled data from the second dataset into a plurality of input tokens for processing by the machine learning model, wherein the tokenization may include segmenting the input data into discrete units for analysis and processing by the machine learning model.

[0013] Generating the entity representations may include processing the tokenized input data from the first dataset and the second dataset through the machine learning model, wherein the machine learning model generates distinct entity representations for each input token corresponding to the first or second datasets.

[0014] In particular embodiments, the outputted preliminary values associated with the plurality of entity classes may be numerical values representing the relative likelihood of each entity class before being converted to the predicted probability values, said numerical values being derived from the classifier as unnormalized output values, which may be generated without the use of an activation function.

[0015] Converting the preliminary values into the predicted probability values may include applying an activation function to the product of a weight matrix and a list of the entity representations added to a bias term, thereby generating normalized output values corresponding to each input token.

[0016] In implementations, the method may include calculating a supervised loss function for the first dataset corresponding to the source language, wherein the supervised loss function is computed based on the predicted probability values corresponding to each input token and the generated label sequence comprising the plurality of labels, wherein the first dataset is further annotated with a plurality of ground-truth labels.

[0017] In some embodiments, generating the prototype representation for each of the plurality of entity classes based on the source language representations may include averaging the source language representations, such that the prototype representation represents a centroid or mean of the entity representations belonging to the same entity class in the first dataset.

[0018] Generating the prototype representation for each of the plurality of entity classes based on the source language representations may further include evaluating of at least one of the following: an indicator function, a number of input tokens belonging to a particular class in the first dataset, and label data associated with an entity class.

[0019] The prototype representation may be further updated by employing a moving average method wherein the moving average is calculated using the prototype representation for an entity class based on previous calculations and a moving average coefficient.

[0020] The similarity metric for the prototype representation and its associated entity representations may be calculated from a cosine similarity score between the prototype representation and its associated entity representations, wherein the cosine similarity score measures the alignment between the prototype representation and its associated entity representations.

[0021] In implementations, the probability values based on the similarity metric may be calculated by applying a softmax function with a temperature coefficient to the determined cosine similarity score, wherein the temperature coefficient modulates the relative weight of the cosine similarity score.

[0022] Computing the loss metric may further include computing a consistency loss function by minimizing the Jensen-Shannon divergence between the generated probability values and the predicted probability values, thereby improving the consistency between the two values.

[0023] In particular embodiments, computing the loss metric may include computing a total loss by summing the consistency loss function and the supervised loss function, wherein one or more balancing weights are applied to the consistency loss function, such that the one or more balancing weights enable adjustment of the relative contribution of the consistency loss function to the total loss for optimizing the performance of an updated machine learning model.

[0024] The parameters of the machine learning model may be updated through updating parameters of a multi-lingual word encoder and parameters of the classifier by using gradient back-propagation, such that the multi-lingual word encoder processes and transforms input tokens from the first dataset and the second dataset into the entity representations, and the classifier processes the entity representations to output the preliminary values associated with the plurality of entity classes, thereby enhancing the performance and accuracy of the updated machine learning model in performing cross-lingual named entity recognition tasks.

[0025] In some embodiments, training of the updated machine learning model may include inputting a plurality of input source languages, generating prototype representations for each source language, and computing an aggregated loss metric across the plurality of input source languages.

[0026] According to a further aspect of the invention, there is provided a system for named entity recognition (NER) , the system may include the following elements: a data storage device storing instructions for performing NER; and a processor and a memory coupled to the processor, wherein the processor executes the instructions including: obtain a first dataset corresponding to a source language; obtain a second dataset corresponding to a target language; use a machine learning model to generate entity representations including source language representations based on the first dataset and target language representations based on the second dataset; input the entity representations into a classifier for outputting preliminary values associated with a plurality of entity classes; convert the preliminary values into predicted probability values corresponding to the plurality of entity classes; generate a prototype representation for each of the plurality of entity classes based on the source language representations; calculate a similarity metric for the prototype representation and its associated entity representations; generate probability values from the similarity metric;

[0027] compute a loss metric by comparing the generated probability values and the predicted probability values; and update parameters of the machine learning model to provide an updated machine learning model based on the loss metric.

[0028] The foregoing summary is illustrative only and is not intended to be in any way limiting. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features will become apparent by reference to the drawings and the following detailed description.BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Embodiments of the invention will now be explained for the sake of example only, with reference to the following figures in which:

[0030] Figure 1 is a block diagram illustrating a protype-based representation alignment model (PRAM) , according to an embodiment the present disclosure.

[0031] Figure 2 is a flow diagram using a PRAM for processing the source language and target language datasets of Figure 1 for cross-lingual NER, according to an embodiment of the present disclosure.

[0032] Figure 3 is a flow diagram for training a PRAM with an attribution-prediction consistency (APC) constraint, according to an embodiment of the present disclosure.

[0033] Figure 4 graphically illustrates similarity distributions produced by a PRAM for processing multiple source languages, according to an embodiment of the present disclosure.

[0034] Figure 5 illustrates performance and prediction deviations of training objectives APC, Prediction Guiding, and Similarity Guiding on a WikiAnn dataset, according to an embodiment the present disclosure.

[0035] Figure 6 illustrates two-dimensional t-SNE visualizations of randomly selected samples from a source and target language, in which circles indicate tokens from the source language and triangles indicate tokens from the target language, according to an embodiment of the present disclosure.

[0036] Figure 7 is a block diagram illustrating an example computer system which can be used to perform the methods of Figures 2-3, and to implement the system of Figure 1.DETAILED DESCRIPTION

[0037] Figure 1 is a block diagram illustrating a protype-based representation alignment model (PRAM) , according to an embodiment the present disclosure. Figure 2 is a flow diagram using a PRAM for processing the source language and target language datasets of Figure 1 for cross-lingual NER, according to an embodiment of the present disclosure.

[0038] Although process or method steps may be described in a sequential order, such processes, methods and techniques may be configured to work in alternate orders. In other words, any sequence or order of steps that may be described does not necessarily indicate a requirement that the steps to be performed in that order. The steps of processes described herein may be performed in any order practical. Further, some steps may be performed simultaneously.

[0039] Referring to the steps of method 200, at step 202, the processor 722 is configured to collect parallel or comparable corpora in source and target languages. The collected source data 101 may include named entities in text which are labelled or annotated with their corresponding classes (e.g. Person, Organization, Location) . Collected target data 102 may include unlabelled data from the target language. In embodiments, the performance of the cross-lingual NER model may be further evaluated on a small labelled dataset from the target language.

[0040] In some embodiments, the pre-processing of step 202 may include a tokenization method 103 applied to both source 101 and target 102 input texts or sentences such as WordPiece, SentencePiece or other rule-based tokenization methods. In step 202, pre-processing may refer to various text cleaning and transformation techniques applied to the tokenized text to ensure a consistent and structured token input for a multi-lingual pre-trained language model (mPLM) 104. Example mPLMs 104 may include BERT, XLM, XLM-R and GPT families of models, which have been used in various NLP tasks including NER. The pre-processing in step 202 may include tasks such as lowercasing, stopword removed, stemming, or handling out-of-vocabulary (OOV) words.

[0041] In step 204, token or entity representations are determined by the mPLM 104 based on inputted tokens in source and language texts. In one embodiment, a process of feeding a chunk of text x (with a length L) into the mPLM is provided to obtain the token representations h (with  one representation hi for each token xi in the text) . The equation for this process may be formulated as: h = mPLM (x) where such that h is a list of token or entity representations for further input into a linear classifier layer 105.

[0042] In step 206, a prototype representation 109 for each entity class of the source language is obtained. In preferred embodiments, prototype representations 109 for each entity class in the source language are calculated by averaging of all the entity representations belonging to a particular class. These entity representations may be extracted from h = mPLM (x) as provided above. In implementations, the following equation describes the process of obtaining the prototype representations 109:  where: Ck represents the prototype for entity class k, nk denotes the number of tokens belonging to class k in the source language, and is an indicator function.

[0043] In one or more embodiments, the prototype representations 109 may be generated from mini-batches instead of all samples to reduce computational costs. To ensure stability during updates, the moving average method is used for updating the prototype representations 109: Ck=λ*Ck+ (1-λ) *C′k, where: Ck represents the updated prototype representation 109 for entity class k, λ is a moving average coefficient, a value between 0 and 1 and C′k denotes the prototype of class k calculated at the previous moment.

[0044] In step 208, similarity metrics 110 and similarity distributions (output from Softmax 111) between prototype representations 109 and entity representations may be computed. For each token xi, a similarity metric 110 (e.g. cosine similarity) between its representation hi and the prototype Ck of each entity class may be calculated using the following formula:  where s (hi, Ck) represents the similarity metric 110 between hi and Ck; hi is the token representation of token xi; Ck is the prototype for entity class k; and ||hi|| and ||Ck||represent the magnitudes (norms) of hi and Ck, respectively.

[0045] In implementations, the similarity distribution may be generated by applying a softmax function 111 with a temperature coefficient τ to the cosine similarity score distribution s (hi, Ck) 110. The softmax function 111 ensures that the resulting distribution sums to 1 and a temperature coefficient τ is used to control the smoothness of the distribution. The similarity distribution (output from softmax 111) may be calculated by the following formula:  where exp () is an exponential function.

[0046] In step 210, predicted probability distributions for representations predicted by the linear classifier 105 is determined. After the mPLM 104 is used to capture representations for each token in the source and target text, a linear classifier layer 105 is added on top of the mPLM token representations. In embodiments, the linear classifier layer added on top of the mPLM token representations may be formulated as: pi = softmax (Whi+b) where W is a weight matrix and b is a bias term. The softmax function 106 may be applied to the result of this linear transformation (i.e. preliminary values of each classified entity class or ‘logis’ ) to obtain the predicted probability distribution pi for each token xi.

[0047] In step 212, a consistency loss function 112 (APC loss function) , a supervision loss function 108, and a total loss function 113 are computed.

[0048] In implementations, the supervision loss function 108 may be calculated for labelled source language training data 107 with the following formula:  where N is the training data size. The source language data may be annotated with ground-truth labels in the training process. The consistency loss function 112 may be calculated as the average Jensen-Shannon divergence between the similarity distribution qi and the predicted probability distribution pi for all tokens in the dataset

[0049] where qi and pi are the two probability distributions being compared. By minimizing the Jensen-Shannon divergence between the similarity distribution and the predicted probability distribution, the APC method enforces entity-level alignment across languages in cross-lingual NER tasks, improving the model's performance.

[0050] In step 212, a total loss function L (θ) 113 of PRAM with the APC constraint may be computed by summing the consistency loss function Lc (θ) 112 (which corresponds to the enforced consistency between the similarity distribution and the predicted probability distribution) and the loss function of supervised learning The total loss may be formulated as:

[0051] where: α and β are balancing weights for the source and target languages, respectively. These weights help control the relative importance of each component in the total loss.

[0052] In implementations, the supervised learning loss term leverages the supervision signals (ground-truth labels) in the source language to learn task-specific semantics. As training progresses, the predicted probability distribution becomes more discriminative (better at distinguishing entity classes) in both source and target languages.

[0053] The Attribution-Prediction Consistency (APC) loss terms for the source and target languages respectively may impose consistency between the similarity distribution and the probability distribution. As the predicted probability distribution becomes more discriminative, the APC takes advantage of this to improve the similarity distribution.

[0054] In implementations, the similarity distribution, calculated in both source and target languages, measures the similarity between each entity representation and all prototypes, which are produced based on the source language. By enforcing consistency between the similarity distribution and the probability distribution, the APC indirectly enforces entity-level alignment between the source and target languages.

[0055] Finally, in step 214, the PRAM model may be further trained using the APC constraint, supervised learned, and the computed total loss function as will be described in greater detail below with respect to Figure 3.

[0056] Figure 3 is a flow diagram for training a PRAM with an attribution-prediction consistency (APC) constraint, according to an embodiment of the present disclosure.

[0057] Algorithm 1 (below) provides a pseudocode for a training process of PRAM of an embodiment method.

[0058] In preferred embodiments, inputs to the training process include labelled training data in the source language and unlabelled data in the target language The training data in the source language includes pairs of input samples (x) and their corresponding ground truth labels (y) in the source language.

[0059] In step 302, the parameters of the multi-lingual word encoder (θenc) and the classifier (θcls) are initialized and an iteration counter (iter) is set to 0.

[0060] In step 304, a training loop is provided while the iteration counter (iter) is less than the maximum number of training steps (Tsteps) for executing the following steps:

[0061] a.Sample a mini-batch (B) of data, which includes both labeled data in the source language (x, y) from and unlabeled data in the target language (x) from

[0062] b.Perform a forward pass: For each sample in the mini-batch (B) , compute the list of token representations (hi) for each token (xi) in the sample using a word encoder with parameters θenc. Then calculate the prediction probability distribution (pi) for each token (xi) using the classifier with parameters θcls.

[0063] c.Perform supervised learning: Calculate the supervised loss for the labeled training data in the source language using the predicted probability distributions (pi) for each token xi.

[0064] In step 306, Attribution-Prediction Consistency (APC) is implemented by generating class prototypes (C) using the token representations (hi) . Additionally, in certain embodiments the  similarity distribution (qi) between the token representations (hi) and the class prototypes for each sample in the mini-batch B may be calculated.

[0065] In step 308, a source consistency loss is computed and a target consistency loss is computed based on the similarity distribution (qi) and the predicted probability distribution (pi) . A total loss (L) for the current iteration is generated by combining the supervised loss, source consistency loss, and target consistency loss.

[0066] In step 310, Backpropagation is implemented by update the parameters of the multi-lingual word encoder (θenc) and the classifier (θcls) using the gradients computed from the total loss (L) .

[0067] In step 312, the iteration counter (iter) is further incremented. In the embodiment provided, the training process continues until the maximum number of training steps (Tsteps) is reached.

[0068] Figure 4 graphically illustrates similarity distributions produced by a PRAM for processing multiple source languages, according to an embodiment of the present disclosure.

[0069] In one or more embodiments, the Prototype-based Representation Alignment Model (PRAM) can be easily adapted to accommodate multiple source languages in a multisource scenario. Given n source languages, n sets of prototypes may be created, i.e. one prototype set for each source language may be created with respect to the determination of a prototype representation and its corresponding update as described above.

[0070] In certain embodiments, for each sample in the source languages, its similarity distribution may be calculated based on the prototypes of the corresponding language. Conversely, for each sample in the target languages, n similarity distributions may be computed according to the different prototype sets of the various source languages. Figure 4 provides a visual illustration of a process for deriving similarity distributions in a multi-source setting, the distributions produced from multi-source cross-lingual transfer, according to an embodiment of the present invention.

[0071] The total loss for training PRAM can be reformulated (based on the total loss for one source language) as where represents the consistency loss of the i-th source language, and denotes the consistency loss of samples in the target language with respect to the prototypes in the i-th source language.

[0072] Experimental Results

[0073] We now turn to the description of various experiments used to evaluate embodiments of the disclosure. Some of these illustrate embodiments of the disclosure other than those discussed above.

[0074] Experiments were conducted on a PRAM model in both single-source and multi-source transfer settings and compared with other state-of-the art models. Moreover, an ablation study and several analytical experiments were conducted to demonstrate the effectiveness of our model.

[0075] It should be emphasized that the experiments and outcomes presented herein serve as exemplary illustrations and were conducted under particular conditions employing one or more specific embodiments. Consequently, neither the described experiments nor their findings should be construed as restricting the breadth of the disclosure encompassed by the present patent document.

[0076] Datasets and Experiment Settings

[0077] There were three benchmark datasets included in the experiments, which were CoNLL-2002 (Erik F. Tjong Kim Sang. 2002. Introduction to the CoNLL-2002 shared task: Language-independent named entity recognition. In COLING-02: The 6th Conference on Natural Language Learning 2002) , CoNLL-2003 (Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142–147. ) and WikiAnn (Xiaoman Pan, Boliang Zhang, Jonathan May, Joel Nothman, Kevin Knight, and Heng Ji. 2017. Cross-lingual name tagging and linking for 282 languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 1946–1958, Vancouver, Canada. Association for Computational Linguistics. ) . All datasets were labeled using the BIO scheme with four entity types, which are persons (PER) , locations (LOC) , organizations (ORG) , and miscellaneous (MISC) . Each dataset underwent division into training, validation, and evaluation sets in a manner consistent with their original publication. The dataset statistics are listed below in Table 1:

[0078] Table 1: Statistics of the datasets

[0079] In the single-source transfer, English was treated as the source language and the others as the target languages for both CoNLL-2002 / 2003 and WikiAnn. In the multi-source transfer, a previous selection process (Qianhui Wu, Zijia Lin, Borje Karlsson, Jian-Guang Lou, and Biqing Huang. 2020a. Single- / multi-source cross-lingual NER via teacher-student learning on unlabeled data in target language. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6505–6514, Online. Association for Computational Linguistics, hereafter Wu et al., 2020a) which selects source languages in a leave-one-out manner, which means all languages are treated as source ones except for the target one was followed. For the target language in both settings, the “train set” removed labels were selected  as the unlabeled target data in the training process. The entity-level micro-F1 score was used as the evaluation metric.

[0080] Implementation Details

[0081] The experiments were carried out using PyTorch 1.11.0. Initialization of the cross-lingual encoder involved the parameters of the cased M-BERTbase, released by HuggingFace Transformers (https:  / / github. com / huggingface / transformers) . Based on prior research (Qianhui Wu, Zijia Lin, Guoxin Wang, Hui Chen, Borje F Karlsson, Biqing Huang, and Chin-Yew Lin. 2020b. Enhanced meta-learning for cross-lingual named entity recognition with minimal resources. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9274–9281. ) , the embedding layer parameters and the bottom three layers of M-BERT remained unchanged. Only the first subword in the loss function was considered if a word was tokenized into multiple subwords by word piece. To prevent negative impacts on cross-lingual transfer performance due to excessive non-entity presence, a non-entity down-sampling strategy (Yangming Li, LEMAO Liu, and Shuming Shi. 2021. Empirical Analysis of Unlabeled Entity Problem in Named Entity Recognition. In International Conference on Learning Representations. ) was employed as detailed in Appendix A, with the balancing rate γ set at {1.0, 2.0, 3.0} for various cases. The AdamW optimizer was utilized, featuring a learning rate of 1e-5 and a batch size of 128 for training. The maximum sequence length was set to 128. Early stopping strategies were employed for all methods, with the maximum training step capped at 20000. Grid search techniques were used for other hyper-parameters to determine the optimal ones, including the temperature coefficient τ chosen from 0.15 to 0.25, the moving average coefficient λ ranging from 0.5 to 0.9, and the loss weights α and β selected from 0.5 to 4.0.

[0082] Performance Comparison

[0083] The proposed method is compared with the following: (1) data transfer-based methods, including TMP (Alankar Jain, Bhargavi Paranjape, and Zachary C. Lipton. 2019. Entity Projection via Machine Translation for Cross-Lingual NER. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) , pages 1083–1092, Hong Kong, China. Association for Computational Linguistics. ) , TSL (Wu et al., 2020a) , Unitrans (Qianhui Wu, Zijia Lin,  F. Karlsson, Biqing Huang, and Jian-Guang Lou. (2021) . Unitrans: Unifying model transfer and data transfer for cross-lingual named entity recognition with unlabeled data. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI’20, pages 3926–3932. ) , AdvPicker (Weile Chen, Huiqiang Jiang, Qianhui Wu,  Karlsson, and Yi Guan. (2021) . AdvPicker: Effectively Leveraging Unlabeled Data via Adversarial Discriminator for Cross-Lingual NER. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers) , pages 743–753, Online. Association for Computational Linguistics. ) , RIKD (Shining Liang, Ming Gong, Jian Pei, Linjun Shou, Wanli Zuo, Xianglin Zuo, and Daxin Jiang. (2021) . Reinforced iterative knowledge distillation for cross-lingual named entity recognition. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 3231–3239. ) , and MTMT (Zhuoran Li, Chunming Hu, Xiaohui Guo, Junfan Chen, Wenyi Qin, and Richong Zhang. (2022) . An unsupervised multiple-task and multiple-teacher model for cross-lingual named entity recognition. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 170–179, Dublin, Ireland. Association for Computational Linguistics. ) ; and (2) representation transfer-based methods, such as BERT-f (Shijie Wu and Mark Dredze. (2019) . Beto, bentz, becas: The surprising cross-lingual effectiveness of BERT. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) , pages 833–844, Hong Kong, China. Association for Computational Linguistics. ) , AdvCE (Phillip Keung, Yichao Lu, and Vikas Bhardwaj. (2019) . Adversarial  learning with contextual embeddings for zero-resource cross-lingual classification and NER. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) , pages 1355–1360, Hong Kong, China. Association for Computational Linguistics. ) , and BERT-RA (Saurabh Kulshreshtha, Jose Luis Redondo Garcia, and Ching-Yun Chang. (2020) . Cross-lingual alignment methods for multilingual BERT: A comparative study. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 933–942, Online. Association for Computational Linguistics. )

[0084] The proposed method is compared with the following state-of-the-art approaches, including data transfer-based methods and representation transfer-based methods:

[0085] TMP (Jain et al., 2019) : This method proposes a system that improves entity-projection annotation by leveraging machine translation.

[0086] BERT-f (Wu and Dredze, 2019) : This approach fine-tunes the multi-lingual BERT in the source language and directly performs prediction in the target languages.

[0087] AdvCE (Keung et al., 2019) : This method introduces language-adversarial training on the contextual representations for cross-lingual NER.

[0088] BERT-RA (Kulshreshtha et al., 2020) : This approach utilizes parallel corpora to supervise the rotation alignment of representations across different languages.

[0089] TSL (Wu et al., 2020a) : This method proposes teacher-student learning to transfer task-specific knowledge from the source to the target language.

[0090] Unitrans (Wu et al., 2021) : This approach devises a pipeline to unify both model and data transfer for Zero-Resource Cross-Lingual NER (ZRCL-NER) .

[0091] AdvPicker (Chen et al., 2021) : This method designs an adversarial learning framework to select less language-dependent data in the target language to improve ZRCL-NER performance.

[0092] RIKD (Liang et al., 2021) : This approach proposes a cross-lingual NER method combining knowledge distillation and reinforcement learning.

[0093] MTMT (Li et al., 2022) : This method introduces a similarity metric model based on knowledge distillation and multi-task learning for cross-lingual NER.

[0094] Single-source transfer

[0095] As demonstrated in Tables 2 and 3 below, PRAM notably outperforms previous state-of-the-art approaches in most cases. Specifically, on the CoNLL-2002 / 2003 dataset (Table 2) , PRAM achieves the best performance on German and Spanish and the second-best on Dutch. In comparison with the previous state-of-the-art, PRAM improves the F1 score by an average of 0.27%. On the WikiAnn dataset (Table 3) , PRAM surpasses the previous state-of-the-art by a considerable margin, with average F1-score improvements of 3.92%compared to MTMT (ranging from 3.20%for Chinese to 4.67%for Arabic) . It can be observed that PRAM achieves a more significant boost on the WikiAnn dataset, where the source (English) and the target languages (Arabic, Hindi, and Chinese) belong to distinct language families. The vast difference between the source and target languages considerably limits the transfer ability of previous methods, but PRAM still performs well in such challenging settings. Furthermore, compared with the latest models, MTMT, RIKD, and AdvPicker, the proposed method performs end-to-end, saving computational costs for training teacher models.

[0096] Multi-source Transfer

[0097] In line with previous work (Wu et al., 2020a) , the CoNLL-2002 / 2003 dataset considers German, Spanish, and Dutch as target languages. As demonstrated in Table 4 below, PRAM achieves significant and consistent improvements on all three target languages. Specifically, PRAM improves the F1 score by 4.61%on average compared to BERT-f and 3.88%compared to TSL-avg (TSL with averaging teacher models) (Wu et al., 2020a) . Furthermore, compared to the single-source setting, the cross-lingual performance of PRAM in the multi-source setting consistently improves due to aligning target representations with the prototypes of multiple source languages.

[0098] Table 4: F1 Scores (%) on the CoNLL dataset in the multi-source setting. We bold the best performance.

[0099] To examine the contributions of different modules in PRAM, ablation experiments are conducted with three variants: 1) PRAMw / o S-C removes the APC on the source language; 2) PRAMw / o T-C removes the APC on the target language; 3) PRAMw / o C does not use any consistency strategy. As displayed in Table 5 below, the performance of the three variants significantly decreases. Compared to PRAMw / o S-C, PRAMw / o T-C experiences a more significant drop in the F1 scores. This suggests that the APC on the target language is more critical for enhancing the cross-lingual transfer ability because it assists in aligning the target representations with the prototypes generated in the source language. Without the APC constraints, the average F1 score of PRAMw / o C declines by 6.49%on CoNLL and 7.80%on WikiAnn compared to PRAM due to the absence of explicit representation optimization.

[0100] Table 5: Ablation Study

[0101] Effectiveness of Attribution-Prediction Consistency

[0102] To evaluate the effectiveness of the APC, experiments are conducted with two variants of this training objective: Prediction Guiding (PG) employs the predicted probability distributions to supervise the similarity distributions, stopping gradient backpropagation from the prediction path. On the other hand, Similarity Guiding (SG) prevents gradient backpropagation from the similarity-metric path.

[0103] Figure 5 illustrates the performance (F1 score, bar charts) and prediction deviations (MSE score, line charts) of various training objectives APC, Prediction Guiding, and Similarity Guiding on a WikiAnn dataset. As shown by chart 500, the performance of the two variants exhibits a significant drop compared to the APC. The performance degradation of SG is more pronounced than that of PG, suggesting that the guidance from the predictions to the representation distributions plays a more crucial role. The prediction deviation of the model with different strategies is also reported, which is defined as the mean square error between the predicted probability distributions and the one-hot labels: e = 1 / n *Σ (yi-pi) 2. The APC achieves a lower prediction deviation than PG, illustrating that the APC effectively improves model performance through the combined effect of aligning cross-lingual representations and using alignment properties to revise prediction deviation.

[0104] Representation Visualization

[0105] To show that PRAM can align similar entity representations across languages, 150 samples per class are randomly selected from the source and the target languages, and t-SNE (Laurens Van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-SNE. Journal of Machine Learning Research, 9 (11) . ) is employed to project their representations encoded by mPLM into a two-dimensional space.

[0106] Figure 6 illustrates two-dimensional t-SNE visualizations of randomly selected samples from a source and target language, in which circles indicate tokens from the source language and triangles indicate tokens from the target language, according to an embodiment of the present disclosure.

[0107] As depicted by the visualizations 600 in Figure 6, PRAM results in a greater alignment of similar representations across languages compared to the baseline, that is, the basic cross-lingual NER model. When there is a significant difference between the source and the target language (from English to Arabic) , many target representations from the baseline are mixed together and distributed differently from the similar source representations, which obstructs the cross-lingual transfer. In contrast, PRAM considerably enhances the representation alignment across languages, particularly in those classes where the baseline faces difficulties (B-ORG, I-ORG, I-LOC, etc. ) . When the target language is similar to the source language (from English to German) , PRAM can further optimize and align similar representations compared to the baseline, making the entities belonging to the same class more clustered.

[0108] Effect on the Source Language

[0109] To examine the effect of cross-lingual transfer on the source language, the performance of PRAM on the source language is further evaluated in the single-source transfer setting. Table 6 below shows that PRAM can also enhance the performance on the source language (en) for both CoNLL and WikiAnn. This indicates that PRAM is effective on both the source and target languages with only end-to-end training.

[0110] Table 6: F1 Scores (%) on the test set of the source language in the single-source settings.

[0111] Some Conclusions

[0112] A novel and effective prototype-based representation alignment model (PRAM) is proposed for Zero-Resource Cross-Lingual Named Entity Recognition (ZRCL-NER) . A new training objective called Alignment Property Constraint (APC) is introduced to work in conjunction with the cross-lingual inference ability of multilingual Pre-trained Language Models (mPLM) . This approach enhances the alignment of entity representations and predictions, as well as the representations of similar entities across languages. Experimental results demonstrate that PRAM achieves outstanding performance in both single-source and multi-source transfer settings. Furthermore, the training of PRAM is performed end-to-end and only requires additional unlabeled target data.

[0113] Figure 7 is a block diagram showing the technical architecture 700 of a server which can perform some or all of the methods of Figures 2-3. The technical architecture includes a processor 722 (which may be referred to as a central processor unit or CPU) that is in communication with memory devices including secondary storage 724 (such as disk drives) , read only memory (ROM) 726, random access memory (RAM) 728. The processor 722 may be implemented as one or more CPU chips. The technical architecture may further comprise input / output (I / O) devices 730, and network connectivity devices 732. The secondary storage 724 is typically comprised of one or more disk drives or tape drives and is used for non-volatile storage of data and as an over-flow data storage device if RAM 728 is not large enough to hold all working data. Secondary storage 724 may be used to store programs which are loaded into RAM 728 when such programs are selected for execution.

[0114] In this embodiment, the secondary storage 724 has an order processing component 724a comprising non-transitory instructions operative by the processor 722 to perform various operations of the method of the present disclosure. The ROM 726 is used to store instructions and perhaps data which are read during program execution. The secondary storage 724, the RAM 728, and / or the ROM 726 may be referred to in some contexts as computer readable storage media and / or non-transitory computer readable media.

[0115] I / O devices 730 may include printers, video monitors, liquid crystal displays (LCDs) , plasma displays, touch screen displays, keyboards, keypads, switches, dials, mice, track balls, voice recognizers, card readers, paper tape readers, or other well-known input devices.

[0116] The processor 722 executes instructions, codes, computer programs, scripts which it accesses from hard disk, floppy disk, optical disk (these various disk-based systems may all be considered secondary storage 724) , flash drive, ROM 726, RAM 728, or the network connectivity devices 732. While only one processor 722 is shown, multiple processors may be present. Thus, while instructions may be discussed as executed by a processor, the instructions may be executed simultaneously, serially, or otherwise executed by one or multiple processors.

[0117] In the technical architecture 700, a graphics processing unit (GPU) 734 can be included to enhance processing capabilities. The GPU 734 is a specialized electronic circuit designed for rendering images, animations, and video, and is highly efficient at parallel processing tasks. This makes them well-suited for various machine learning and artificial intelligence related operations. The GPU 734 communicates with the processor 722, secondary storage 724, ROM 726, RAM 728, I / O devices 730, and network connectivity devices 732. It can be integrated within the processor 722 as an integrated GPU (iGPU) or as a separate, dedicated GPU connected through a high-speed interface. Inclusion of the GPU 734 allows for more efficient processing of tasks that benefit from parallelism, leading to increased system performance, especially in applications optimized for GPU-based processing. The GPU 734 can also offload tasks from the CPU 722, improving overall system efficiency. By incorporating the GPU 734 into the technical architecture, the system can be transformed into a specific purpose machine with enhanced processing capabilities for parallel tasks, as taught by the present disclosure.

[0118] Although the technical architecture is described with reference to a computer, it should be appreciated that the technical architecture may be formed by two or more computers in  communication with each other that collaborate to perform a task. For example, but not by way of limitation, an application may be partitioned in such a way as to permit concurrent and / or parallel processing of the instructions of the application. Alternatively, the data processed by the application may be partitioned in such a way as to permit concurrent and / or parallel processing of different portions of a data set by the two or more computers. In an embodiment, virtualization software may be employed by the technical architecture 700 to provide the functionality of a number of servers that is not directly bound to the number of computers in the technical architecture 700. In an embodiment, the functionality disclosed above may be provided by executing the application and / or applications in a cloud computing environment. Cloud computing may comprise providing computing services via a network connection using dynamically scalable computing resources. A cloud computing environment may be established by an enterprise and / or may be hired on an as-needed basis from a third-party provider.

[0119] By programming and / or loading executable instructions onto the technical architecture, at least one of the CPU 722, the RAM 728, and the ROM 726 are changed, transforming the technical architecture in part into a specific purpose machine or apparatus having the novel functionality taught by the present disclosure. It is fundamental to the electrical engineering and software engineering arts that functionality that can be implemented by loading executable software into a computer can be converted to a hardware implementation by well-known design rules.

[0120] It will be appreciated to those skilled in the art that the preceding examples and embodiments are exemplary and not limiting to the scope of the present disclosure. Whilst the foregoing description has described exemplary embodiments, it will be understood by those skilled in the art that many variations of the embodiment can be made within the scope and spirit of the present invention. It shall be noted that elements of any claims may be arranged differently including have multiple dependencies, configurations and combinations.

Claims

1.A computer-implemented method for named entity recognition (NER) , the method comprising:obtaining a first dataset corresponding to a source language;obtaining a second dataset corresponding to a target language;employing a machine learning model to generate a list of entity representations including source language representations based on the first dataset and target language representations based on the second dataset;inputting the entity representations into a classifier for outputting preliminary values associated with a plurality of entity classes;converting the preliminary values into predicted probability values corresponding to the plurality of entity classes;generating a prototype representation for each of the plurality of entity classes based on the source language representations;calculating a similarity metric for the prototype representation and its associated entity representations;generating probability values from the similarity metric;computing a loss metric by comparing the generated probability values and the predicted probability values; andupdating parameters of the machine learning model to provide an updated machine learning model based on the loss metric.2.The method of claim 1, wherein the updated machine learning model performs a named entity recognition (NER) function by generating a label sequence comprising a plurality of labels based on an input sentence inputted into the updated machine learning model for processing, wherein the input sentence comprises a plurality of input tokens and each of the plurality of labels corresponds to one of the input tokens.3.The method of claim 1, wherein the first dataset corresponding to the source language includes annotated training data comprising input token data and label data associated with the input token data and the parameters of the machine learning model are updated for performing cross-lingual NER based on the annotated training data.4.The method of claim 1, wherein the second dataset corresponding to the target language includes unlabeled target language data without associated named entity class labels, the unlabeled target language data being further utilized for updating the machine learning model to adapt or learn cross-lingual representations.5.The method of claim 1, wherein the second dataset corresponding to the target language further includes a subset of labeled data annotated with correct named entity classes for a plurality of input tokens, wherein the subset of labeled data is used to test a performance of the updated machine learning model in performing cross-lingual NER tasks.6.The method of claim 1, further comprising: tokenizing input data from the first dataset and unlabeled data from the second dataset into a plurality of input tokens for processing by the machine learning model, wherein the tokenization includes segmenting the input data into discrete units for analysis and processing by the machine learning model.7.The method of claim 1, wherein generating the entity representations comprises: processing the tokenized input data from the first dataset and the second dataset through the  machine learning model, wherein the machine learning model generates distinct entity representations for each input token corresponding to the first or second datasets.8.The method of claim 1, wherein the outputted preliminary values associated with the plurality of entity classes are numerical values representing the relative likelihood of each entity class before being converted to the predicted probability values, said numerical values being derived from the classifier as unnormalized output values, which are generated without the use of an activation function.9.The method of claim 1, wherein converting the preliminary values into the predicted probability values comprises applying an activation function to the product of a weight matrix and the list of the entity representations added to a bias term, thereby generating normalized output values corresponding to each input token.10.The method of claim 1, further comprising: calculating a supervised loss function for the first dataset corresponding to the source language, wherein the supervised loss function is computed based on the predicted probability values corresponding to each input token and the generated label sequence comprising the plurality of labels, wherein the first dataset is further annotated with a plurality of ground-truth labels.11.The method of claim 1, wherein generating the prototype representation for each of the plurality of entity classes based on the source language representations comprises averaging the source language representations, such that the prototype representation represents a centroid or mean of the entity representations belonging to the same entity class in the first dataset.12.The method of claim 1, wherein generating the prototype representation for each of the plurality of entity classes based on the source language representations further comprises evaluating of at least one of the following: an indicator function, a number of input tokens belonging to a particular class in the first dataset, and label data associated with an entity class.13.The method of claim 1, wherein updating the prototype representation comprises employing a moving average method wherein the moving average is calculated using the prototype representation for an entity class based on previous calculations and a moving average coefficient.14.The method of claim 1, wherein calculating the similarity metric for the prototype representation and its associated entity representations comprises calculating a cosine similarity score between the prototype representation and its associated entity representations, wherein the cosine similarity score measures the alignment between the prototype representation and its associated entity representations.15.The method of claim 14, wherein generating the probability values based on the similarity metric further comprises applying a softmax function with a temperature coefficient to the determined cosine similarity score, wherein the temperature coefficient modulates the relative weight of the cosine similarity score.16.The method of claim 1, wherein computing the loss metric further comprises computing a consistency loss function by minimizing the Jensen-Shannon divergence between the generated probability values and the predicted probability values, thereby improving the consistency between the two values.17.The method of claim 1, wherein computing the loss metric further comprises computing a total loss by summing the consistency loss function and the supervised loss function, wherein one or more balancing weights are applied to the consistency loss function, such that the one or more balancing weights enable adjustment of the relative contribution of the consistency loss function to the total loss for optimizing a performance of an updated machine learning model.18.The method of of claim 1, wherein updating parameters of the machine learning model further comprises updating parameters of a multi-lingual word encoder and parameters of the classifier by using gradient back-propagation, such that the multi-lingual word encoder processes and transforms input tokens from the first dataset and the second dataset into the entity representations, and the classifier processes the entity representations to output the preliminary values associated with the plurality of entity classes, thereby enhancing a performance and accuracy of the updated machine learning model in performing cross-lingual named entity recognition tasks.19.The method of claim 1, wherein training the updated machine learning model comprises inputting a plurality of input source languages, generating prototype representations for each source language, and computing an aggregated loss metric across the plurality of input source languages.20.A system for named entity recognition (NER) , the system comprising:a data storage device storing instructions for performing NER; anda processor and a memory coupled to the processor, wherein the processor executes the instructions including:obtain a first dataset corresponding to a source language;obtain a second dataset corresponding to a target language;use a machine learning model to generate entity representations including source language representations based on the first dataset and target language representations based on the second dataset;input the entity representations into a classifier for outputting preliminary values associated with a plurality of entity classes;convert the preliminary values into predicted probability values corresponding to the plurality of entity classes;generate a prototype representation for each of the plurality of entity classes based on the source language representations;calculate a similarity metric for the prototype representation and its associated entity representations;generate probability values from the similarity metric;compute a loss metric by comparing the generated probability values and the predicted probability values; andupdate parameters of the machine learning model to provide an updated machine learning model based on the loss metric.