Skip to navigation

Seeding with an External Dataset

View as Markdown

🎨 Data Designer Tutorial: Seeding Synthetic Data Generation with an External Dataset

📚 What you'll learn

In this notebook, we will demonstrate how to seed synthetic data generation in Data Designer with an external dataset.

If this is your first time using Data Designer, we recommend starting with the first notebook in this tutorial series.

📦 Import Data Designer

  • data_designer.config provides access to the configuration API.

  • DataDesigner is the main interface for data generation.

Python
1import data_designer.config as dd
2from data_designer.interface import DataDesigner
3

⚙️ Initialize the Data Designer interface

  • DataDesigner is the main object responsible for managing the data generation process.

  • When initialized without arguments, the default model providers are used.

Python
1data_designer = DataDesigner()
2

🎛️ Define model configurations

  • Each ModelConfig defines a model that can be used during the generation process.

  • The "model alias" is used to reference the model in the Data Designer config (as we will see below).

  • The "model provider" is the external service that hosts the model (see the model config docs for more details).

  • By default, we use build.nvidia.com as the model provider.

Python
1# This name is set in the model provider configuration.
2MODEL_PROVIDER = "nvidia"
3
4# The model ID is from build.nvidia.com.
5MODEL_ID = "nvidia/nemotron-3.5-lightning-30b-a3b"
6
7# We choose this alias to be descriptive for our use case.
8MODEL_ALIAS = "nemotron-lightning"
9
10model_configs = [
11 dd.ModelConfig(
12 alias=MODEL_ALIAS,
13 model=MODEL_ID,
14 provider=MODEL_PROVIDER,
15 inference_parameters=dd.ChatCompletionInferenceParams(
16 temperature=1.0,
17 top_p=0.95,
18 max_tokens=2048,
19 extra_body={"chat_template_kwargs": {"enable_thinking": False}},
20 ),
21 )
22]
23

🏗️ Initialize the Data Designer Config Builder

  • The Data Designer config defines the dataset schema and generation process.

  • The config builder provides an intuitive interface for building this configuration.

  • The list of model configs is provided to the builder at initialization.

Python
1config_builder = dd.DataDesignerConfigBuilder(model_configs=model_configs)
2

🏥 Prepare a seed dataset

  • For this notebook, we'll create a synthetic dataset of patient notes.

  • We will seed the generation process with a symptom-to-diagnosis dataset.

  • The notebook downloads the source CSV before generation.


🌱 Why use a seed dataset?

  • Seed datasets let you steer the generation process by providing context that is specific to your use case.

  • Seed datasets are also an excellent way to inject real-world diversity into your synthetic data.

  • During generation, prompt templates can reference any of the seed dataset fields.

Python
1# Download sample dataset from Github
2import urllib.request
3
4url = "https://raw.githubusercontent.com/NVIDIA/GenerativeAIExamples/refs/heads/main/nemo/NeMo-Data-Designer/data/gretelai_symptom_to_diagnosis.csv"
5local_filename, _ = urllib.request.urlretrieve(url, "gretelai_symptom_to_diagnosis.csv")
6
7# Seed datasets are passed as reference objects to the config builder.
8seed_source = dd.LocalFileSeedSource(path=local_filename)
9
10config_builder.with_seed_dataset(seed_source)
11
Output
DataDesignerConfigBuilder(
    seed_dataset: local seed
)

🎨 Designing our synthetic patient notes dataset

  • The prompt template can reference fields from our seed dataset:
    • {{ diagnosis }} - the medical diagnosis from the seed data
    • {{ patient_summary }} - the symptom description from the seed data
