Exploring GPT-3: An unofficial first look at the general-purpose language processing API from OpenAI
- Length: 296 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2021-08-27
- ISBN-10: 1800563191
- ISBN-13: 9781800563193
- Sales Rank: #309741 (See Top 100 Books)
Get started with GPT-3 and the OpenAI API for natural language processing using JavaScript and Python
Key Features
- Understand the power of potential GPT-3 language models and the risks involved
- Explore core GPT-3 use cases such as text generation, classification, and semantic search using engaging examples
- Plan and prepare a GPT-3 application for the OpenAI review process required for publishing a live application
Book Description
Generative Pre-trained Transformer 3 (GPT-3) is a highly advanced language model from OpenAI that can generate written text that is virtually indistinguishable from text written by humans. Whether you have a technical or non-technical background, this book will help you understand and start working with GPT-3 and the OpenAI API.
If you want to get hands-on with leveraging artificial intelligence for natural language processing (NLP) tasks, this easy-to-follow book will help you get started. Beginning with a high-level introduction to NLP and GPT-3, the book takes you through practical examples that show how to leverage the OpenAI API and GPT-3 for text generation, classification, and semantic search. You’ll explore the capabilities of the OpenAI API and GPT-3 and find out which NLP use cases GPT-3 is best suited for. You’ll also learn how to use the API and optimize requests for the best possible results. With examples focusing on the OpenAI Playground and easy-to-follow JavaScript and Python code samples, the book illustrates the possible applications of GPT-3 in production.
By the end of this book, you’ll understand the best use cases for GPT-3 and how to integrate the OpenAI API in your applications for a wide array of NLP tasks.
What you will learn
- Understand what GPT-3 is and how it can be used for various NLP tasks
- Get a high-level introduction to GPT-3 and the OpenAI API
- Implement JavaScript and Python code examples that call the OpenAI API
- Structure GPT-3 prompts and options to get the best possible results
- Select the right GPT-3 engine or model to optimize for speed and cost-efficiency
- Find out which use cases would not be suitable for GPT-3
- Create a GPT-3-powered knowledge base application that follows OpenAI guidelines
Who this book is for
Exploring GPT-3 is for anyone interested in natural language processing or learning GPT-3 with or without a technical background. Developers, product managers, entrepreneurs, and hobbyists looking to get to grips with NLP, AI, and GPT-3 will find this book useful. Basic computer skills are all you need to get the most out of this book.
Table of Contents
- Introducing GPT-3 and the OpenAI API
- GPT-3 Applications and Use Cases
- Working with the OpenAI Playground
- Working with the OpenAI API
- Calling the OpenAI API in Code
- Content Filtering
- Generating and Transforming Text
- Classifying and Categorizing Text
- Building a GPT-3 Powered Question-Answering App
- Going Live with OpenAI-Powered Apps
Exploring GPT-3 Foreword Contributors About the author Acknowledgments About the reviewers Preface Who this book is for What this book covers To get the most out of this book Download the color images Conventions used Get in touch Reviews Section 1: Understanding GPT-3 and the OpenAI API Chapter 1: Introducing GPT-3 and the OpenAI API Technical requirements Introduction to GPT-3 Simplifying NLP What exactly is GPT-3? Democratizing NLP Understanding prompts, completions, and tokens Prompts Completions Tokens Introducing Davinci, Babbage, Curie, and Ada Davinci Curie Babbage Ada Content filtering model Instruct models A snapshot in time Understanding GPT-3 risks Inappropriate or offensive results Potential for malicious use Summary Chapter 2: GPT-3 Applications and Use Cases Technical requirements Understanding general GPT-3 use cases Introducing the Playground Getting started with the Playground Handling text generation and classification tasks Text generation Text classification Understanding semantic search The Semantic Search tool Summary Section 2: Getting Started with GPT-3 Chapter 3: Working with the OpenAI Playground Technical requirements Exploring the OpenAI developer console Developer documentation Developer resources Accounts and organizations Pricing and billing Usage reporting Member management Diving deeper into the Playground Choosing the right engine Response length Temperature and Top P Frequency and presence penalty Best of Stop sequence Inject Start Text and Inject Restart Text Show Probabilities Working with presets Grammatical Standard English Text to command Parse unstructured data Summary Chapter 4: Working with the OpenAI API Technical requirements Understanding APIs Getting familiar with HTTP Uniform resource identifiers HTTP methods The HTTP body HTTP headers HTTP response status codes Reviewing the OpenAI API endpoints List Engines Retrieve Engine Create Completions Semantic Search Introducing CURL and Postman Understanding API authentication Keeping API keys private Making an authenticated request to the OpenAI API Working with multiple organizations Introducing JSON Using the Completions endpoint Using the Semantic Search endpoint Summary Chapter 5: Calling the OpenAI API in Code Technical requirements Choosing your programming language Introducing replit Creating a repl Setting your OpenAI API key as an environment variable Understanding and creating the .replit file Using the OpenAI API with Node.js/JavaScript Calling the engines endpoint Calling the Completions endpoint Calling the search endpoint Using the OpenAI API in Python Calling the completions endpoint Calling the search endpoint Using other programming languages Summary Section 3: Using the OpenAI API Chapter 6: Content Filtering Technical requirements Preventing inappropriate and offensive results Understanding content filtering Testing the content filtering process Filtering content with JavaScript Flagging unsafe words with Node.js/JavaScript Filtering content with Python Flagging unsafe words with Python Summary Chapter 7: Generating and Transforming Text Technical requirements Using the examples Generating content and lists Dumb joke generator Mars facts (in most cases) Webinar description generator Book suggestions Children's book generator Translating and transforming text Acronym translator English to Spanish JavaScript to Python Fifth-grade summary Grammar correction Extracting text Extracting keywords HTML parsing Extracting a postal address Extracting an email address Creating chatbots A simple chatbot Summary Chapter 8: Classifying and Categorizing Text Technical requirements Understanding text classification Using the completions endpoint for text classification Content filtering is a text classification task Introducing the classifications endpoint Uploading files Implementing sentiment analysis Assigning an ESRB rating to text Classifying text by language Classifying text from keywords Summary Chapter 9: Building a GPT-3-Powered Question-Answering App Technical requirements Introducing GPT Answers GPT Answers technical overview Hosting the app Introducing the Answers endpoint Setting up and testing Express Creating the API endpoint for GPT Answers Creating the API endpoint Testing our API with Postman Creating the GPT Answers user interface Integrating the Answers endpoint Generating relevant and factual answers Using files with the Answers endpoint Summary Chapter 10: Going Live with OpenAI-Powered Apps Technical requirements Going live Understanding use case guidelines Addressing potential approval issues Content filtering Input and output lengths Request rate limiting Completing the pre-launch review request High-level use case questions Security and risk mitigation questions Growth plan questions Wrapping-up questions Summary Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Leave a review - let other readers know what you think
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Exploring GPT-3: An unofficial first look at the general-purpose language processing API from OpenAI
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.