

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
Fixed-size chunking is simple, sure, but it runs the risk of breaking up important context. For example, this document:
In the climactic scene, the bear attack was terrifying. The stunning and innovative special effects led to record-breaking sales.
could be chunked like this:
In the climactic scene, the bear attack wasterrifying. The stunning and innovative special effects led (What was terrifying? What did special effects lead to?)to record-breaking sales. (What had record-breaking sales?)Chunk overlap solves this by creating chunks that share words to preserve context across boundaries. For example, we could chunk like this instead:
In the climactic scene, the bear attack wasbear attack was terrifying. The stunning and innovative special effects (The bear attack was terrifying.)special effects led to record-breaking sales (The special effects led to record-breaking sales.)So how do you know how aggressive your overlap should be? There's no one-size-fits-all answer, so make it configurable and test it on your data!
Okay, I know I said to test it on your data (and you should!), but a good rule of thumb for many use cases is about 20% overlap.
Add an --overlap parameter to the chunk command in semantic_search_cli.py.
Run and submit the CLI tests.
while loop with a custom condition rather than a for loop to handle the overlap..join() method to create the chunks.