Python
1config_builder.add_column(
2 dd.SamplerColumnConfig(
3 name="patient_sampler",
4 sampler_type=dd.SamplerType.PERSON_FROM_FAKER,
5 params=dd.PersonFromFakerSamplerParams(),
6 )
7)
8
9config_builder.add_column(
10 dd.SamplerColumnConfig(
11 name="doctor_sampler",
12 sampler_type=dd.SamplerType.PERSON_FROM_FAKER,
13 params=dd.PersonFromFakerSamplerParams(),
14 )
15)
16
17config_builder.add_column(
18 dd.SamplerColumnConfig(
19 name="patient_id",
20 sampler_type=dd.SamplerType.UUID,
21 params=dd.UUIDSamplerParams(
22 prefix="PT-",
23 short_form=True,
24 uppercase=True,
25 ),
26 )
27)
28
29config_builder.add_column(dd.ExpressionColumnConfig(name="first_name", expr="{{ patient_sampler.first_name }}"))
30
31config_builder.add_column(dd.ExpressionColumnConfig(name="last_name", expr="{{ patient_sampler.last_name }}"))
32
33config_builder.add_column(dd.ExpressionColumnConfig(name="dob", expr="{{ patient_sampler.birth_date }}"))
34
35config_builder.add_column(
36 dd.SamplerColumnConfig(
37 name="symptom_onset_date",
38 sampler_type=dd.SamplerType.DATETIME,
39 params=dd.DatetimeSamplerParams(start="2024-01-01", end="2024-12-31"),
40 )
41)
42
43config_builder.add_column(
44 dd.SamplerColumnConfig(
45 name="date_of_visit",
46 sampler_type=dd.SamplerType.TIMEDELTA,
47 params=dd.TimeDeltaSamplerParams(dt_min=1, dt_max=30, reference_column_name="symptom_onset_date"),
48 )
49)
50
51config_builder.add_column(dd.ExpressionColumnConfig(name="physician", expr="Dr. {{ doctor_sampler.last_name }}"))
52
53config_builder.add_column(
54 dd.LLMTextColumnConfig(
55 name="physician_notes",
56 prompt="""\
57You are a primary-care physician who just had an appointment with {{ first_name }} {{ last_name }},
58who has been struggling with symptoms from {{ diagnosis }} since {{ symptom_onset_date }}.
59The date of today's visit is {{ date_of_visit }}.
60
61{{ patient_summary }}
62
63Write careful notes about your visit with {{ first_name }},
64as Dr. {{ doctor_sampler.first_name }} {{ doctor_sampler.last_name }}.
65
66Format the notes as a busy doctor might.
67Respond with only the notes, no other text.
68""",
69 model_alias=MODEL_ALIAS,
70 )
71)
72
73data_designer.validate(config_builder)
74
Output
[19:56:15] [INFO] ✅ Validation passed

🔁 Iteration is key – preview the dataset!

  1. Use the preview method to generate a sample of records quickly.

  2. Inspect the results for quality and format issues.

  3. Adjust column configurations, prompts, or parameters as needed.

  4. Re-run the preview until satisfied.

