

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
We've embedded entire movie descriptions as single units. But what happens when the documents we want to search are much longer? This is where chunking becomes essential for effective semantic search.
Short descriptions work just fine:
Ted: John Bennett's childhood wish brings his teddy bear to life.
Things get complicated when we have long documents, like a full review:
Ted is a 2012 comedy film that follows John Bennett, played by Mark Wahlberg,
whose childhood wish magically brings his teddy bear Ted to life. The film
explores themes of friendship, growing up, and responsibility as John struggles
to balance his relationship with Ted and his girlfriend Lori.The movie opens with young John making a wish on a shooting star, and through
some unexplained magic, Ted comes to life. Fast forward 27 years, and John
is now an adult who still lives with his talking teddy bear. The film's humor
comes largely from the contrast between Ted's cute appearance and his crude,
adult behavior.Seth MacFarlane, creator of Family Guy, both voices Ted and directs the film.
The movie was a commercial success, grossing over $549 million worldwide
against a $50 million budget. A sequel, Ted 2, was released in 2015.
The film's special effects, particularly the CGI used to bring Ted to life,
were praised by critics...
If we keep this entire document in a single "chunk," we run into several problems:
Chunking solves these problems by splitting long documents into smaller pieces. For example, maybe we could break up the review document paragraph by paragraph.
Then a question about "Ted movie money" might only match the last paragraph, where the review actually talks about box office performance.
The simplest chunking approach splits text into fixed-size pieces based on character count, word count, or token count. The advantages of this naïve approach are:
Implement fixed-size chunking to split long text into smaller pieces for embedding.
Chunking 70 characters
1. This is a test text
2. with more than ten words
3. to see how chunking works
Run and submit the CLI tests.