模型简介
模型特点
模型能力
使用案例
🚀 TAPAS基础模型在序列问答(SQA)上的微调版本
本模型有两个可用版本。默认版本对应于原始GitHub仓库中的 tapas_sqa_inter_masklm_base_reset
检查点。该模型在掩码语言模型(MLM)和作者所称的中间预训练步骤上进行了预训练,然后在SQA上进行了微调。它使用相对位置嵌入(即在表格的每个单元格处重置位置索引)。
另一个(非默认)可用版本是:
no_reset
,对应于tapas_sqa_inter_masklm_base
(中间预训练,绝对位置嵌入)。
免责声明:发布TAPAS的团队并未为此模型编写模型卡片,此模型卡片由Hugging Face团队及贡献者编写。
✨ 主要特性
- 基于大规模英文维基百科数据进行自监督预训练,学习表格及相关文本的语言内部表示。
- 支持两种位置嵌入方式,可根据需求选择不同版本。
- 可用于对话场景下的表格问答任务。
📚 详细文档
SQA上的开发准确率结果
模型规模 | 位置索引重置 | 开发准确率 | 链接 |
---|---|---|---|
LARGE | noreset | 0.7223 | tapas-large-finetuned-sqa (绝对位置嵌入) |
LARGE | reset | 0.7289 | tapas-large-finetuned-sqa |
BASE | noreset | 0.6737 | tapas-base-finetuned-sqa (绝对位置嵌入) |
BASE | reset | 0.6874 | tapas-base-finetuned-sqa |
MEDIUM | noreset | 0.6464 | tapas-medium-finetuned-sqa (绝对位置嵌入) |
MEDIUM | reset | 0.6561 | tapas-medium-finetuned-sqa |
SMALL | noreset | 0.5876 | tapas-small-finetuned-sqa (绝对位置嵌入) |
SMALL | reset | 0.6155 | tapas-small-finetuned-sqa |
MINI | noreset | 0.4574 | tapas-mini-finetuned-sqa (绝对位置嵌入) |
MINI | reset | 0.5148 | tapas-mini-finetuned-sqa |
TINY | noreset | 0.2004 | tapas-tiny-finetuned-sqa (绝对位置嵌入) |
TINY | reset | 0.2375 | tapas-tiny-finetuned-sqa |
模型描述
TAPAS是一个类似BERT的Transformer模型,以自监督的方式在大规模英文维基百科数据上进行预训练。这意味着它仅在原始表格和相关文本上进行预训练,没有人工进行任何标注(因此可以使用大量公开可用的数据),并通过自动过程从这些文本中生成输入和标签。更确切地说,它以两个目标进行预训练:
- 掩码语言模型(MLM):给定一个(扁平化的)表格和相关上下文,模型随机掩盖输入中15%的单词,然后将整个(部分掩盖的)序列输入模型。模型必须预测被掩盖的单词。这与传统的循环神经网络(RNN)不同,RNN通常逐个处理单词,也与像GPT这样的自回归模型不同,GPT会在内部掩盖未来的标记。这使得模型能够学习表格和相关文本的双向表示。
- 中间预训练:为了鼓励在表格上进行数值推理,作者通过创建数百万个语法生成的训练示例的平衡数据集,额外对模型进行了预训练。在这里,模型必须预测(分类)一个句子是否得到表格内容的支持或反驳。训练示例基于合成和反事实陈述创建。
通过这种方式,模型学习了表格和相关文本中使用的英语语言的内部表示,然后可以用于提取对下游任务有用的特征,例如回答关于表格的问题,或确定一个句子是否被表格内容所蕴含或反驳。微调是通过在预训练模型之上添加一个单元格选择头,然后在SQA上联合训练这个随机初始化的分类头和基础模型来完成的。
预期用途和限制
你可以使用此模型在对话场景中回答与表格相关的问题。有关代码示例,请参考Hugging Face网站上TAPAS的文档。
训练过程
预处理
文本被转换为小写,并使用WordPiece进行分词,词汇表大小为30,000。模型的输入形式如下:
[CLS] 问题 [SEP] 扁平化表格 [SEP]
微调
该模型在32个Cloud TPU v3核心上进行了200,000步的微调,最大序列长度为512,批量大小为128。在这种设置下,微调大约需要20小时。使用的优化器是Adam,学习率为1.25e-5,热身比例为0.2。添加了归纳偏置,使得模型仅选择同一列的单元格。这反映在 TapasConfig
的 select_one_column
参数中。另请参阅原始论文的表12。
BibTeX引用和引用信息
@misc{herzig2020tapas,
title={TAPAS: Weakly Supervised Table Parsing via Pre-training},
author={Jonathan Herzig and Paweł Krzysztof Nowak and Thomas Müller and Francesco Piccinno and Julian Martin Eisenschlos},
year={2020},
eprint={2004.02349},
archivePrefix={arXiv},
primaryClass={cs.IR}
}
@misc{eisenschlos2020understanding,
title={Understanding tables with intermediate pre-training},
author={Julian Martin Eisenschlos and Syrine Krichene and Thomas Müller},
year={2020},
eprint={2010.00571},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@InProceedings{iyyer2017search-based,
author = {Iyyer, Mohit and Yih, Scott Wen-tau and Chang, Ming-Wei},
title = {Search-based Neural Structured Learning for Sequential Question Answering},
booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics},
year = {2017},
month = {July},
abstract = {Recent work in semantic parsing for question answering has focused on long and complicated questions, many of which would seem unnatural if asked in a normal conversation between two humans. In an effort to explore a conversational QA setting, we present a more realistic task: answering sequences of simple but inter-related questions. We collect a dataset of 6,066 question sequences that inquire about semi-structured tables from Wikipedia, with 17,553 question-answer pairs in total. To solve this sequential question answering task, we propose a novel dynamic neural semantic parsing framework trained using a weakly supervised reward-guided search. Our model effectively leverages the sequential context to outperform state-of-the-art QA systems that are designed to answer highly complex questions.},
publisher = {Association for Computational Linguistics},
url = {https://www.microsoft.com/en-us/research/publication/search-based-neural-structured-learning-sequential-question-answering/},
}
📄 许可证
本模型使用Apache-2.0许可证。









