课程: Advanced LLMs with Retrieval Augmented Generation (RAG): Practical Projects for AI Applications
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
西安市地铁十五号线一期工程PPP咨询服务项目...
课程: Advanced LLMs with Retrieval Augmented Generation (RAG): Practical Projects for AI Applications
Hands-on lab: Contextual retrieval
- To better understand the contextual retriever concept, we'll review together the fourth contextual retriever notebook. We'll load the complex data set and split the document into chunks exactly like what we did in the previous notebook. And then we'll generate the context sentence and append it to the chunks. We'll use the same visual improvements that we had did before and we'll suppress the warnings to keep the notebook clean. Let's load the data set. This is the same data set that we loaded before from the archive with AI papers, and we'll split the documents into chunks using the OpenAI encoder. This is exactly what we did in the previous notebook. It'll take a couple of seconds. And now we have the first document chunks. Let's see the text of the first chunk. And now we want to generate the context sentence for each one of the chunks from this document. We'll use anthropic here. There are a few reasons for that just because you can use different LLM. You can mix and match the…