Python
1preview = data_designer.preview(config_builder, num_records=2)
2
Output
[19:56:15] [INFO] 🕵️ Preview generation in progress
[19:56:15] [INFO]   |-- 🔒 Jinja rendering engine: secure
[19:56:15] [INFO] ✅ Validation passed
[19:56:15] [INFO] ⛓️ Sorting column configs into a Directed Acyclic Graph
[19:56:15] [INFO] Skipping model health checks because DATA_DESIGNER_SKIP_MODEL_HEALTH_CHECKS=1
[19:56:15] [INFO] ⚡ Using async task-queue preview
[19:56:15] [INFO] 📝 llm-text model config for column 'physician_notes'
[19:56:15] [INFO]   |-- model: 'nvidia/nemotron-3.5-lightning-30b-a3b'
[19:56:15] [INFO]   |-- model alias: 'nemotron-lightning'
[19:56:15] [INFO]   |-- model provider: 'nvidia'
[19:56:15] [INFO]   |-- inference parameters:
[19:56:15] [INFO]   |  |-- generation_type=chat-completion
[19:56:15] [INFO]   |  |-- max_parallel_requests=4
[19:56:15] [INFO]   |  |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[19:56:15] [INFO]   |  |-- temperature=1.00
[19:56:15] [INFO]   |  |-- top_p=0.95
[19:56:15] [INFO]   |  |-- max_tokens=2048
[19:56:15] [INFO] ⚡️ Async generation: 1 column(s) (column 'physician_notes'), 2 tasks across 1 row group(s)
[19:56:15] [INFO] 🚀 (1/1) Dispatching with 2 records
[19:56:15] [INFO] 🎲 (1/1) Preparing samplers to generate 2 records across 5 columns
[19:56:15] [INFO] 🌱 (1/1) Sampling 2 records from seed dataset
[19:56:15] [INFO]   |-- seed dataset size: 820 records
[19:56:15] [INFO]   |-- sampling strategy: ordered
[19:56:15] [INFO] 🧩 (1/1) Generating column `dob` from expression
[19:56:15] [INFO] 🧩 (1/1) Generating column `first_name` from expression
[19:56:15] [INFO] 🧩 (1/1) Generating column `last_name` from expression
[19:56:15] [INFO] 🧩 (1/1) Generating column `physician` from expression
[19:56:49] [INFO] 📊 Progress [34.1s]:
[19:56:49] [INFO]   |-- 🤩 column 'physician_notes': 2/2 (100%) 0.1 rec/s
[19:56:49] [INFO] ✅ Async generation complete [34.1s]: 2 ok, 0 failed across 1 column(s)
[19:56:49] [INFO] 📊 Model usage summary:
[19:56:49] [INFO]   |-- model: nvidia/nemotron-3.5-lightning-30b-a3b
[19:56:49] [INFO]   |-- tokens: input=327, output=1000, reasoning=0, total=1327, tps=38
[19:56:49] [INFO]   |-- requests: success=2, failed=0, total=2, rpm=3
[19:56:49] [INFO] 📐 Measuring dataset column statistics:
[19:56:49] [INFO]   |-- 🎲 column: 'patient_sampler'
[19:56:49] [INFO]   |-- 🎲 column: 'doctor_sampler'
[19:56:49] [INFO]   |-- 🎲 column: 'patient_id'
[19:56:49] [INFO]   |-- 🧩 column: 'first_name'
[19:56:49] [INFO]   |-- 🧩 column: 'last_name'
[19:56:49] [INFO]   |-- 🧩 column: 'dob'
[19:56:49] [INFO]   |-- 🎲 column: 'symptom_onset_date'
[19:56:49] [INFO]   |-- 🎲 column: 'date_of_visit'
[19:56:49] [INFO]   |-- 🧩 column: 'physician'
[19:56:49] [INFO]   |-- 📝 column: 'physician_notes'
[19:56:49] [INFO]   |-- 🌱 column: 'diagnosis'
[19:56:49] [INFO]   |-- 🌱 column: 'patient_summary'
[19:56:49] [INFO] 🥳 Preview complete!
Python
1# Run this cell multiple times to cycle through the 2 preview records.
2preview.display_sample_record()
3
Output
[index: 0]
                                                                                                              
                                                 Seed Columns                                                 
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name            ┃ Value                                                                                    ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ diagnosis       │ cervical spondylosis                                                                     │
├─────────────────┼──────────────────────────────────────────────────────────────────────────────────────────┤
│ patient_summary │ I've been having a lot of pain in my neck and back. I've also been having trouble with   │
│                 │ my balance and coordination. I've been coughing a lot and my limbs feel weak.            │
└─────────────────┴──────────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                              
                                                                                                              
                                              Generated Columns                                               
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name               ┃ Value                                                                                 ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ patient_sampler    │ {                                                                                     │
│                    │     'uuid': '5083e205-e985-4a4f-baa2-c72276775e86',                                   │
│                    │     'locale': 'en_US',                                                                │
│                    │     'first_name': 'Dennis',                                                           │
│                    │     'last_name': 'Anderson',                                                          │
│                    │     'middle_name': None,                                                              │
│                    │     'sex': 'Male',                                                                    │
│                    │     'street_number': '02444',                                                         │
│                    │     'street_name': 'Rodriguez Summit',                                                │
│                    │     'city': 'Matthewtown',                                                            │
│                    │     'state': 'Iowa',                                                                  │
│                    │     'postcode': '43722',                                                              │
│                    │     'age': 26,                                                                        │
│                    │     'birth_date': '2000-07-25',                                                       │
│                    │     'country': 'Congo',                                                               │
│                    │     'marital_status': 'widowed',                                                      │
│                    │     'education_level': 'bachelors',                                                   │
│                    │     'unit': '',                                                                       │
│                    │     'occupation': 'Electrical engineer',                                              │
│                    │     'phone_number': '001-572-867-8350x6738',                                          │
│                    │     'bachelors_field': 'business'                                                     │
│                    │ }                                                                                     │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ doctor_sampler     │ {                                                                                     │
│                    │     'uuid': '202cb76e-eb04-4165-ae49-61e1b454f2d6',                                   │
│                    │     'locale': 'en_US',                                                                │
│                    │     'first_name': 'Nathan',                                                           │
│                    │     'last_name': 'Arnold',                                                            │
│                    │     'middle_name': None,                                                              │
│                    │     'sex': 'Male',                                                                    │
│                    │     'street_number': '0512',                                                          │
│                    │     'street_name': 'Melanie Crossing',                                                │
│                    │     'city': 'North Lisaside',                                                         │
│                    │     'state': 'Indiana',                                                               │
│                    │     'postcode': '35790',                                                              │
│                    │     'age': 100,                                                                       │
│                    │     'birth_date': '1926-06-01',                                                       │
│                    │     'country': 'Fiji',                                                                │
│                    │     'marital_status': 'divorced',                                                     │
│                    │     'education_level': 'bachelors',                                                   │
│                    │     'unit': '',                                                                       │
│                    │     'occupation': 'Advertising copywriter',                                           │
│                    │     'phone_number': '001-475-447-2644x335',                                           │
│                    │     'bachelors_field': 'arts_humanities'                                              │
│                    │ }                                                                                     │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ patient_id         │ PT-3729E832                                                                           │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ symptom_onset_date │ 2024-08-09T00:00:00                                                                   │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ date_of_visit      │ 2024-08-11T00:00:00                                                                   │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ physician_notes    │ --- INITIALS: NA                                                                      │
│                    │ --- DATE: 2024-08-11                                                                  │
│                    │ --- PATIENT: Dennis Anderson                                                          │
│                    │ --- DOB: [Check chart]                                                                │
│                    │ --- VISIT TYPE: F/U Cervical Spondylosis / New Complaints                             │
│                    │                                                                                       │
│                    │ *** HISTORY OF PRESENT ILLNESS ***                                                    │
│                    │ Patient reports acute exacerbation of chronic cervical spondylosis symptoms onset     │
│                    │ 08/09/2024. Primary complaint: Significant increase in neck and back pain. Associated │
│                    │ symptoms: New-onset imbalance and coordination difficulties. Patient also reports     │
│                    │ persistent cough and generalized limb weakness.                                       │
│                    │                                                                                       │
│                    │ Review of systems: Cough productive? No. Dyspnea? No. Weakness proximal/distal?       │
│                    │ Diffuse. Balance issues worse with ambulation.                                        │
│                    │                                                                                       │
│                    │ *** PAST MEDICAL Hx ***                                                               │
│                    │ Cervical spondylosis diagnosed 2024-08-09 (per patient). Hypertension (controlled).   │
│                    │ GERD.                                                                                 │
│                    │                                                                                       │
│                    │ *** MEDICATIONS ***                                                                   │
│                    │ Meloxicam 15mg daily (recent start).                                                  │
│                    │ Gabapentin 300mg TID (recent start).                                                  │
│                    │ Over-the-counter analgesics.                                                          │
│                    │                                                                                       │
│                    │ *** ALLERGIES *|                                                                      │
│                    │ NKDA.                                                                                 │
│                    │                                                                                       │
│                    │ *** REVIEW OF SYSTEMS ***                                                             │
│                    │ MSK: Stiffness worse AM. No bowel/bladder dysfunction noted (critical).               │
│                    │ CV: No chest pain.                                                                    │
│                    │ Pulm: Cough x 2 days, no fever.                                                       │
│                    │ Neuro: Balance concerns. Gait unsteady. Hand grip strength diminished.                │
│                    │                                                                                       │
│                    │ *** PHYSICAL EXAM ***                                                                 │
│                    │ Vitals: BP 138/82, HR 76, RR 16, Temp 98.6.                                           │
│                    │ GENERAL: Well-developed, well-nourished.                                              │
│                    │ NEURO: Alert and oriented x4. Gait assessment: Wide-based, unsteady. Romberg's sign   │
│                    │ positive. Reflexes 2+ at knees/ankles. Bilateral hand grip weakness 4/5.              │
│                    │ MUSCULOSKELETAL: Cervical ROM limited by pain, no nuchal rigidity. Tenderness C5-C7.  │
│                    │ Spurling's test positive right.                                                       │
│                    │ ORTHOPEDIC: Straight leg raise negative.                                              │
│                    │                                                                                       │
│                    │ *** ASSESSMENT ***                                                                    │
│                    │ 1. Cervical spondylosis (exacerbated).                                                │
│                    │ 2. Possible myelopathy (balance/weakness concerns).                                   │
│                    │ 3. Chronic cough/URI vs aspiration risk given neuro status.                           │
│                    │ 4. Muscle deconditioning.                                                             │
│                    │                                                                                       │
│                    │ *** PLAN ***                                                                          │
│                    │ 1. STAT MRI cervical spine without contrast to evaluate for myelopathy/stenosis given │
│                    │ new neuro symptoms.                                                                   │
│                    │ 2. Order Nerve Conduction Studies/EMG.                                                │
│                    │ 3. Prescribe short course Prednisone 40mg daily x 5 days for inflammatory flare.      │
│                    │ 4. Refer to Physical Therapy for gait training and cervical stabilization.            │
│                    │ 5. Prescribe Robitussin AC for cough if persistent > 7 days.                          │
│                    │ 6. Follow-up in 2 weeks to re-evaluate neuro status.                                  │
│                    │ 7. Patient educated on fall precautions due to balance issues.                        │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ first_name         │ Dennis                                                                                │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ last_name          │ Anderson                                                                              │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ dob                │ 2000-07-25                                                                            │
├────────────────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ physician          │ Dr. Arnold                                                                            │
└────────────────────┴───────────────────────────────────────────────────────────────────────────────────────┘
                                                                                                              
