The Visualizer helps you visualize your chunks properly and compare different chunkers and settings with ease, either on the terminal or via HTML.

Installation

To make use of the Visualizer, you’ll need to install the viz optional install.

pip install "chonkie[viz]"

Usage

To use the Visualizer, you’ll need to import it from chonkie.utils.

# Import the Visualizer
from chonkie import Visualizer

# Initialize the Visualizer
viz = Visualizer()

The Visualizer has two main methods: print and save.

The print method will print the chunks to the terminal.

viz.print(chunks)

# Or you can directly call the Visualizer object
viz(chunks)

The save method will save the chunks to a HTML file.

viz.save("chonkie.html", chunks)