This model has been trained on the EntityCS corpus, an English corpus from Wikipedia with replaced entities in different languages.
The corpus can be found in
https://huggingface.co/huawei-noah/entity_cs
, check the link for more details.
To train models on the corpus, we first employ the conventional 80-10-10 MLM objective, where 15% of sentence subwords are considered as masking candidates. From those, we replace subwords
with [MASK] 80% of the time, with Random subwords (from the entire vocabulary) 10% of the time, and leave the remaining 10% unchanged (Same).
To integrate entity-level cross-lingual knowledge into the model, we propose Entity Prediction objectives, where we only mask subwords belonging
to an entity. By predicting the masked entities in EntityCS sentences, we expect the model to capture the semantics of the same entity in different
languages.
Two different masking strategies are proposed for predicting entities: Whole Entity Prediction (
WEP
) and Partial Entity Prediction (
PEP
).
In WEP, motivated by
Sun et al. (2019)
where whole word masking is also adopted, we consider all the words (and consequently subwords) inside
an entity as masking candidates. Then, 80% of the time we mask every subword inside an entity, and
20% of the time we keep the subwords intact. Note that, as our goal is to predict the entire masked
entity, we do not allow replacing with Random subwords, since it can introduce noise and result
in the model predicting incorrect entities. After entities are masked, we remove the entity indicators
<e>
,
</e>
from the sentences before feeding them to the model.
For PEP, we also consider all entities as masking candidates. In contrast to WEP, we do not force
subwords belonging to one entity to be either all masked or all unmasked. Instead, each individual
entity subword is masked 80% of the time. For the remaining 20% of the masking candidates, we experiment with three different replacements. First,
PEP
MRS
, corresponds to the conventional 80-10-10 masking strategy, where 10% of the remaining
subwords are replaced with Random subwords and the other 10% are kept unchanged. In the second
setting, PEP
MS
, we remove the 10% Random subwords substitution, i.e. we predict the 80% masked
subwords and 10% Same subwords from the masking candidates. In the third setting, PEP
M
, we
further remove the 10% Same subwords prediction, essentially predicting only the masked subwords.
Prior work has proven it is effective to combine Entity Prediction with MLM for cross-lingual transfer (
Jiang et al., 2020
), therefore we investigate the
combination of the Entity Prediction objectives together with MLM on non-entity subwords. Specifically, when combined with MLM, we lower the
entity masking probability (p) to 50% to roughly keep the same overall masking percentage.
This results into the following objectives: WEP + MLM, PEP
MRS
+ MLM, PEP
MS
+ MLM, PEP
M
+ MLM
This model was trained with the
MLM
objective on the EntityCS corpus with 39 languages.
Training Details
We start from the
XLM-R-base
model and train for 1 epoch on 8 Nvidia V100 32GB GPUs.
We set batch size to 16 and gradient accumulation steps to 2, resulting in an effective batch size of 256.
For speedup we use fp16 mixed precision.
We use the sampling strategy proposed by
Conneau and Lample (2019)
, where high resource languages are down-sampled and low
resource languages get sampled more frequently.
We only train the embedding and the last two layers of the model.
We randomly choose 100 sentences from each language to serve as a validation set, on which we measure the perplexity every 10K training steps.
This checkpoint corresponds to the one with the lower perplexity on the validation set.
Usage
The current model can be used for further fine-tuning on downstream tasks.
In the paper, we focused on entity-related tasks, such as NER, Word Sense Disambiguation and Slot Filling.
Alternatively, it can be used directly (no fine-tuning) for probing tasks, i.e. predict missing words, such as
X-FACTR
.
For results on each downstream task, please refer to the
paper
.
@inproceedings{whitehouse-etal-2022-entitycs,
title = "{E}ntity{CS}: Improving Zero-Shot Cross-lingual Transfer with Entity-Centric Code Switching",
author = "Whitehouse, Chenxi and
Christopoulou, Fenia and
Iacobacci, Ignacio",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2022",
month = dec,
year = "2022",
address = "Abu Dhabi, United Arab Emirates",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.findings-emnlp.499",
pages = "6698--6714"
}
APA
Whitehouse, C., Christopoulou, F., & Iacobacci, I. (2022). EntityCS: Improving Zero-Shot Cross-lingual Transfer with Entity-Centric Code Switching. In Findings of the Association for Computational Linguistics: EMNLP 2022.
Runs of huawei-noah EntityCS-39-MLM-xlmr-base on huggingface.co
17
Total runs
0
24-hour runs
1
3-day runs
5
7-day runs
10
30-day runs
More Information About EntityCS-39-MLM-xlmr-base huggingface.co Model
More EntityCS-39-MLM-xlmr-base license Visit here:
EntityCS-39-MLM-xlmr-base huggingface.co is an AI model on huggingface.co that provides EntityCS-39-MLM-xlmr-base's model effect (), which can be used instantly with this huawei-noah EntityCS-39-MLM-xlmr-base model. huggingface.co supports a free trial of the EntityCS-39-MLM-xlmr-base model, and also provides paid use of the EntityCS-39-MLM-xlmr-base. Support call EntityCS-39-MLM-xlmr-base model through api, including Node.js, Python, http.
EntityCS-39-MLM-xlmr-base huggingface.co is an online trial and call api platform, which integrates EntityCS-39-MLM-xlmr-base's modeling effects, including api services, and provides a free online trial of EntityCS-39-MLM-xlmr-base, you can try EntityCS-39-MLM-xlmr-base online for free by clicking the link below.
huawei-noah EntityCS-39-MLM-xlmr-base online free url in huggingface.co:
EntityCS-39-MLM-xlmr-base is an open source model from GitHub that offers a free installation service, and any user can find EntityCS-39-MLM-xlmr-base on GitHub to install. At the same time, huggingface.co provides the effect of EntityCS-39-MLM-xlmr-base install, users can directly use EntityCS-39-MLM-xlmr-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
EntityCS-39-MLM-xlmr-base install url in huggingface.co: