

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Chunking
incomplete
2: Chunk Overlap
incomplete
3: Semantic Chunking
incomplete
4: Chunked Semantic Embeddings
incomplete
5: Chunked Semantic Search
incomplete
6: Chunked Edge Cases
incomplete
7: ColBERT
incomplete
8: Late Chunking
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Chunking seems straightforward until you, you know, implement it on real data. Human writing has seemingly infinite edge cases. The way to get reliable chunks is to create them and manually inspect the results. A lot.
Real documents are messy, for example:
With PDFs, you might run into problems like these:
With rich text formats like Markdown and HTML, you might see:
Say we have this movie review:
Movie Review: Ted Page 1 of 3
Ted is a 2012 comedy film that follows John Bennett's relationship with his talking teddy bear.
Plot Summary Special Effects
The film explores themes of The CGI work that brought
friendship and responsibility. Ted to life was groundbreaking.
Rating: 4/5 stars © 2023 Movie Reviews Inc.
A poor chunking algorithm might produce chunks like these:
"Movie Review: Ted Page 1 of 3 Ted is a""2012 comedy film that follows John Bennett's Plot Summary""The film explores themes of The CGI work that"The chunks are completely broken due to PDF layout issues. The best approach to identifying the issues with your data is:
We have a few edge cases that are making our semantic chunking... less than ideal. Make the following improvements to our chunking logic:
" Leading and trailing spaces. ""Text without punctuation"" " (only whitespace)"" (empty string)This list of edge cases is far from exhaustive, but it's a good start!
When you're confident in your improvements, run and submit the CLI tests.
You'll need to manually delete the embeddings from your cache directory when you make changes, so that they'll be regenerated on the next run.