
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.
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 for OpenAI prompts using tiktoken, selecting the CL 100 K base tokenizer and aiming for 1000-token chunks within an 8191-token limit.
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.
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.
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.
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)