Book

Natural Language Processing with Transformers

by Lewis Tunstall, Leandro von Werra, and Thomas Wolf

1,000 words

"Natural Language Processing with Transformers, Revised Edition" by Lewis Tunstall, Leandro von Werra, and Thomas Wolf is a practical guide for data scientists and coders on using transformer models in NLP. Since their introduction in 2017, transformers have become the dominant architecture for achieving state-of-the-art results across various NLP tasks. This revised edition, authored by some of the creators of Hugging Face Transformers, a Python-based deep learning library, employs a hands-on approach to teach how transformers function and how to integrate them into applications. The book covers how transformers have been used for tasks such as writing realistic news stories, improving Google Search queries, and creating chatbots.

Readers will learn to build, debug, and optimize transformer models for core NLP tasks like text classification, named entity recognition, and question answering. The guide also delves into applying transformers for cross-lingual transfer learning, using them in scenarios with scarce labeled data, and making them efficient for deployment through techniques like distillation, pruning, and quantization. It further explains how to train transformers from scratch and scale them to multiple GPUs and distributed environments, equipping practitioners to solve a variety of real-world NLP challenges.

Key concepts

  • TransformersThe dominant architecture for achieving state-of-the-art results on a variety of natural language processing tasks since 2017.
  • Hugging Face TransformersA Python-based deep learning library used in the book to train and scale transformer models.
  • Core NLP TasksThe book teaches how to build and optimize models for text classification, named entity recognition, and question answering.
  • Cross-lingual Transfer LearningA technique for applying transformers in multilingual contexts.
  • Model Efficiency for DeploymentTechniques like distillation, pruning, and quantization are covered to optimize transformer models for practical deployment.
  • Training and Scaling TransformersReaders learn to train transformers from scratch and scale them across multiple GPUs and distributed environments.

Popular questions readers ask

AI insights about Natural Language Processing with TransformersAccumulated AI commentary on this book, drawn from real reader chat sessions and updated as more readers engage.