From the course: Introduction to AI Orchestration with LangChain and LlamaIndex

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Challenge: Document summarization

Challenge: Document summarization

One feature that can be paired with RAG is summarization. It can be useful to summarize wordy documents, such as call transcripts, before loading them into the vector index. There are fancier ways to do this, so we're going to concentrate on the fundamentals here. Here's your chance to write some AI code. Based on what you've learned, write a simple app to take a single or multi-part document in the directory. For example, imagine an employee manual spread out over several DOCX files and save a single new file with a summary that still conveys the same meaning. We'll use LlamaIndex for this. The most straightforward way to do this is with an LLM that has a large context window, such as GPT-4. Load the entire document into a prompt accompanied with a system prompt along the lines of. Summarize the following document. Your first goal in this challenge is to write that prompt. There's many different ways to construct the prompt. You could ask for a particular number of words or pages, or…

Contents