Moe Chizari

Projects

The write-up

Interactive demo, added

PDF Chatbot: try it.

Split a made-up guide into chunks, change the chunk size and overlap, and see which chunk best matches a question.

Try it

Move the controls; the chart and the sentence under it update.

0.000.100.200.301234567Match score by chunk numberChunk 1, words 1 to 60: score 0.09Chunk 2, words 51 to 110: score 0.00Chunk 3, words 101 to 160: score 0.27Chunk 4, words 151 to 210: score 0.27Chunk 5, words 201 to 260: score 0.20Chunk 6, words 251 to 310: score 0.04Chunk 7, words 301 to 315: score 0.00

Best chunk: 3 of 7 (words 101 to 160), score 0.27. Bold words match the question.

volume. Leave out meat, fish, dairy, cooking oil and pet waste, which attract pests and smell as they rot. Water and air. The pile should feel as damp as a wrung-out sponge. If it is dry, add water or more greens; if it is soggy, add browns. Turn the pile often, every one to two weeks, with a fork to

60-word chunks with 10 words of overlap cut the 315-word guide into 7 chunks. Chunk 3 matches the question best (score 0.27); a document chatbot would pass this chunk to its language model to write the answer.

A made-up composting guide stands in for the PDF. Scoring by word weights (TF-IDF) stands in for the embeddings and vector search the write-up describes, and no language model is called. Not the original chatbot.

The write-up this goes with: PDF Chatbot.

All demos