Transformers for Natural Language Processing and Computer Vision: Explore Generative AI and Large Language Models with Hugging Face, ChatGPT, GPT-4V, and DALL-E 3
, Third Edition
Compare and contrast 20+ models (including GPT-4, BERT, and Llama 2) and multiple platforms and libraries to find the right solution for your project
Apply RAG with LLMs using customized texts and embeddings
Mitigate LLM risks, such as hallucinations, using moderation models and knowledge bases
Purchase of the print or Kindle book includes a free eBook in PDF format
Description
Transformers for Natural Language Processing and Computer Vision, Third Edition, explores Large Language Model (LLM) architectures, applications, and various platforms (Hugging Face, OpenAI, and Google Vertex AI) used for Natural Language Processing (NLP) and Computer Vision (CV).
The book guides you through different transformer architectures to the latest Foundation Models and Generative AI. You’ll pretrain and fine-tune LLMs and work through different use cases, from summarization to implementing question-answering systems with embedding-based search techniques. You will also learn the risks of LLMs, from hallucinations and memorization to privacy, and how to mitigate such risks using moderation models with rule and knowledge bases. You’ll implement Retrieval Augmented Generation (RAG) with LLMs to improve the accuracy of your models and gain greater control over LLM outputs.
Dive into generative vision transformers and multimodal model architectures and build applications, such as image and video-to-text classifiers. Go further by combining different models and platforms and learning about AI agent replication.
This book provides you with an understanding of transformer architectures, pretraining, fine-tuning, LLM use cases, and best practices.
Who is this book for?
This book is ideal for NLP and CV engineers, software developers, data scientists, machine learning engineers, and technical leaders looking to advance their LLMs and generative AI skills or explore the latest trends in the field.
Knowledge of Python and machine learning concepts is required to fully understand the use cases and code examples. However, with examples using LLM user interfaces, prompt engineering, and no-code model building, this book is great for anyone curious about the AI revolution.
What you will learn
Breakdown and understand the architectures of the Original Transformer, BERT, GPT models, T5, PaLM, ViT, CLIP, and DALL-E
Fine-tune BERT, GPT, and PaLM 2 models
Learn about different tokenizers and the best practices for preprocessing language data
Pretrain a RoBERTa model from scratch
Implement retrieval augmented generation and rules bases to mitigate hallucinations
Visualize transformer model activity for deeper insights using BertViz, LIME, and SHAP
Go in-depth into vision transformers with CLIP, DALL-E 2, DALL-E 3, and GPT-4V
I adore Denis Rothman's Transformers and the way things are written and explained. A 5-year-old can understand his explanation and a scientist can improve his work. When I see his interviews, I learn, on the one hand, about the ChatGPT and Google Gemini transformers and, on the other hand, how to treat clients, be a proactive human, and get a new perspective on AI. AI becomes fun, easy, and life- and perspective-changing. I read the second edition, and I can not wait to apply what I read in the 3rd edition. I mean, it is written as if it would answer the pain points of becoming a GenAI pro and maximize business and living in any circumstance. I already attended a Packt conference with Denis Rothman as a speaker in October last year. With or without his opponents, GenAI is changing the world and will make an important difference. Thank you, Denis Rothman, for Transformers for Natural Language Processing and Computer Vision. I adore it.
Subscriber review
Paul BurnettOct 02, 2024
5
This book is excellently presented. I find the material and examples stimulating and which has led to a million more questions.
It a very complicated area to study but this book covers the topics very well.
The code works well. Great book. Many thanks.
I am still digesting this fabulous book.
Feefo Verified review
vSep 26, 2024
5
If you're aspiring to become an expert in NLP or Generative AI, this book is an excellent resource. It provides a clear, step-by-step explanation of NLP models, making complex concepts easy to grasp through practical examples and Python code. . Starting with foundational models, the book introduces the architecture of Transformer, BERT, and RoBERTa, followed by an in-depth exploration of the GPT models which are the Generative AI revolution. The book also delves into image processing and computer vision. Additionally, the questions at the end of each chapter further enhance understanding and engagement with the material.
Amazon Verified review
Dr. Walter AignerMar 15, 2024
5
for those who can read, I can definitely say that this new third edition provides a fresh look at both the transformers themselves and the current environment in which they exist.A valuable resource to refresh our knowledge and inspire us to take the next stepsmy personal selection of what I appreciated in this third edition after about ten days of perusing, reading and note-takingthe emergence of new roles:* The role of AI professionals* The future of AI professionals* What resources should we use?* Guidelines for decision making* Chapter 3: Emergent vs. downstream tasks: The Unseen Depths of Transformers* Chapter 7: The Generative AI Revolution with ChatGPT* Chapter 12: Towards Syntax-Free Semantic Role Labelling with ChatGPT and GPT-4* Chapter 16: Beyond Text: Vision Transformers at the Dawn of Revolutionary AIRothman writes that this book is for data analysts, data scientists, and machine learning/AI engineers who want to understand how to process and interrogate the increasing amounts of speech and image data. Most of the programs in the book are Colaboratory notebooks. All you need is a free Google Gmail account and you can run the notebooks on the free Google Colaboratory VM.Context of my interest in this field: Shortly after the public release of ChatGPT in November 2022, Bill Gates described it and other LLMs as "as important as the PC, as important as the Internet". Jensen Huang, CEO of Nvidia, said ChatGPT was "truly one of the greatest things ever done for computing". Geoffrey Hinton, a Turing Laureate, said, "I think it's comparable in scale to the industrial revolution or electricity - or maybe the wheel. Perhaps that is why many of us need a qualified, updated context.I can definitely say that this new third edition gives a qualified context and fresh look at both the transformers themselves and the current environment in which they exist.and yet, the term "Computer Simulation" is far more accurate as an umbrella term than any characterization of machine software("AI," "LLM," "Generative AI," etc.).Rothman's profile shows that he has been designing and developing computer simulation software for decades in various forms: rule-based, expert systems, ML agents, DL agents, the first transformer models, and now trending Generative AI for NLP and Computer Vision. all these algorithms boil down to "computer simulation", no more, no less. They are toolss that are here for us to make "simulations" to enhance our abilities as a scientific calculator does.Who this book is for: Anyone who regularly works with LLMs professionally (e.g. data scientists, machine learning engineers, AI researchers, etc.) or anyone already familiar with natural language processing (NLP) who wants to take a deep dive into transformers.Another reviewer rightly wrote: Who this book is not for: Anyone with little to no knowledge of NLP, machine learning, or Python programming (i.e. the "casual" reader). This book is dense (in the sense of Clifford Geertz‘ thick description that helps us increase our understanding on both on a theoretical and a practical level). I still have a lot to think about.And I have to admit that I have not yet fully grasped all the emerging possibilities and food for thought that the book has triggered or will trigger as I re-read and explore the code provided.
Amazon Verified review
DidiAug 01, 2024
5
The transformer architecture was introduced by Google in 2017, and almost instantly revolutionized the field of natural language processing (NLP), and to some degree also that of computer vision. This book is a comprehensive and practical guide to the transformer architecture, on which modern LLMs are based, and its applications in NLP and computer vision.The book does a wonderful job in providing detailed and clear descriptions of a wide range of important topics in NLP, such as the fundamentals of the transformer architecture, model pre-training, fine-tuning, tokenization, and embeddings. Notable applications of LLMs are also covered in detail, and include summarization, translation, etc. Modern generative AI methods are also very nicely covered, both in NLP and in computer vision (e.g., ChatGPT, Stable Diffusion, and the like). The accompanying GitHub repo is also very helpful, and greatly assists in reinforcing the concepts presented in the book.This comprehensive and unique guide will benefit any researcher, data scientist, machine learning engineer, or software engineer interested in building and understanding modern NLP and LLMs, as well as modern methods in computer vision. Prior familiarity with machine learning concepts, as well as with the Python programming language, would be helpful to get the most out of this book.Highly recommended!
Denis Rothman graduated from Sorbonne University and Paris-Diderot University, and as a student, he wrote and registered a patent for one of the earliest word2vector embeddings and word piece tokenization solutions. He started a company focused on deploying AI and went on to author one of the first AI cognitive NLP chatbots, applied as a language teaching tool for Moët et Chandon (part of LVMH) and more. Denis rapidly became an expert in explainable AI, incorporating interpretable, acceptance-based explanation data and interfaces into solutions implemented for major corporate projects in the aerospace, apparel, and supply chain sectors. His core belief is that you only really know something once you have taught somebody how to do it.
Economy: Delivery to most addresses in the US within 10-15 business days
Premium: Trackable Delivery to most addresses in the US within 3-8 business days
UK:
Economy: Delivery to most addresses in the U.K. within 7-9 business days. Shipments are not trackable
Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days! Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands
EU:
Premium: Trackable delivery to most EU destinations within 4-9 business days.
Australia:
Economy: Can deliver to P. O. Boxes and private residences. Trackable service with delivery to addresses in Australia only. Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro Delivery time is up to 15 business days for remote areas of WA, NT & QLD.
Premium: Delivery to addresses in Australia only Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.
India:
Premium: Delivery to most Indian addresses within 5-6 business days
Rest of the World:
Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days
Asia:
Premium: Delivery to most Asian addresses within 5-9 business days
Disclaimer: All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.
Unfortunately, due to several restrictions, we are unable to ship to the following countries:
Afghanistan
American Samoa
Belarus
Brunei Darussalam
Central African Republic
The Democratic Republic of Congo
Eritrea
Guinea-bissau
Iran
Lebanon
Libiya Arab Jamahriya
Somalia
Sudan
Russian Federation
Syrian Arab Republic
Ukraine
Venezuela
What is custom duty/charge?
Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.
Do I have to pay customs charges for the print book order?
The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.
A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.
How do I know my custom duty charges?
The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.
For example:
If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order?
Cancellation Policy for Published Printed Books:
You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.
Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.
What is your returns and refunds policy?
Return Policy:
We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:
If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.
On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.
What tax is charged?
Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.
What payment methods can I use?
You can pay with the following card types:
Visa Debit
Visa Credit
MasterCard
PayPal
What is the delivery time and cost of print books?
Shipping Details
USA:
'
Economy: Delivery to most addresses in the US within 10-15 business days
Premium: Trackable Delivery to most addresses in the US within 3-8 business days
UK:
Economy: Delivery to most addresses in the U.K. within 7-9 business days. Shipments are not trackable
Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days! Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands
EU:
Premium: Trackable delivery to most EU destinations within 4-9 business days.
Australia:
Economy: Can deliver to P. O. Boxes and private residences. Trackable service with delivery to addresses in Australia only. Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro Delivery time is up to 15 business days for remote areas of WA, NT & QLD.
Premium: Delivery to addresses in Australia only Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.
India:
Premium: Delivery to most Indian addresses within 5-6 business days
Rest of the World:
Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days
Asia:
Premium: Delivery to most Asian addresses within 5-9 business days
Disclaimer: All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.
Unfortunately, due to several restrictions, we are unable to ship to the following countries: