
Transformers for Natural Language Processing: Build innovative deep neural network architectures for NLP with Python, PyTorch, TensorFlow, BERT, RoBERTa, and more
Author(s): Rothman (Author), Denis (Author)
- Publisher finelybook 出版社: Packt Publishing
- Publication Date 出版日期: January 29, 2021
- Language 语言: English
- Print length 页数: 384 pages
- ISBN-10: 1800565798
- ISBN-13: 9781800565791
Book Description
Become an AI language understanding expert by mastering the quantum leap of Transformer neural network models
Key Features
- Build and implement state-of-the-art language models, such as the original Transformer, BERT, T5, and GPT-2, using concepts that outperform classical deep learning models
- Go through hands-on applications in Python using Google Colaboratory Notebooks with nothing to install on a local machine
- Learn training tips and alternative language understanding methods to illustrate important key concepts
Book Description
The transformer architecture has proved to be revolutionary in outperforming the classical RNN and CNN models in use today. With an apply-as-you-learn approach, Transformers for Natural Language Processing investigates in vast detail the deep learning for machine translations, speech-to-text, text-to-speech, language modeling, question answering, and many more NLP domains with transformers.
The book takes you through NLP with Python and examines various eminent models and datasets within the transformer architecture created by pioneers such as Google, Facebook, Microsoft, OpenAI, and Hugging Face.
The book trains you in three stages. The first stage introduces you to transformer architectures, starting with the original transformer, before moving on to RoBERTa, BERT, and DistilBERT models. You will discover training methods for smaller transformers that can outperform GPT-3 in some cases. In the second stage, you will apply transformers for Natural Language Understanding (NLU) and Natural Language Generation (NLG). Finally, the third stage will help you grasp advanced language understanding techniques such as optimizing social network datasets and fake news identification.
By the end of this NLP book, you will understand transformers from a cognitive science perspective and be proficient in applying pretrained transformer models by tech giants to various datasets.
What you will learn
- Use the latest pretrained transformer models
- Grasp the workings of the original Transformer, GPT-2, BERT, T5, and other transformer models
- Create language understanding Python programs using concepts that outperform classical deep learning models
- Use a variety of NLP platforms, including Hugging Face, Trax, and AllenNLP
- Apply Python, TensorFlow, and Keras programs to sentiment analysis, text summarization, speech recognition, machine translations, and more
- Measure the productivity of key transformers to define their scope, potential, and limits in production
Who this book is for
Since the book does not teach basic programming, you must be familiar with neural networks, Python, PyTorch, and TensorFlow in order to learn their implementation with Transformers.
Readers who can benefit the most from this book include deep learning & NLP practitioners, data analysts and data scientists who want an introduction to AI language understanding to process the increasing amounts of language-driven functions.
Table of Contents
- Getting Started with the Model Architecture of the Transformer
- Fine-Tuning BERT Models
- Pretraining a RoBERTa Model from Scratch
- Downstream NLP Tasks with Transformers
- Machine Translation with the Transformer
- Text Generation with OpenAI GPT-2 and GPT-3 Models
- Applying Transformers to Legal and Financial Documents for AI Text Summarization
- Matching Tokenizers and Datasets
- Semantic Role Labeling with BERT-Based Transformers
- Let Your Data Do the Talking: Story, Questions, and Answers
- Detecting Customer Emotions to Make Predictions
- Analyzing Fake News with Transformers
- Appendix: Answers to the Questions
Editorial Reviews
Review
“After looking through so many sources, I can attest that not only will this book help you get started rapidly with using, training, and transfer-learning transformers, but it will also help you understand transformers in deep philosophical ways. I am VERY grateful to Denis for writing this book AND FOR writing it very well.”
—
Thom Ives, Lead Data Scientist at UL Prospector, Owner of Integrated Machine Learning & AI
“Transformers have taken the NLP world by storm in the last couple of years and have become indispensable for both academic research and industrial practice in NLP. For me, the major benefit of this book has been its comprehensive coverage. The Transformer models covered include not only the popular ones such as BERT, GPT-3 and T5, but also less well-known ones such as RoBERTa and ELECTRA. Examples are provided using Hugging Face (both PyTorch and TensorFlow), AllenNLP, and Trax (Google Brain) libraries.”
—
Sujit Pal, Technology Research Director at Elsevier Labs, Co-author of Deep Learning with TensorFlow 2 and Keras, Second Edition
“There is much attention and hype surrounding transformers and this book authored by Denis provides well-balanced coverage of the theory and practice that allows newcomers to get a good grasp of the concept, before following along with several code examples provided in the book. Particularly, the book provides a solid background on the architecture of transformers before covering popular models such as BERT, RoBERTa, and GPT-2. It also takes readers through several use cases (text summarization, labeling, Q&A, sentiment analysis and fake news detection) that they can follow along. I am already using this book as a reference for implementing some of the tutorial videos for my YouTube channel Data Professor.”
—
Chanin Nantasenamat, Ph.D., Associate Professor of Bioinformatics and Founder of Data Professor YouTube channel
About the Author
Denis Rothman graduated from Sorbonne University and Paris-Diderot University, patenting one of the very first word2matrix embedding solutions. Denis Rothman is the author of three cutting-edge AI solutions: one of the first AI cognitive chatbots more than 30 years ago; a profit-orientated AI resource optimizing system; and an AI APS (Advanced Planning and Scheduling) solution based on cognitive patterns used worldwide in aerospace, rail, energy, apparel, and many other fields. Designed initially as a cognitive AI bot for IBM, it then went on to become a robust APS solution used to this day.
finelybook