Python
1# The preview dataset is available as a pandas DataFrame.
2preview.dataset
3
Output
diagnosis patient_summary patient_sampler doctor_sampler patient_id symptom_onset_date date_of_visit dob first_name last_name physician physician_notes
0 cervical spondylosis I've been having a lot of pain in my neck and ... {'uuid': '5083e205-e985-4a4f-baa2-c72276775e86... {'uuid': '202cb76e-eb04-4165-ae49-61e1b454f2d6... PT-3729E832 2024-08-09T00:00:00 2024-08-11T00:00:00 2000-07-25 Dennis Anderson Dr. Arnold --- INITIALS: NA\n--- DATE: 2024-08-11\n--- PA...
1 impetigo I have a rash on my face that is getting worse... {'uuid': '6aab267a-23df-4f8e-9fe5-f57d1438f541... {'uuid': '1aaee279-5563-404c-bc59-e9ab5d655e71... PT-419AD8DD 2024-04-11T00:00:00 2024-05-07T00:00:00 1916-09-12 Brian Thompson Dr. Cross **Patient:** Brian Thompson\n**Date of Visit:*...

📊 Analyze the generated data

  • Data Designer automatically generates a basic statistical analysis of the generated data.

  • This analysis is available via the analysis property of generation result objects.

Python
1# Print the analysis as a table.
2preview.analysis.to_report()
3
Output
──────────────────────────────────────── 🎨 Data Designer Dataset Profile ─────────────────────────────────────────

                                                                                                                   
                                                 Dataset Overview                                                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ number of records               ┃ number of columns               ┃ percent complete records                    ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 2                               │ 12                              │ 100.0%                                      │
└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                              🌱 Seed-Dataset Columns                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                          ┃               data type ┃                           number unique values ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ diagnosis                            │                  string │                                     2 (100.0%) │
├──────────────────────────────────────┼─────────────────────────┼────────────────────────────────────────────────┤
│ patient_summary                      │                  string │                                     2 (100.0%) │
└──────────────────────────────────────┴─────────────────────────┴────────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                                🎲 Sampler Columns                                                 
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                   ┃       data type ┃             number unique values ┃               sampler type ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ patient_sampler               │            dict │                       2 (100.0%) │          person_from_faker │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ doctor_sampler                │            dict │                       2 (100.0%) │          person_from_faker │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ patient_id                    │          string │                       2 (100.0%) │                       uuid │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ symptom_onset_date            │          string │                       2 (100.0%) │                   datetime │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ date_of_visit                 │          string │                       2 (100.0%) │                  timedelta │
└───────────────────────────────┴─────────────────┴──────────────────────────────────┴────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                                📝 LLM-Text Columns                                                
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                       ┃               ┃                            ┃     prompt tokens ┃      completion tokens ┃
┃ column name           ┃     data type ┃       number unique values ┃        per record ┃             per record ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ physician_notes       │        string │                 2 (100.0%) │     134.0 +/- 4.0 │        483.0 +/- 164.1 │
└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘
                                                                                                                   
                                                                                                                   
                                               🧩 Expression Columns                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                    ┃                 data type ┃                               number unique values ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ first_name                     │                    string │                                         2 (100.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ last_name                      │                    string │                                         2 (100.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ dob                            │                    string │                                         2 (100.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ physician                      │                    string │                                         2 (100.0%) │
└────────────────────────────────┴───────────────────────────┴────────────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
╭────────────────────────────────────────────────── Table Notes ──────────────────────────────────────────────────╮
│                                                                                                                 │
│  1. All token statistics are based on a sample of max(1000, len(dataset)) records.                              │
│  2. Tokens are calculated using tiktoken's cl100k_base tokenizer.                                               │
│                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
                                                                                                                   
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

🆙 Scale up!

  • Happy with your preview data?

  • Use the create method to submit larger Data Designer generation jobs.

Python
1results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-3")
2
Output
[19:56:49] [INFO] OpenTelemetry metrics available at http://127.0.0.1:9464/metrics
[19:56:49] [INFO] 🎨 Creating Data Designer dataset
[19:56:49] [INFO]   |-- 🔒 Jinja rendering engine: secure
[19:56:49] [INFO] ✅ Validation passed
[19:56:49] [INFO] ⛓️ Sorting column configs into a Directed Acyclic Graph
[19:56:49] [INFO] Skipping model health checks because DATA_DESIGNER_SKIP_MODEL_HEALTH_CHECKS=1
[19:56:49] [INFO] ⚡ Using async task-queue builder
[19:56:49] [INFO] 📝 llm-text model config for column 'physician_notes'
[19:56:49] [INFO]   |-- model: 'nvidia/nemotron-3.5-lightning-30b-a3b'
[19:56:49] [INFO]   |-- model alias: 'nemotron-lightning'
[19:56:49] [INFO]   |-- model provider: 'nvidia'
[19:56:49] [INFO]   |-- inference parameters:
[19:56:49] [INFO]   |  |-- generation_type=chat-completion
[19:56:49] [INFO]   |  |-- max_parallel_requests=4
[19:56:49] [INFO]   |  |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[19:56:49] [INFO]   |  |-- temperature=1.00
[19:56:49] [INFO]   |  |-- top_p=0.95
[19:56:49] [INFO]   |  |-- max_tokens=2048
[19:56:49] [INFO] ⚡️ Async generation: 1 column(s) (column 'physician_notes'), 10 tasks across 1 row group(s)
[19:56:49] [INFO] 🚀 (1/1) Dispatching with 10 records
[19:56:49] [INFO] 🎲 (1/1) Preparing samplers to generate 10 records across 5 columns
[19:56:49] [INFO] 🌱 (1/1) Sampling 10 records from seed dataset
[19:56:49] [INFO]   |-- seed dataset size: 820 records
[19:56:49] [INFO]   |-- sampling strategy: ordered
[19:56:49] [INFO] 🧩 (1/1) Generating column `dob` from expression
[19:56:49] [INFO] 🧩 (1/1) Generating column `first_name` from expression
[19:56:49] [INFO] 🧩 (1/1) Generating column `last_name` from expression
[19:56:49] [INFO] 🧩 (1/1) Generating column `physician` from expression
[19:56:58] [INFO] 📊 Progress [8.3s]:
[19:56:58] [INFO]   |-- 🌘 column 'physician_notes': 4/10 (40%) 0.5 rec/s
[19:57:03] [INFO] 📊 Progress [13.4s]:
[19:57:03] [INFO]   |-- 🌕 column 'physician_notes': 10/10 (100%) 0.7 rec/s
[19:57:03] [INFO] ✅ Async generation complete [13.4s]: 10 ok, 0 failed across 1 column(s)
[19:57:03] [INFO] 📊 Model usage summary:
[19:57:03] [INFO]   |-- model: nvidia/nemotron-3.5-lightning-30b-a3b
[19:57:03] [INFO]   |-- tokens: input=1620, output=4365, reasoning=0, total=5985, tps=438
[19:57:03] [INFO]   |-- requests: success=10, failed=0, total=10, rpm=43
[19:57:03] [INFO] 📐 Measuring dataset column statistics:
[19:57:03] [INFO]   |-- 🎲 column: 'patient_sampler'
[19:57:03] [INFO]   |-- 🎲 column: 'doctor_sampler'
[19:57:03] [INFO]   |-- 🎲 column: 'patient_id'
[19:57:03] [INFO]   |-- 🧩 column: 'first_name'
[19:57:03] [INFO]   |-- 🧩 column: 'last_name'
[19:57:03] [INFO]   |-- 🧩 column: 'dob'
[19:57:03] [INFO]   |-- 🎲 column: 'symptom_onset_date'
[19:57:03] [INFO]   |-- 🎲 column: 'date_of_visit'
[19:57:03] [INFO]   |-- 🧩 column: 'physician'
[19:57:03] [INFO]   |-- 📝 column: 'physician_notes'
[19:57:03] [INFO]   |-- 🌱 column: 'diagnosis'
[19:57:03] [INFO]   |-- 🌱 column: 'patient_summary'
Python
1# Load the generated dataset as a pandas DataFrame.
2dataset = results.load_dataset()
3
4dataset.head()
5
Output
patient_sampler doctor_sampler patient_id symptom_onset_date date_of_visit dob first_name last_name diagnosis patient_summary physician physician_notes
0 {'uuid': '109c1a1e-8ee9-481f-991e-5efb57c8d973... {'uuid': '6db12f8d-a1b7-4c0a-8f01-4ede178d8e71... PT-724926B3 2024-07-16T00:00:00 2024-08-13T00:00:00 1922-03-26 Jennifer Brooks cervical spondylosis I've been having a lot of pain in my neck and ... Dr. Marshall JENNY BROOKS NEW SYMPTOM: BALANCE & COORDINATI...
1 {'uuid': '69a746c9-7b92-4b12-b03a-666f3e15bd6d... {'uuid': '41fb0ae2-db7e-439c-9e6a-75f6c24cdc3f... PT-54CF9E4C 2024-11-17T00:00:00 2024-11-19T00:00:00 1960-04-24 Bethany Martinez impetigo I have a rash on my face that is getting worse... Dr. Mcintosh **Patient:** Bethany Martinez   **Date:** 2024...
2 {'uuid': '63b9fa57-ec6a-42e1-bc19-f2e06ebfa0d0... {'uuid': '2badd856-f0b3-4355-a887-9610f157b07a... PT-39A0117F 2024-04-17T00:00:00 2024-04-30T00:00:00 1917-06-14 Cameron Miller urinary tract infection I have been urinating blood. I sometimes feel ... Dr. Huynh **APPOINTMENT NOTES** **Patient:** Cameron Mi...
3 {'uuid': '9573fb6c-3952-43b0-86da-4f3df93d66ea... {'uuid': 'a8ccb44c-ab3d-426f-9286-56c8f66bf88c... PT-DAF1A820 2024-05-28T00:00:00 2024-06-05T00:00:00 1994-04-13 Cheryl Odom arthritis I have been having trouble with my muscles and... Dr. Christensen PRIMARY CARE CLINIC DR. MARK CHRISTENSEN VISIT...
4 {'uuid': 'aa5011f7-9555-4469-8310-5d844e108daf... {'uuid': '7f61486d-9823-4f9d-be56-2e84fb2fbd2a... PT-1027F73F 2024-01-06T00:00:00 2024-01-07T00:00:00 1931-02-08 Sophia Stone dengue I have been feeling really sick. My body hurts... Dr. Crosby **Patient:** Sophia Stone   **Date:** 2024-01-...
Python
1# Load the analysis results into memory.
2analysis = results.load_analysis()
3
4analysis.to_report()
5
Output
──────────────────────────────────────── 🎨 Data Designer Dataset Profile ─────────────────────────────────────────

                                                                                                                   
                                                 Dataset Overview                                                  
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ number of records               ┃ number of columns               ┃ percent complete records                    ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 10                              │ 12                              │ 100.0%                                      │
└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                              🌱 Seed-Dataset Columns                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                          ┃               data type ┃                           number unique values ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ diagnosis                            │                  string │                                      7 (70.0%) │
├──────────────────────────────────────┼─────────────────────────┼────────────────────────────────────────────────┤
│ patient_summary                      │                  string │                                    10 (100.0%) │
└──────────────────────────────────────┴─────────────────────────┴────────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                                🎲 Sampler Columns                                                 
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                   ┃       data type ┃             number unique values ┃               sampler type ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ patient_sampler               │            dict │                      10 (100.0%) │          person_from_faker │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ doctor_sampler                │            dict │                      10 (100.0%) │          person_from_faker │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ patient_id                    │          string │                      10 (100.0%) │                       uuid │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ symptom_onset_date            │          string │                      10 (100.0%) │                   datetime │
├───────────────────────────────┼─────────────────┼──────────────────────────────────┼────────────────────────────┤
│ date_of_visit                 │          string │                        9 (90.0%) │                  timedelta │
└───────────────────────────────┴─────────────────┴──────────────────────────────────┴────────────────────────────┘
                                                                                                                   
                                                                                                                   
                                                📝 LLM-Text Columns                                                
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                       ┃               ┃                            ┃     prompt tokens ┃      completion tokens ┃
┃ column name           ┃     data type ┃       number unique values ┃        per record ┃             per record ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ physician_notes       │        string │                10 (100.0%) │     132.5 +/- 4.8 │        406.0 +/- 152.0 │
└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘
                                                                                                                   
                                                                                                                   
                                               🧩 Expression Columns                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ column name                    ┃                 data type ┃                               number unique values ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ first_name                     │                    string │                                        10 (100.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ last_name                      │                    string │                                          9 (90.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ dob                            │                    string │                                        10 (100.0%) │
├────────────────────────────────┼───────────────────────────┼────────────────────────────────────────────────────┤
│ physician                      │                    string │                                        10 (100.0%) │
└────────────────────────────────┴───────────────────────────┴────────────────────────────────────────────────────┘
                                                                                                                   
                                                                                                                   
╭────────────────────────────────────────────────── Table Notes ──────────────────────────────────────────────────╮
│                                                                                                                 │
│  1. All token statistics are based on a sample of max(1000, len(dataset)) records.                              │
│  2. Tokens are calculated using tiktoken's cl100k_base tokenizer.                                               │
│                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
                                                                                                                   
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

⏭️ Next Steps

Check out the following notebook to learn more about: