This documentation page is also available as an interactive notebook. You can launch the notebook in
Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the
above links.
Transform a single document, video, image, or audio file into multiple
rows for granular processing.What’s in this recipe:
You have documents, videos, or text that you need to break into smaller
pieces for processing. A PDF needs to be split into chunks for
retrieval-augmented generation. A video needs individual frames for
analysis. Text needs to be divided into sentences or sliding windows.You need a way to transform one source row into multiple output rows
automatically.
You create views with iterator functions that split source data into
multiple rows. Pixeltable provides built-in iterators for documents,
videos, images, audio, and strings.
Use string_splitter to divide text into sentences.
from pixeltable.functions.string import string_splittertexts = pxt.create_table('split_demo/texts', {'content': pxt.String})texts.insert( [ { 'content': 'AI data infrastructure simplifies ML workflows. Declarative pipelines update incrementally. This makes development faster and more maintainable.' } ])
Inserted 1 row with 0 errors in 0.03 s (38.38 rows/s)
1 row inserted.
Use tile_iterator to divide large images into a grid of smaller tiles.
This is useful for processing high-resolution images that are too large
to analyze at once, or for running object detection on different
regions.