From the course: Level up LLM applications development with LangChain and OpenAI
Unlock the full course today
Join today to access over 24,300 courses taught by industry experts.
Load and split documents into chunks
From the course: Level up LLM applications development with LangChain and OpenAI
Load and split documents into chunks
- [Instructor] Now let's go over how to create the Q&A chat bots. So we're going to start with the first step, which is to load and split the documents. So that's going to be during the indexing stage. So first we want to load the data by using a document loader. Next we use a text splitter to split the document into smaller chunks. So we're going to take care of these two first steps, which is to load the documents, then split the documents into smaller chunks. So let's go back to our projects and we're going to find here this function. And first we're going to use this class, TextLoader, which is provided by LangChain in order to load the data source. And so we want to use this text file as a data source, which is a list of frequently asked questions. So we're going to load these documents by using TextLoader. So let's start with that. So we're going to do that right here by creating a raw_text. And so we're going to load the documents by specifying here the destination. And because…
Contents
-
-
-
-
-
(Locked)
RAG: Overview and architecture2m 12s
-
(Locked)
Breaking down the RAG pipeline2m 50s
-
(Locked)
Project setup3m 33s
-
(Locked)
Load and split documents into chunks5m 6s
-
(Locked)
Initialize a vector store (Chroma) and ingest documents5m 6s
-
(Locked)
Create the chain: Prompt + model + parser5m 39s
-
(Locked)
Create the chain: Add context with a retriever4m 48s
-
(Locked)
Pass data with RunnablePassthrough and query data3m 27s
-
Challenge: Create a custom agent with history3m 12s
-
Solution: Add a chain with chat history5m 19s
-
(Locked)
Solution: Context- and history-aware chatbot5m 49s
-
(Locked)
-
-
-
-
-
-
-
-