模型:
facebook/xlm-v-base
XLM-V是一个多语言语言模型,使用了100多种语言的100万个令牌词汇表,并在来自Common Crawl的2.5TB数据集上进行训练(与XLM-R相同)。它是由Davis Liang、Hila Gonen、Yuning Mao、Rui Hou、Naman Goyal、Marjan Ghazvininejad、Luke Zettlemoyer和Madian Khabsa在 XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models 论文中提出的。
免责声明:发布XLM-V的团队没有为该模型编写模型卡片,所以此模型卡片是由Hugging Face团队撰写的。 This repository 文档中记录了所有必要的集成步骤。
根据XLM-V论文的摘要:
大型多语言语言模型通常依赖于在100多种语言之间共享的单一词汇表。随着这些模型的参数数量和深度的增加,词汇表大小基本保持不变。这种词汇瓶颈限制了类似XLM-R的多语言模型的表示能力。在本文中,我们通过减少具有很少词汇重叠的语言之间的令牌共享,并分配词汇容量以实现每种语言的足够覆盖来扩展非常大的多语言词汇表。使用我们的词汇表进行标记化通常意味着更具语义意义且更短的词汇,相比之下,与XLM-R相比,我们利用这个改进的词汇表训练了XLM-V,它是一个具有100万个令牌词汇表的多语言语言模型。XLM-V在我们测试的每个任务中的表现都优于XLM-R,这些任务涵盖了自然语言推理(XNLI)、问答(MLQA、XQuAD、TyDiQA)和命名实体识别(WikiAnn),以及低资源任务(Americas NLI、MasakhaNER)。
您可以直接使用此模型进行遮蔽语言建模的管道。
>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='facebook/xlm-v-base')
>>> unmasker("Paris is the <mask> of France.")
[{'score': 0.9286897778511047,
'token': 133852,
'token_str': 'capital',
'sequence': 'Paris is the capital of France.'},
{'score': 0.018073994666337967,
'token': 46562,
'token_str': 'Capital',
'sequence': 'Paris is the Capital of France.'},
{'score': 0.013238662853837013,
'token': 8696,
'token_str': 'centre',
'sequence': 'Paris is the centre of France.'},
{'score': 0.010450296103954315,
'token': 550136,
'token_str': 'heart',
'sequence': 'Paris is the heart of France.'},
{'score': 0.005028395913541317,
'token': 60041,
'token_str': 'center',
'sequence': 'Paris is the center of France.'}]
请参考 XLM-R 的模型卡片,因为XLM-V具有类似的架构,并且是基于类似的训练数据进行训练的。
@ARTICLE{2023arXiv230110472L,
author = {{Liang}, Davis and {Gonen}, Hila and {Mao}, Yuning and {Hou}, Rui and {Goyal}, Naman and {Ghazvininejad}, Marjan and {Zettlemoyer}, Luke and {Khabsa}, Madian},
title = "{XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Models}",
journal = {arXiv e-prints},
keywords = {Computer Science - Computation and Language, Computer Science - Machine Learning},
year = 2023,
month = jan,
eid = {arXiv:2301.10472},
pages = {arXiv:2301.10472},
doi = {10.48550/arXiv.2301.10472},
archivePrefix = {arXiv},
eprint = {2301.10472},
primaryClass = {cs.CL},
adsurl = {https://ui.adsabs.harvard.edu/abs/2023arXiv230110472L},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}