Seeding with External Datasets
This tutorial demonstrates how to use external datasets as seed data for synthetic data generation in Data Designer.
For more detail about seed dataset behavior, see the open-source library’s version of this tutorial.
Seed Sources by Execution Mode
Seed source support depends on where the workload executes:
run versus submit controls where the workload executes. A local run can still read Files API Filesets if the configuration references them and NeMo Services access is configured.
HuggingFace Datasets
Use HuggingFaceSeedSource to load data from HuggingFace:
Files API Filesets
Use FilesetFileSeedSource to load data through the Files API. This works in CLI run, CLI submit, and SDK execution when NeMo Services access is configured:
Path format:
- Fully qualified:
workspace/fileset-name#file-path(recommended) - Implicit workspace:
fileset-name#file-path(uses client’s workspace)
Prerequisites
Ensure you have completed the tutorials prerequisites. This tutorial uses an Inference Gateway provider, so local CLI run and NeMo Services execution both need access to the Inference Gateway API in a running NeMo Services cluster.
Example: Medical Notes from Symptom Data
This example generates realistic patient medical notes by seeding with publicly available symptom-to-diagnosis data. It uploads the seed data to a Files API Fileset so the same configuration can run locally through CLI run or through NeMo Services execution.
Step 1: Upload Seed Data
Upload the symptom-to-diagnosis dataset to a Files API Fileset:
Step 2: Build Configuration
Define your models and create a config builder:
Step 3: Configure Seed Dataset
Add the seed data to your configuration:
What this does: The seed dataset’s columns (diagnosis, patient_summary, etc.) are automatically added to your dataset and available for use in other columns.
Step 4: Add Synthetic Columns
Add columns that reference and extend the seed data:
Note: The diagnosis and patient_summary variables come from the seed dataset columns.
Step 5: Execute
Because this example uses a Files API Fileset and an Inference Gateway provider, even local CLI execution communicates with NeMo Services APIs.
For CLI execution, save the configuration in medical_notes.py and expose a load_config_builder() function that returns the config_builder.
Preview locally:
Generate a larger dataset locally:
Submit to NeMo Services:
You can also execute through the SDK service path.
Create a client:
Previewing the Dataset
Use the preview method for rapid iteration:
More about preview results
The PreviewResults object returned by client.data_designer.preview stores all its fields in memory; nothing is persisted to disk by default.
Use standard Python methods to save any preview data you want to keep around longer term.
For example, the dataset is a regular Pandas DataFrame and can be saved to disk via methods like to_csv or to_parquet.
Generating the Full Dataset
When you’re satisfied with the preview, submit a larger generation job:
More about job results
The Data Designer library writes several artifacts to disk when running a full generation job, including the final dataset as parquet.
When a Data Designer job runs through NeMo Services, the entire working directory of artifacts produced by the library is saved as a job result.
The download_artifacts method downloads this artifacts directory (stored as a .tar.gz archive),
unarchives it, and returns a DataDesignerJobResults object that can be used to load results into memory as DataFrames or other objects for programmatic inspection.
By default, download_artifacts saves the artifacts to a relative local directory named after the job.
An alternative path can be passed to download_artifacts.
How Seeding Works
When you configure a seed dataset:
- Automatic Column Addition: All columns from the seed data are automatically added to your dataset schema
- Dependency Resolution: Data Designer resolves dependencies between seed columns and synthetic columns
- Execution Order: Seed data is loaded first, then synthetic columns are generated row-by-row
- Row Alignment: Each generated row corresponds to one row from the seed dataset
Example: If your seed data has 100 rows with columns diagnosis and patient_summary, and you request 100 records, each generated record will include the seed columns plus any synthetic columns you defined.
Next Steps
- Execution modes: Learn more about local and NeMo Services execution in Execution Modes
- Column types: Explore all available column types in the library documentation
- Processors: Transform your data with processors in the library documentation