Bird
0
0

If a semantic chunker is set with chunk_size=200 and chunk_overlap=50, and the input text length is 450 characters, how many chunks will be generated approximately?

medium📝 component behavior Q5 of 15
LangChain - Text Splitting
If a semantic chunker is set with chunk_size=200 and chunk_overlap=50, and the input text length is 450 characters, how many chunks will be generated approximately?
A2 chunks
B3 chunks
C4 chunks
D5 chunks
Step-by-Step Solution
Solution:
  1. Step 1: Calculate effective chunk step

    Step size = chunk_size - chunk_overlap = 200 - 50 = 150 characters per chunk step.
  2. Step 2: Calculate number of chunks

    Number of chunks = ceil((450 - 50) / 150) = ceil(400 / 150) = ceil(2.66) = 3 chunks.
  3. Final Answer:

    3 chunks -> Option B
  4. Quick Check:

    Chunks = ceil((text_length - overlap) / (chunk_size - overlap)) [OK]
Quick Trick: Chunks ≈ ceil((text - overlap) / (chunk_size - overlap)) [OK]
Common Mistakes:
  • Ignoring overlap in calculation
  • Dividing text length by chunk_size directly
  • Not using ceiling function

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes