Accurate alignment between languages is fundamental for improving cross-lingual pre-trained language models (XLMs). Motivated by the natural phenomenon of code-switching (CS) in multilingual speakers, CS has been used as an effective data augmentation method that offers language alignment at the word- or phrase-level, in contrast to sentence-level via parallel instances. Existing approaches either use dictionaries or parallel sentences with word alignment to generate CS data by randomly switching words in a sentence. However, such methods can be suboptimal as dictionaries disregard semantics, and syntax might become invalid after random word switching. In this work, we propose EntityCS, a method that focuses on Entity-level Code-Switching to capture fine-grained cross-lingual semantics without corrupting syntax. We use Wikidata and English Wikipedia to construct an entity-centric CS corpus by switching entities to their counterparts in other languages. We further propose entity-oriented masking strategies during intermediate model training on the EntityCS corpus for improving entity prediction. Evaluation of the trained models on four entity-centric downstream tasks shows consistent improvements over the baseline with a notable increase of 10% in Fact Retrieval. We release the corpus and models to assist research on code-switching and enriching XLMs with external knowledge.
翻译:准确的语言对齐是改进跨语言预训练语言模型(XLMs)的基础。多语言使用者中普遍存在的代码转换(CS)自然现象启发研究者将其用作有效的数据增强方法,与通过平行实例实现句子级对齐不同,CS可在词级或短语级提供语言对齐。现有方法或使用词典、或采用带词对齐的平行句生成CS数据,通过随机替换句子中的词汇实现。然而此类方法可能并非最优,因为词典忽略了语义,而随机词汇替换可能导致句法失效。本文提出EntityCS方法,专注于实体级代码转换(Entity-level Code-Switching),在不破坏句法的前提下捕捉细粒度跨语言语义。我们利用Wikidata和英文维基百科构建以实体为中心的CS语料库,通过将实体替换为其其他语言对应项实现转换。进一步提出面向实体的掩码策略,在EntityCS语料库上进行中间模型训练以改进实体预测。在四个面向实体的下游任务上对训练模型进行评估,结果显示相比基线方法获得持续改进,其中事实检索任务提升达10%。我们公开语料库与模型,以辅助代码转换研究并丰富XLMs的外部知识。