Bird
0
0

You want to chunk a long document so that each chunk ends at a sentence boundary and overlaps by one sentence to keep context. Which semantic chunking strategy in langchain best fits this need?

hard📝 Application Q15 of 15
LangChain - Text Splitting
You want to chunk a long document so that each chunk ends at a sentence boundary and overlaps by one sentence to keep context. Which semantic chunking strategy in langchain best fits this need?
AUse chunking with chunk_size smaller than sentence length
BUse fixed-size chunking with chunk_size=1000 and chunk_overlap=0
CUse a separator-based chunking with '\n\n' as separator and chunk_overlap set to one sentence
DUse random chunking ignoring sentence boundaries
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirement for sentence boundary chunking

    To keep chunks ending at sentence boundaries, use a separator that matches sentence breaks like double newlines.
  2. Step 2: Choose chunking strategy with overlap

    Separator-based chunking with overlap of one sentence keeps context by repeating last sentence in next chunk.
  3. Final Answer:

    Use a separator-based chunking with '\n\n' as separator and chunk_overlap set to one sentence -> Option C
  4. Quick Check:

    Separator chunking + overlap = sentence boundary chunks [OK]
Quick Trick: Use separators matching sentences plus overlap for context [OK]
Common Mistakes:
  • Using fixed-size chunking ignoring sentence ends
  • Setting zero overlap losing context
  • Choosing chunk size smaller than sentence length

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes