Hands-On LangChain for LLM Applications Development: Documents Splitting [Part 2]

Youssef Hosni
Towards AI
Published in
9 min readJan 11, 2024

--

Once you’ve loaded documents, you’ll often want to transform them to better suit your application. The simplest example is you may want to split a long document into smaller chunks that can fit into your model’s context window.

When you want to deal with long pieces of text, it is necessary to split up that text into chunks. As simple as this sounds, there is a lot of potential complexity here. Ideally, you want to keep the semantically related pieces of text together.

--

--