Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Build Q&A Bot Using OpenAI and ChatGPT
Rating: 4.8 out of 5(24 ratings)
2,068 students

Build Q&A Bot Using OpenAI and ChatGPT

Build An AI that can answer questions about things happening in the news through text embeddings
Created byKai Chao
Last updated 5/2023
English
English [Auto],

What you'll learn

  • Build a Q&A bot using OpenAI, ChatGPT and NodeJS (Javascript)
  • Learn to use text embeddings, cosine similarity, and text completion prompting
  • Crawl news websites to gather articles and turn them into text embeddings
  • Identify the most relevant text using cosine similarity and provide accurate answers to user questions
  • Use OpenAI's text completion prompting to generate responses based on article context and user input
  • Build a strong foundation for building advanced AI-powered applications using OpenAI software
  • Enhance your knowledge on data libraries and AI development to create cutting-edge applications

Course content

1 section9 lectures44m total length
  • Implementation overview4:02

    Develop a news qa system by crawling articles, creating text embeddings, and using cosine similarity to fetch the most relevant passage before querying OpenAI for answers.

  • Get OpenAI API Key0:04
  • Download code on Github0:03
  • Crawl news site using Puppeteer (optional)6:35

    Learn to crawl a news site with puppeteer by launching chromium, extracting article titles and URLs, pruning text to a single line from the story content, then saving csv.

  • Tokenize and chunk news article content with tiktoken10:08

    Tokenize and chunk news article content for OpenAI prompts using tiktoken, selecting the CL 100 K base tokenizer and aiming for 1000-token chunks within an 8191-token limit.

  • Understand and use embeddings7:33
  • Apply cosine similarity9:15

    Master cosine similarity as a metric between embedding vectors in multidimensional space. Apply cosine distance (1 minus similarity) in code like Index.js to rank relevant articles.

  • Text completion API (aka ChatGPT)4:24

    Learn to call the OpenAI completion endpoint using text-davinci-003 (GPT-3) and GPT-4 for article context questions. Craft prompts that ensure a single, factual response based on the provided context.

  • Next steps2:32

    Explore tokenizing, embeddings, and cosine distance, then experiment with completion API parameters, prompts, and sources such as news, academic journals, and blogs to sharpen your AI engineering skills.

Requirements

  • Basic knowledge of javascript & nodejs & npm
  • Practical experience using public API
  • No experience on AI / Machine Learning / Data science needed

Description

Use OpenAI and ChatGPT to Build Real-World Q&A Bot

Are you interested in building cutting-edge AI-powered applications? Do you want to learn how to use OpenAI and NodeJS to create a real-world application? If so, then this course is for you.

In this course, we will build an AI bot that can answer questions about news articles that we crawl. We will explore the latest API endpoints from OpenAI, we will learn how to use embeddings and GPT-3 in code.

Whether you're a software developer, data scientist, or an enthusiast looking to explore generative AI, this course is designed to provide you with the skills and knowledge you need to develop cutting-edge AI applications. Join today and learn how to use OpenAI and ChatGPT to build a real-world Q&A bot that can answer questions about things happening in the news through text embeddings.


-------------

In this course, you will:

  • Learn how to crawl news websites and gather article text

  • Understand how embeddings work in ML, and turn article text into text embeddings

  • Use tokenizer to split text into common sequences of characters

  • Apply cosine similarity to identify the embedding most relevant to user entered question

  • Prompt OpenAI text completion endpoint to generate answer responses


What will we use/learn in this course:

  • NodeJS

  • OpenAI text completion

  • OpenAI embedding

  • Tokenizer (tiktoken)

  • Cosine similarity

  • Web crawler (puppeteer)

Who this course is for:

  • Programmers who want to learn the tools and concepts used in AI application development to build intermediate to advanced software