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.
HuggingFace Datasets
Use HuggingFaceSeedSource to load data from HuggingFace:
Files API Filesets
Use FilesetFileSeedSource to load data through the Files API.
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.
Example: Medical Notes from Symptom Data
This example generates realistic patient medical notes by seeding with publicly available symptom-to-diagnosis data.
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
CLI Execution
For CLI execution, save the configuration in medical_notes.py and expose a load_config_builder() function that returns the config_builder.
Preview the dataset:
Generate a larger dataset:
SDK Execution
Create a client:
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.
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
- Column types: Explore all available column types in the library documentation
- Advanced features: Learn about processors and validation