새로 자를 곳을 정하지 않는다. <subsection> 경계가 이미 있으므로 그 경계가 곧 청크 경계다. 소제목 108개가 청크의 출발점이 된다.We do not decide where to cut. The <subsection> boundaries already exist, so those are the chunk boundaries. All 108 subsections become the starting point.
for goal in root.findall("goal"): for sub in goal.findall("subsection"): heading = sub.get("heading") # 소제목the heading body = [p.text for p in sub.findall("paragraph")]
청크에 붙는 정보는 새로 만든 것이 아니다. 전부 XML에 이미 적혀 있던 것을 옮겨 담을 뿐이다. 오른쪽 항목에 마우스를 올려 보라 — 왼쪽에서 그 출처가 빛난다.None of it is invented. Every field was already written in the XML; we merely carry it across. Hover a field on the right and watch its source light up on the left.
<goal number="1" name="No poverty" pages="10-11"> <subsection heading="Working poverty rate has decreased worldwide but per…"> <paragraph>Worldwide, working poverty has significantly declined over the past 25 yea…</paragraph> <paragraph>Eastern and South-Eastern Asia and Central and Southern Asia have made sig…</paragraph> </subsection> </goal>
인용문을 카드에 옮길 때 저자·서명·권차·쪽수를 함께 적어 두는 것과 같다. 나중에 그 카드만 보고도 원문으로 돌아갈 수 있어야 하기 때문이다. metadata는 그 서지 사항이다.It is what you do when copying a quotation onto a card: write the author, title, volume and page alongside it, so that the card alone can take you back to the source. The metadata is that note.
아래는 sdg_chunks.jsonl의 한 줄을 그대로 옮긴 것이다. 가공하지 않았다. 청크 하나는 metadata와 text 두 부분으로 되어 있다.Below is one line of sdg_chunks.jsonl, exactly as it is on disk. A chunk has two parts: metadata and text.
소제목 + 본문. 이 부분만 384개 숫자로 바뀐다. 소제목이 여기에도 들어 있는데, 나뉜 조각이 맥락을 잃지 않도록 앞에 붙여 둔 것이다.Heading plus body. Only this becomes 384 numbers. The heading appears here too — placed in front so that a split piece does not lose its topic.
인코더가 한 번에 읽는 양은 256토큰이다. 넘으면 뒷부분이 잘린 채 벡터가 되므로, 172단어(소제목 포함)를 넘으면 문단 경계에서 나눈다. 이때 heading·goal·pages는 건드리지 않는다.The encoder reads at most 256 tokens. Beyond that the tail is silently dropped before the vector is made, so anything over 172 words (heading included) is split at a paragraph boundary. The heading, goal and pages are left untouched.
part만 다르다.Split or not, the source is one. Both pieces point at the same Goal, the same pages, the same heading — only part differs.지금 만든 청크 176개가 STEP 5에서 벡터가 되고, STEP 6에서 색인에 담기고, STEP 9에서 검색되어, STEP 10의 답변 아래 출처 세 줄로 나타난다. 그 세 줄에 적히는 내용이 지금 이 metadata다.These 176 chunks become vectors in STEP 5, enter the index in STEP 6, get retrieved in STEP 9, and surface as three source lines beneath the STEP 10 answer. What is written on those lines is this metadata.
text가 384개의 숫자로 바뀐다.Next is STEP 5 — this text becomes 384 numbers.Source/sdg_chunks.jsonl을 가공 없이 그대로 실었습니다 · 토큰은 all-MiniLM-L6-v2의 WordPiece 실측The chunks on this page are reproduced verbatim from Source/sdg_chunks.jsonl · Token counts use the real all-MiniLM-L6-v2 WordPiece vocabulary