Conventions used
There are several text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter/X handles. Here is an example: “Instantiate a tokenizer of the bert-base-cased
type.”
A block of code is set as follows:
from transformers import pipeline import torch
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
from transformers import T5Tokenizer, T5ForConditionalGeneration import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
Any command-line input or output is written as follows:
Classification Results {'accuracy': 0.88, 'precision': 0.92, 'recall': 0.84}
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Select System info from the Administration panel.”
Tips or important notes
Appear like this.