AI-Assisted Programming for Web and Machine Learning Improve Your Development Workflow with ChatGPT and GitHub Copilot
Speed up your development processes and improve your productivity by writing practical and relevant prompts to build web applications and Machine Learning (ML) models Purchase of the print or Kindle book includes a free PDF copy Key Features Utilize prompts to enhance frontend and backend web develo...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
[2024]
|
Edición: | First edition |
Colección: | Expert insight.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009845439706719 |
Tabla de Contenidos:
- Cover
- Copyright
- Contributors
- Preface
- Chapter 1: It's a New World, One with AI Assistants, and You're Invited
- Introduction
- How ChatGPT came to be, from NLP to LLMs
- The rise of LLMs
- GPT models
- How LLMs are better
- The new paradigm, programming with natural language
- Challenges and limitations
- About this book
- Who this book is for
- Evolution of programming languages
- Looking ahead
- How to use this book
- Chapter 2: Prompt Strategy
- Introduction
- Where you are
- Guidelines for how to prompt efficiently
- Prompt techniques
- Task-Action-Guideline prompt pattern (TAG)
- Persona-Instruction-Context prompt pattern (PIC)
- Exploratory prompt pattern
- Learn-Improvise-Feedback-Evaluate prompt pattern (LIFE)
- Which pattern to choose?
- Prompt strategy for web development
- Break down the problem: "web system for inventory management"
- Further breakdown of the frontend into features
- Generate prompts for each feature
- Identify some basic principles for web development, a "prompt strategy"
- Prompt strategy for data science
- Problem breakdown: predict sales
- Further breakdown into features/steps for data science
- Generate prompts for each step
- Identify some basic principles for data science, "a prompt strategy for data science"
- Validate the solution
- Verification via prompts
- Classical verification
- Summary
- Chapter 3: Tools of the Trade: Introducing Our AI Assistants
- Introduction
- Understanding Copilot
- How Copilot knows what to generate
- Copilot capabilities and limits
- Setup and installation
- Installing Copilot
- Getting started with Copilot
- Assignment: improve the code
- Solution
- Challenge
- References
- Understanding ChatGPT
- How does ChatGPT work?
- ChatGPT capabilities and limits
- Setup and installation
- Getting started with ChatGPT.
- Prompting
- Summary
- Chapter 4: Build the Appearance of Our App with HTML and Copilot
- Introduction
- Business problem: e-commerce
- Problem domain
- Problem breakdown: identify the features
- Prompt strategy
- Page structure
- Add AI assistance to our page structure
- Your first prompt, simple prompting, and aiding your AI assistant
- Your second prompt: adding more context
- Your third prompt: accept prompt suggestions
- Challenge: vary the prompt
- Use case: build a front for an e-commerce
- Login page
- Product list page
- Remaining pages
- Assignment
- Challenge
- Quiz
- Summary
- Chapter 5: Style the App with CSS and Copilot
- Introduction
- Business problem: e-commerce
- Problem and data domain
- Breaking the problem down into features
- Prompting strategy
- CSS, or Cascading Style Sheets
- First CSS
- CSS by name
- Assignment
- Solution
- Use case: style the e-commerce app
- Basket page
- Challenge
- Quiz
- Summary
- Chapter 6: Add Behavior with JavaScript
- Introduction
- Business problem: e-commerce
- Problem and data domain
- Breaking the problem down into features
- Prompting strategy
- Adding JavaScript
- The role of JavaScript
- Adding JavaScript to a page
- A second example: adding a JavaScript library/framework
- Challenge
- Use case: adding behavior
- Improving the output
- Adding Bootstrap
- Adding Vue.js
- Assignment
- Solution
- Summary
- Chapter 7: Support Multiple Viewports Using Responsive Web Layouts
- Introduction
- Business problem: e-commerce
- Problem and data domain
- Breaking the problem down into features
- Prompting strategy
- Viewports
- Media queries
- When to adjust to different viewports and make it responsive
- Use case: make our product gallery responsive
- Assignment
- Solution
- Challenge
- Summary
- Chapter 8: Build a Backend with Web APIs.
- Introduction
- Business domain: e-commerce
- Problem and data domain
- Feature breakdown
- Prompt strategy
- Web APIs
- What language and framework should you pick?
- Planning the Web API
- Creating a Web API with Python and Flask
- Step 1: Create a new project
- Step 2: Install Flask
- Step 3: Create an entry point
- Step 4: Create a Flask app
- Use case: a Web API for an e-commerce site
- Step 1: Create a Web API for an e-commerce site
- Step 2: Return JSON instead of text
- Step 3: Add code to read and write to a database
- Step 4: Improve the code
- Run the code
- Refactor the code
- Step 5: Document the API
- Assignment
- Solution
- Challenge
- Summary
- Chapter 9: Augment Web Apps with AI Services
- Introduction
- Business domain, e-commerce
- Problem and data domain
- Feature breakdown
- Prompt strategy
- Creating a model
- Coming up with a plan
- Importing libraries
- Reading the CSV file
- Creating test and training datasets
- Creating a model
- How good is the model?
- Predict
- Saving the model to a .pkl file
- Creating a REST API in Python
- Converting the model to ONNX
- Creating a model in ONNX format
- Loading the ONNX model in JavaScript
- Installing onnxruntime in JavaScript
- Loading the ONNX model in JavaScript
- Assignment: Build a REST API in JavaScript that consumes the model
- Solution
- Quiz
- Summary
- Chapter 10: Maintaining Existing Codebases
- Introduction
- Prompt strategy
- Different types of maintenance
- The maintenance process
- Addressing a bug
- 1. Identify the problem
- 2. Implement the change
- Adding a new feature
- 1. Identify a problem and find the function/s to change
- 2. Implement change, and add a new feature and tests
- Improving performance
- Big O notation calculation
- Measuring performance
- Improving maintainability.
- 1. Identify the problems. What problems do you see?
- 2. Add tests and de-risk change
- 3. Implement change and improve maintainability
- Challenge
- Updating an existing e-commerce site
- Assignment
- Knowledge check
- Summary
- Chapter 11: Data Exploration with ChatGPT
- Introduction
- Business problem
- Problem and data domain
- Dataset overview
- Feature breakdown
- Prompting strategy
- Strategy 1: Task-Actions-Guidelines (TAG) prompt strategy
- Strategy 2: Persona-Instructions-Context (PIC) prompt strategy
- Strategy 3: Learn-Improvise-Feedback-Evaluate (LIFE) prompt strategy
- Data exploration of the Amazon review dataset using the free version of ChatGPT
- Feature 1: Loading the dataset
- Feature 2: Inspecting the data
- Feature 3: Summary statistics
- Feature 4: Exploring categorical variables
- Feature 5: Rating distribution
- Feature 6: Temporal trends
- Feature 7: Review length analysis
- Feature 8: Correlation study
- Data exploration of the Amazon review dataset using ChatGPT-4o
- Assignment
- Challenge
- Summary
- Chapter 12: Building a Classification Model with ChatGPT
- Introduction
- Business problem
- Problem and data domain
- Dataset overview
- Breaking the problem down into features
- Prompting strategy
- Strategy 1: Task-Actions-Guidelines (TAG) prompt strategy
- Strategy 2: Persona-Instructions-Context (PIC) prompt strategy
- Strategy 3: Learn-Improvise-Feedback-Evaluate (LIFE) prompt strategy
- Building a sentiment analysis model to accurately classify Amazon reviews using the free version of ChatGPT
- Feature 1: Data preprocessing and feature engineering
- Feature 2: Model selection and baseline training
- Feature 3: Model evaluation and interpretation
- Feature 4: Handling imbalanced data
- Feature 5: Hyperparameter tuning
- Feature 6: Experimenting with feature representation.
- Building a sentiment analysis model to accurately classify Amazon reviews using ChatGPT-4 or ChatGPT Plus
- Feature 1: Data preprocessing and feature engineering
- Feature 2: Model selection and baseline training
- Feature 3: Model evaluation and interpretation
- Feature 4: Handling data imbalance
- Feature 5: Hyperparameter tuning
- Feature 6: Experimenting with feature representation
- Assignment
- Challenge
- Summary
- Chapter 13: Building a Regression Model for Customer Spend with ChatGPT
- Introduction
- Business problem
- Problem and data domain
- Dataset overview
- Breaking the problem down into features
- Prompting strategy
- Strategy 1: Task-Actions-Guidelines (TAG) prompt strategy
- Strategy 2: Persona-Instructions-Context (PIC) prompt strategy
- Strategy 3: Learn-Improvise-Feedback-Evaluate (LIFE) prompt strategy
- Building a simple linear regression model to predict the "Yearly Amount Spent" by customers using the free version of ChatGPT
- Feature 1: Building the model step by step
- Feature 2: Applying regularization techniques
- Feature 3: Generating a synthetic dataset to add complexity
- Feature 4: Generating code to develop a model in a single step for a synthetic dataset
- Learning simple linear regression using ChatGPT Plus
- Feature 1: Building a simple linear regression model step by step
- Feature 2: Applying regularization techniques
- Feature 3: Generating a synthetic dataset to add complexity
- Feature 4: Generating code to develop a model in a single step for a synthetic dataset
- Assignment
- Challenge
- Summary
- Chapter 14: Building an MLP Model for Fashion-MNIST with ChatGPT
- Introduction
- Business problem
- Problem and data domain
- Dataset overview
- Breaking the problem down into features
- Prompting strategy
- Strategy 1: Task-Actions-Guidelines (TAG) prompt strategy.
- Strategy 2: Persona-Instructions-Context (PIC) prompt strategy.