This page is for version 25.09 · v1.0.0.
For other versions, use one of these documentation indexes:
- Latest · v1.4.0 (26.09) (default): https://docs.nvidia.com/nemo/curator/latest/llms.txt
- Main · preview: https://docs.nvidia.com/nemo/curator/main/llms.txt
- 26.09 · v1.4.0: https://docs.nvidia.com/nemo/curator/v26.09/llms.txt
- 26.07 · v1.3.0: https://docs.nvidia.com/nemo/curator/v26.07/llms.txt
- 26.04 · v1.2.0: https://docs.nvidia.com/nemo/curator/v26.04/llms.txt
- 26.02 · v1.1.0: https://docs.nvidia.com/nemo/curator/v26.02/llms.txt
- 25.09 · v1.0.0: https://docs.nvidia.com/nemo/curator/v25.09/llms.txt
The Pipeline class is the main orchestrator for executing sequences of processing stages in NeMo Curator.
Import
from nemo_curator.pipeline import Pipeline
Class Definition
class Pipeline:"""Compose ProcessingStage instances into an executable workflow."""def __init__(self,name: str,description: str | None = None,stages: list[ProcessingStage] | None = None,) -> None:"""Initialize a pipeline.Args:name: Name identifier for the pipeline.description: Optional description of the pipeline's purpose.stages: Optional list of processing stages to include."""
Methods
add_stage()
Add a stage to the pipeline.
def add_stage(self, stage: ProcessingStage) -> "Pipeline":"""Add a processing stage to the pipeline.Args:stage: The ProcessingStage to add.Returns:Self for method chaining."""
build()
Build an execution plan from the pipeline.
def build(self) -> list[ProcessingStage]:"""Build the execution plan by decomposing composite stages.Returns:List of execution-ready stages."""
run()
Execute the pipeline.
def run(self,executor: BaseExecutor | None = None,initial_tasks: list[Task] | None = None,) -> list[Task]:"""Execute the pipeline.Args:executor: Executor to use. Defaults to XennaExecutor.initial_tasks: Initial tasks to start the pipeline.Returns:List of output tasks from the final stage."""
describe()
Get a detailed description of the pipeline.
def describe(self) -> str:"""Get detailed description of pipeline stages and requirements.Returns:Human-readable description of the pipeline."""
Usage Examples
Basic Pipeline
from nemo_curator.pipeline import Pipelinefrom nemo_curator.stages.text.io import ParquetReader, ParquetWriterfrom nemo_curator.stages.text.filters import LengthFilter# Create pipeline with stagespipeline = Pipeline(name="text_curation",description="Basic text curation pipeline",stages=[ParquetReader(input_path="/data/input"),LengthFilter(min_length=100, max_length=10000),ParquetWriter(output_path="/data/output"),],)# Run the pipelineresults = pipeline.run()
Method Chaining
pipeline = Pipeline(name="my_pipeline")pipeline.add_stage(stage1).add_stage(stage2).add_stage(stage3)results = pipeline.run()
Custom Executor
from nemo_curator.backends.xenna import XennaExecutorexecutor = XennaExecutor(config={"execution_mode": "streaming"})results = pipeline.run(executor=executor)