DocumentBatch
DocumentBatch is the primary task type for text document processing in NeMo Curator.
Import
Class Definition
Expected Data Schema
The data attribute typically contains:
Properties
num_items
Get the number of documents in the batch.
Methods
to_pyarrow()
Convert data to PyArrow table.
to_pandas()
Convert data to Pandas DataFrame.
get_columns()
Get column names from the data.
validate()
Validate the batch structure.
Creating DocumentBatch
Do not pass task_id to the constructor. It remains empty until the framework assigns lineage at a stage boundary or when the task is supplied through initial_tasks.
Usage in Stages
Common Patterns
Adding Columns
Filtering Rows
Returning None remains the supported way to filter a batch out. The resumability layer converts it to a NoneTask, which represents a filtered task and consumes that branch, so a None return is what you will see surfaced as NoneTask downstream. See Resumable Processing.