Skip to main content
QUICK REVIEW

[论文解读] HuggingFace's Transformers: State-of-the-art Natural Language Processing

Thomas Wolf, Lysandre Debut|arXiv (Cornell University)|Oct 9, 2019
Topic Modeling参考文献 35被引用 3,125
一句话总结

Transformers 提供了一个开源的最先进 Transformer 架构库,具有统一 API、预训练模型中心,以及用于在 NLP 任务中轻松部署和微调的工具。

ABSTRACT

Recent progress in natural language processing has been driven by advances in both model architecture and model pretraining. Transformer architectures have facilitated building higher-capacity models and pretraining has made it possible to effectively utilize this capacity for a wide variety of tasks. extit{Transformers} is an open-source library with the goal of opening up these advances to the wider machine learning community. The library consists of carefully engineered state-of-the art Transformer architectures under a unified API. Backing this library is a curated collection of pretrained models made by and available for the community. extit{Transformers} is designed to be extensible by researchers, simple for practitioners, and fast and robust in industrial deployments. The library is available at \url{https://github.com/huggingface/transformers}.

研究动机与目标

  • 展示一个统一的 Transformer 库如何加速研究与生产部署。
  • 展示在一个一致 API 内的架构变体、分词器和任务特定的头部。
  • 突出 Model Hub,便于对预训练模型进行共享、微调和基准测试。
  • 解释跨越 PyTorch 与 TensorFlow 生态系统的部署路径及面向生产的特性。

提出的方法

  • 说明由 Tokenizers、Transformers 和 Heads 组成的库设计。
  • 调研已实现的架构及其任务特定的适配。
  • 解释跨模型与框架的快速切换的 Auto 类。
  • 详细说明集中的 Model Hub,包含模型卡和可访问的实时推理。
  • 解释部署工作流,包括 TorchScript、ONNX,以及边缘设备适配。

实验结果

研究问题

  • RQ1统一 API 如何使在不同 Transformer 架构之间进行研究和生产的切换变得容易?
  • RQ2在单一库中,哪些组件(分词器、Transformers、头部)对支持广泛的 NLP 任务是必不可少的?
  • RQ3Model Hub 如何促进对预训练模型的共享、基准测试和部署?
  • RQ4哪些部署策略(TorchScript、ONNX、CoreML 等)能在不同平台上优化生产性能?
  • RQ5社区贡献对库中模型的可用性和多样性有哪些影响?

主要发现

  • Transformers 提供一个集中的、可扩展的 API,通过 Model Hub 提供大量的预训练模型。
  • 该库通过一个通用基础和任务特定的头,支持多种架构(如 BERT、GPT-2、RoBERTa、XLNet、T5)。
  • Tokenizers 采用基于 Rust 的后端进行优化,以加速大数据集的预处理。
  • Model Hub 使模型卡上的实时推理成为可能,并使非专业人士也能轻松进行微调和部署。
  • 部署工作流涵盖 PyTorch 与 TensorFlow 的互操作性、TorchScript、ONNX,以及边缘设备的适配。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。