Book

Natural Language Processing with Transformers

This practical guide explores the architecture and applications of Transformer models for natural language processing, crucial for understanding and optimizing large language models.

by Lewis Tunstall, Leandro von Werra, and Thomas Wolf

Summary

"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.

From the book

Title: Natural Language Processing with Transformers, Revised Edition by Lewis Tunstall, Leandro von Werra, Thomas WolfDescription: Since their introduction in 2017, transformers have quickly become the dominant architecture for achieving state-of-the-art results on a variety of natural language processing tasks. If you're a data scientist or coder, this practical book -now revised in full color- shows you how to train and scale these large models using Hugging Face Transformers, a Python-based deep learning library. Transformers have been used to write realistic news stories, improve Google Search queries, and even create chatbots that tell corny jokes. In this guide, authors Lewis Tunstall, Leandro von Werra, and Thomas Wolf, among the creators of Hugging Face Transformers, use a…
Snippet: In this guide, authors Lewis Tunstall, Leandro von Werra, and Thomas Wolf, among the creators of Hugging Face Transformers, use a hands-on approach to teach you how transformers work and how to integrate them in your applications.

Popular questions readers ask