🚀 在顺序问答(SQA)上微调的TAPAS基础模型
本模型有4个可用版本。最新版本(即默认版本)对应于原始GitHub仓库中的tapas_sqa_inter_masklm_base_reset
检查点。
该模型在MLM和作者所称的中间预训练的额外步骤上进行了预训练,然后在SQA上进行了微调。默认情况下,它使用相对位置嵌入(即在表格的每个单元格处重置位置索引)。
其他(非默认)可用版本如下:
revision="v3"
,对应于tapas_sqa_inter_masklm_base
(中间预训练,绝对位置嵌入)
revision="V2"
,对应于tapas_sqa_masklm_base_reset
(无中间预训练,相对位置嵌入)
revision="v1"
,对应于tapas_sqa_masklm_base
(无中间预训练,绝对位置嵌入)
免责声明:发布TAPAS的团队并未为该模型编写模型卡片,因此此模型卡片由Hugging Face团队及贡献者编写。
✨ 主要特性
模型描述
TAPAS是一个类似BERT的Transformer模型,以自监督的方式在来自维基百科的大量英文数据语料库上进行预训练。
这意味着它仅在原始表格和相关文本上进行预训练,没有人工以任何方式对其进行标注(这就是为什么它可以使用大量公开可用的数据),并通过自动过程从这些文本中生成输入和标签。更确切地说,它以两个目标进行预训练:
- 掩码语言建模(MLM):给定一个(扁平化的)表格和相关上下文,模型随机掩盖输入中15%的单词,然后将整个(部分掩码的)序列输入模型。接着,模型必须预测被掩盖的单词。这与通常逐个查看单词的传统循环神经网络(RNN)不同,也与像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许可证。
属性 |
详情 |
模型类型 |
在顺序问答(SQA)上微调的TAPAS基础模型 |
训练数据 |
SQA |
许可证 |
Apache 2.0 |