Transformers for Natural Language Processing and Computer Vision 3rd Edition by Denis Rothman – Ebook PDF Instant Download/DeliveryISBN: 1805123742, 9781805123743
Full download Transformers for Natural Language Processing and Computer Vision 3rd Edition after payment
Product details:
ISBN-10 : 1805123742
ISBN-13 : 9781805123743
Author: Denis Rothman
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.
Transformers for Natural Language Processing and Computer Vision 3rd Table of contents:
1. Preparing the dataset
1.1. Preparing the data in JSON
1.2. Converting the data to JSONL
2. Fine-tuning an original model
3. Running the fine-tuned GPT model
4. Managing fine-tuned jobs and models
Before leaving
Summary
Questions
References
Further reading
Shattering the Black Box with Interpretable Tools
Transformer visualization with BertViz
Running BertViz
Step 1: Installing BertViz and importing the modules
Step 2: Load the models and retrieve attention
Step 3: Head view
Step 4: Processing and displaying attention heads
Step 5: Model view
Step 6: Displaying the output probabilities of attention heads
Streaming the output of the attention heads
Visualizing word relationships using attention scores with pandas
exBERT
Interpreting Hugging Face transformers with SHAP
Introducing SHAP
Explaining Hugging Face outputs with SHAP
Transformer visualization via dictionary learning
Transformer factors
Introducing LIME
The visualization interface
Other interpretable AI tools
LIT
PCA
Running LIT
OpenAI LLMs explain neurons in transformers
Limitations and human control
Summary
Questions
References
Further reading
Investigating the Role of Tokenizers in Shaping Transformer Models
Matching datasets and tokenizers
Best practices
Step 1: Preprocessing
Step 2: Quality control
Step 3: Continuous human quality control
Word2Vec tokenization
Case 0: Words in the dataset and the dictionary
Case 1: Words not in the dataset or the dictionary
Case 2: Noisy relationships
Case 3: Words in a text but not in the dictionary
Case 4: Rare words
Case 5: Replacing rare words
Exploring sentence and WordPiece tokenizers to understand the efficiency of subword tokenizers for transformers
Word and sentence tokenizers
Sentence tokenization
Word tokenization
Regular expression tokenization
Treebank tokenization
White space tokenization
Punkt tokenization
Word punctuation tokenization
Multi-word tokenization
Subword tokenizers
Unigram language model tokenization
SentencePiece
Byte-Pair Encoding (BPE)
WordPiece
Exploring in code
Detecting the type of tokenizer
Displaying token-ID mappings
Analyzing and controlling the quality of token-ID mappings
Summary
Questions
References
Further reading
Leveraging LLM Embeddings as an Alternative to Fine-Tuning
LLM embeddings as an alternative to fine-tuning
From prompt design to prompt engineering
Fundamentals of text embedding with NLKT and Gensim
Installing libraries
1. Reading the text file
2. Tokenizing the text with Punkt
Preprocessing the tokens
3. Embedding with Gensim and Word2Vec
4. Model description
5. Accessing a word and vector
6. Exploring Gensim’s vector space
7. TensorFlow Projector
Implementing question-answering systems with embedding-based search techniques
1. Installing the libraries and selecting the models
2. Implementing the embedding model and the GPT model
2.1 Evaluating the model with a knowledge base: GPT can answer questions
2.2 Add a knowledge base
2.3 Evaluating the model without a knowledge base: GPT cannot answer questions
3. Prepare search data
4. Search
5. Ask
5.1.Example question
5.2.Troubleshooting wrong answers
Transfer learning with Ada embeddings
1. The Amazon Fine Food Reviews dataset
1.2. Data preparation
2. Running Ada embeddings and saving them for future reuse
3. Clustering
3.1. Find the clusters using k-means clustering
3.2. Display clusters with t-SNE
4. Text samples in the clusters and naming the clusters
Summary
Questions
References
Further reading
Toward Syntax-Free Semantic Role Labeling with ChatGPT and GPT-4
Getting started with cutting-edge SRL
Entering the syntax-free world of AI
Defining SRL
Visualizing SRL
SRL experiments with ChatGPT with GPT-4
Basic sample
Difficult sample
Questioning the scope of SRL
The challenges of predicate analysis
Redefining SRL
From task-specific SRL to emergence with ChatGPT
1. Installing OpenAI
2. GPT-4 dialog function
3. SRL
Sample 1 (basic)
Sample 2 (basic)
Sample 3 (basic)
Sample 4 (difficult)
Sample 5 (difficult)
Sample 6 (difficult)
Summary
Questions
References
Further reading
Summarization with T5 and ChatGPT
Designing a universal text-to-text model
The rise of text-to-text transformer models
A prefix instead of task-specific formats
The T5 model
Text summarization with T5
Hugging Face
Selecting a Hugging Face transformer model
Initializing the T5-large transformer model
Getting started with T5
Exploring the architecture of the T5 model
Summarizing documents with T5-large
Creating a summarization function
A general topic sample
The Bill of Rights sample
A corporate law sample
From text-to-text to new word predictions with OpenAI ChatGPT
Comparing T5 and ChatGPT’s summarization methods
Pretraining
Specific versus non-specific tasks
Summarization with ChatGPT
Summary
Questions
References
Further reading
Exploring Cutting-Edge LLMs with Vertex AI and PaLM 2
Architecture
Pathways
Client
Resource manager
Intermediate representation
Compiler
Scheduler
Executor
PaLM
Parallel layer processing that increases training speed
Shared input-output embeddings, which saves memory
No biases, which improves training stability
Rotary Positional Embedding (RoPE) improves model quality
SwiGLU activations improve model quality
PaLM 2
Improved performance, faster, and more efficient
Scaling laws, optimal model size, and the number of parameters
State-of-the-art (SOA) performance and a new training methodology
Assistants
Gemini
Google Workspace
Google Colab Copilot
Vertex AI PaLM 2 interface
Vertex AI PaLM 2 assistant
Vertex AI PaLM 2 API
Question answering
Question-answer task
Summarization of a conversation
Sentiment analysis
Multi-choice problems
Code
Fine-tuning
Creating a bucket
Fine-tuning the model
Summary
Questions
References
Further reading
Guarding the Giants: Mitigating Risks in Large Language Models
The emergence of functional AGI
Cutting-edge platform installation limitations
Auto-BIG-bench
WandB
When will AI agents replicate?
Function: `create_vocab`
Process:
Function: `scrape_wikipedia`
Process:
Function: `create_dataset`
Process:
Classes: `TextDataset`, `Encoder`, and `Decoder`
Function: `count_parameters`
Function: `main`
Process:
Saving and Executing the Model
Risk management
Hallucinations and memorization
Memorization
Risky emergent behaviors
Disinformation
Influence operations
Harmful content
Privacy
Cybersecurity
Risk mitigation tools with RLHF and RAG
1. Input and output moderation with transformers and a rule base
2. Building a knowledge base for ChatGPT and GPT-4
Adding keywords
3. Parsing the user requests and accessing the KB
4. Generating ChatGPT content with a dialog function
Token control
Moderation
Summary
Questions
References
Further reading
Beyond Text: Vision Transformers in the Dawn of Revolutionary AI
From task-agnostic models to multimodal vision transformers
ViT – Vision Transformer
The basic architecture of ViT
Step 1: Splitting the image into patches
Step 2: Building a vocabulary of image patches
Step 3: The transformer
Vision transformers in code
A feature extractor simulator
The transformer
Configuration and shapes
CLIP
The basic architecture of CLIP
CLIP in code
DALL-E 2 and DALL-E 3
The basic architecture of DALL-E
Getting started with the DALL-E 2 and DALL-E 3 API
Creating a new image
Creating a variation of an image
From research to mainstream AI with DALL-E
GPT-4V, DALL-E 3, and divergent semantic association
Defining divergent semantic association
Creating an image with ChatGPT Plus with DALL-E
Implementing the GPT-4V API and experimenting with DAT
Example 1: A standard image and text
Example 2: Divergent semantic association, moderate divergence
Example 3: Divergent semantic association, high divergence
Summary
Questions
References
Further Reading
Transcending the Image-Text Boundary with Stable Diffusion
Transcending image generation boundaries
People also search for Transformers for Natural Language Processing and Computer Vision 3rd:
data science transformers for natural language processing coupon
transformers for natural language processing github
transformers for natural language processing – second edition
transformers for natural language processing by hugging face
transformers for natural language processing packt
Tags:
Transformers,Natural Language,Processing,Computer Vision,Denis Rothman