문서 하나를 통째로 검색에 넣을 수는 없다. 그래서 미리 여러 조각으로 나눠 두고, 질문이 오면 조각 단위로 찾는다. 그 조각이 청크다.You cannot feed a whole document into search. So you cut it into pieces beforehand and, when a question arrives, search piece by piece. Those pieces are chunks.
도서관 카드 목록을 떠올리면 쉽다. 책 한 권을 통째로 뒤지지 않고, 미리 만들어 둔 카드를 찾는다. 청크는 그 카드 한 장이고, 카드에 무엇을 적어 두느냐가 검색의 성패를 가른다.Think of a library card catalogue. You do not search the whole book; you search cards prepared in advance. A chunk is one such card — and what you write on it decides whether the search works.
오늘 쓰는 인코더 all-MiniLM-L6-v2가 한 번에 읽는 양은 256토큰이다. 그런데 우리 문서는 그보다 훨씬 크다.The encoder we use, all-MiniLM-L6-v2, reads at most 256 tokens at a time. Our document is a great deal larger than that.
지금 만드는 조각은 파이프라인 끝까지 따라간다. 청크의 경계가 곧 전거의 단위가 된다.The pieces you cut now travel all the way to the end. A chunk boundary becomes a unit of citation.
가장 단순한 방법은 글자 수로 자르는 것이다. 그런데 몇 글자가 정답일까? 막대를 눌러 크기를 바꿔 보면, 답이 없다는 것이 드러난다.The simplest method is to cut by character count. But what is the right number? Click the bars to change it — and watch the question turn out to have no answer.
워크숍 코드가 쓰는 설정 그대로다: chunk_size=500, chunk_overlap=50. 문서는 535개 조각이 되었다.These are the workshop’s own settings: chunk_size=500, chunk_overlap=50. The document became 535 pieces.
글자 수는 문장이 어디서 끝나는지, 소제목이 어디서 시작하는지 모른다. 그래서 한 문장이 두 조각으로 흩어지고, 소제목은 앞 조각 끝에 고아로 남는다.A character count cannot tell where a sentence ends or a heading begins. So one sentence scatters across two pieces, and a heading is left orphaned at the tail of the piece before it.
추출된 텍스트에는 조판 지시문과 도표 축 숫자가 본문과 나란히 들어 있다. 무엇이 본문인지 모르는 채로 자르면 그것들이 그대로 검색 대상이 된다.The extracted text carries typesetting directives and chart-axis digits right beside the prose. Cut without knowing which is which, and all of it becomes searchable.
Source/raw_text.txt를 실제로 분할해 계산했습니다 · 분할기 RecursiveCharacterTextSplitter · 토큰은 all-MiniLM-L6-v2의 WordPiece 실측Every figure here was computed by actually splitting Source/raw_text.txt · Splitter: RecursiveCharacterTextSplitter · Token counts use the real all-MiniLM-L6-v2 WordPiece vocabulary