๐จ 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.configprovides access to the configuration API.DataDesigneris the main interface for data generation.
import data_designer.config as dd
from data_designer.interface import DataDesigner
โ๏ธ Initialize the Data Designer interfaceยถ
DataDesigneris the main object is responsible for managing the data generation process.When initialized without arguments, the default model providers are used.
data_designer = DataDesigner()
๐๏ธ Define model configurationsยถ
Each
ModelConfigdefines 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.
# This name is set in the model provider configuration.
MODEL_PROVIDER = "nvidia"
# The model ID is from build.nvidia.com.
MODEL_ID = "nvidia/nemotron-3-nano-30b-a3b"
# We choose this alias to be descriptive for our use case.
MODEL_ALIAS = "nemotron-nano-v3"
model_configs = [
dd.ModelConfig(
alias=MODEL_ALIAS,
model=MODEL_ID,
provider=MODEL_PROVIDER,
inference_parameters=dd.ChatCompletionInferenceParams(
temperature=1.0,
top_p=1.0,
max_tokens=2048,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
),
)
]
๐๏ธ 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.
config_builder = dd.DataDesignerConfigBuilder(model_configs=model_configs)
๐ฅ 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.
We already have the dataset downloaded in the data directory of this repository.
๐ฑ 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.
# Download sample dataset from Github
import urllib.request
url = "https://raw.githubusercontent.com/NVIDIA/GenerativeAIExamples/refs/heads/main/nemo/NeMo-Data-Designer/data/gretelai_symptom_to_diagnosis.csv"
local_filename, _ = urllib.request.urlretrieve(url, "gretelai_symptom_to_diagnosis.csv")
# Seed datasets are passed as reference objects to the config builder.
seed_source = dd.LocalFileSeedSource(path=local_filename)
config_builder.with_seed_dataset(seed_source)
DataDesignerConfigBuilder()
๐จ Designing our synthetic patient notes datasetยถ
Here we use
add_columnwith keyword arguments (rather than imported config objects).Generally, we recommend using concrete objects, but this is a convenient shorthand.
Note: 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
config_builder.add_column(
name="patient_sampler",
column_type="sampler",
sampler_type="person_from_faker",
)
config_builder.add_column(
name="doctor_sampler",
column_type="sampler",
sampler_type="person_from_faker",
)
config_builder.add_column(
name="patient_id",
column_type="sampler",
sampler_type="uuid",
params={
"prefix": "PT-",
"short_form": True,
"uppercase": True,
},
)
config_builder.add_column(
name="first_name",
column_type="expression",
expr="{{ patient_sampler.first_name}}",
)
config_builder.add_column(
name="last_name",
column_type="expression",
expr="{{ patient_sampler.last_name }}",
)
config_builder.add_column(
name="dob",
column_type="expression",
expr="{{ patient_sampler.birth_date }}",
)
config_builder.add_column(
name="symptom_onset_date",
column_type="sampler",
sampler_type="datetime",
params={"start": "2024-01-01", "end": "2024-12-31"},
)
config_builder.add_column(
name="date_of_visit",
column_type="sampler",
sampler_type="timedelta",
params={"dt_min": 1, "dt_max": 30, "reference_column_name": "symptom_onset_date"},
)
config_builder.add_column(
name="physician",
column_type="expression",
expr="Dr. {{ doctor_sampler.last_name }}",
)
config_builder.add_column(
name="physician_notes",
column_type="llm-text",
prompt="""\
You are a primary-care physician who just had an appointment with {{ first_name }} {{ last_name }},
who has been struggling with symptoms from {{ diagnosis }} since {{ symptom_onset_date }}.
The date of today's visit is {{ date_of_visit }}.
{{ patient_summary }}
Write careful notes about your visit with {{ first_name }},
as Dr. {{ doctor_sampler.first_name }} {{ doctor_sampler.last_name }}.
Format the notes as a busy doctor might.
Respond with only the notes, no other text.
""",
model_alias=MODEL_ALIAS,
)
data_designer.validate(config_builder)
[03:45:08] [INFO] โ Validation passed
๐ Iteration is key โย preview the dataset!ยถ
Use the
previewmethod to generate a sample of records quickly.Inspect the results for quality and format issues.
Adjust column configurations, prompts, or parameters as needed.
Re-run the preview until satisfied.
preview = data_designer.preview(config_builder, num_records=2)
[03:45:08] [INFO] ๐ธ Preview generation in progress
[03:45:08] [INFO] โ Validation passed
[03:45:08] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[03:45:08] [INFO] ๐ฉบ Running health checks for models...
[03:45:08] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[03:45:09] [INFO] |-- โ Passed!
[03:45:09] [INFO] ๐ฑ Sampling 2 records from seed dataset
[03:45:09] [INFO] |-- seed dataset size: 820 records
[03:45:09] [INFO] |-- sampling strategy: ordered
[03:45:09] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[03:45:09] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[03:45:09] [INFO] ๐งฉ Generating column `first_name` from expression
[03:45:09] [INFO] ๐งฉ Generating column `last_name` from expression
[03:45:09] [INFO] ๐งฉ Generating column `dob` from expression
[03:45:09] [INFO] ๐งฉ Generating column `physician` from expression
[03:45:09] [INFO] ๐ llm-text model config for column 'physician_notes'
[03:45:09] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[03:45:09] [INFO] |-- model alias: 'nemotron-nano-v3'
[03:45:09] [INFO] |-- model provider: 'nvidia'
[03:45:09] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[03:45:09] [INFO] ๐ Processing llm-text column 'physician_notes' with 4 concurrent workers
[03:45:09] [INFO] ๐งญ llm-text column 'physician_notes' will report progress every 1 record(s).
[03:45:14] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 1/2 (50%) complete, 1 ok, 0 failed, 0.19 rec/s, eta 5.3s
[03:45:18] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 2/2 (100%) complete, 2 ok, 0 failed, 0.21 rec/s, eta 0.0s
[03:45:18] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 291,
"output_tokens": 1939,
"total_tokens": 2230
},
"request_usage": {
"successful_requests": 2,
"failed_requests": 0,
"total_requests": 2
},
"tokens_per_second": 227,
"requests_per_minute": 12
}
}
[03:45:18] [INFO] ๐ Measuring dataset column statistics:
[03:45:18] [INFO] |-- ๐ฒ column: 'patient_sampler'
[03:45:19] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[03:45:19] [INFO] |-- ๐ฒ column: 'patient_id'
[03:45:19] [INFO] |-- ๐งฉ column: 'first_name'
[03:45:19] [INFO] |-- ๐งฉ column: 'last_name'
[03:45:19] [INFO] |-- ๐งฉ column: 'dob'
[03:45:19] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[03:45:19] [INFO] |-- ๐ฒ column: 'date_of_visit'
[03:45:19] [INFO] |-- ๐งฉ column: 'physician'
[03:45:19] [INFO] |-- ๐ column: 'physician_notes'
[03:45:19] [INFO] โ๏ธ Preview complete!
# Run this cell multiple times to cycle through the 2 preview records.
preview.display_sample_record()
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': 'df05f8d2-ee3d-465d-8306-9aef508951eb', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Christine', โ โ โ 'last_name': 'Stewart', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Female', โ โ โ 'street_number': '05270', โ โ โ 'street_name': 'Jacob Manors', โ โ โ 'city': 'Theresastad', โ โ โ 'state': 'Connecticut', โ โ โ 'postcode': '72914', โ โ โ 'age': 80, โ โ โ 'birth_date': '1945-11-03', โ โ โ 'country': 'Lithuania', โ โ โ 'marital_status': 'separated', โ โ โ 'education_level': 'doctorate', โ โ โ 'unit': '', โ โ โ 'occupation': 'Psychologist, forensic', โ โ โ 'phone_number': '001-818-506-5599x509', โ โ โ 'bachelors_field': 'business' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ { โ โ โ 'uuid': 'f88ddd36-7f11-4f6b-88fd-d148a21c8107', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Amy', โ โ โ 'last_name': 'Webster', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Female', โ โ โ 'street_number': '1844', โ โ โ 'street_name': 'Jacob Way', โ โ โ 'city': 'East Alice', โ โ โ 'state': 'California', โ โ โ 'postcode': '39493', โ โ โ 'age': 98, โ โ โ 'birth_date': '1927-09-03', โ โ โ 'country': 'Cocos (Keeling) Islands', โ โ โ 'marital_status': 'never_married', โ โ โ 'education_level': 'graduate', โ โ โ 'unit': '', โ โ โ 'occupation': 'Recycling officer', โ โ โ 'phone_number': '8933832839', โ โ โ 'bachelors_field': 'business' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ PT-E644C5D3 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ 2024-03-25 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ 2024-04-16 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ first_name โ Christine โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ Stewart โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ 1945-11-03 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ Dr. Webster โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician_notes โ **Visit Note - 2024-04-16** โ โ โ **Pt:** Christine Stewart | **DOB:** [REDACTED] | **MRN:** [REDACTED] โ โ โ **Provider:** Dr. A. Webster (MD, Internal Med) โ โ โ **Chief Complaint:** "Worsening neck/back pain, balance issues, cough, limb weakness." โ โ โ โ โ โ --- โ โ โ โ โ โ **HISTORY OF PRESENT ILLNESS (HPI):** โ โ โ - 69 y/o F with known **cervical spondylosis** (dx 2024-03-25). โ โ โ - Reports **exacerbation of chronic neck/back pain** (now constant, 7/10, throbbing, โ โ โ radicular to R arm). โ โ โ - **New-onset symptoms (4โ6 weeks):** โ โ โ - **Balance instability:** Frequent near-falls, requires handrails; denies syncopal โ โ โ episodes. โ โ โ - **Lower extremity weakness:** Difficulty rising from chair, "wobbly" legs; no falls. โ โ โ - **Arm paresthesia/numbness:** R hand tingling, drop objects. โ โ โ - **Cough:** New dry cough (10 days), worse at night; denies fever/URI. โ โ โ - **Systemic:** Fatigue, mild SOB with exertion. โ โ โ - **No trauma**, recent falls, or urinary symptoms. โ โ โ - **Denies** fever, weight loss, bowel/bladder changes. โ โ โ - **PMH:** Hypertension (controlled), osteoporosis (DXA 2022). โ โ โ - **Medications:** Lisinopril 10mg daily, calcium/vit D. โ โ โ - **No prior imaging** for current exacerbation. โ โ โ โ โ โ --- โ โ โ โ โ โ **PHYSICAL EXAM (KEY FINDINGS):** โ โ โ - **Vitals:** BP 138/84, HR 78, RR 16, SpOโ 96% RA. โ โ โ - **Neuro:** โ โ โ - **Gait:** Unsteady,wide-based; requires assistance to ambulate. โ โ โ - **Strength:** R UE 4/5 (prox weakness), L UE 5/5; LL 4/5 (prox) vs. 5/5 (distal). โ โ โ - **Reflexes:** Hyperreflexia R patellar, increased tone in R UE. โ โ โ - **Sensory:** Decreased light touch/pinprick R C6โT1 dermatomes. โ โ โ - **Coordination:** Dysmetria R UE, L UE normal. โ โ โ - **Cough:** Productive, no hemoptysis. โ โ โ - **Musculoskeletal:** โ โ โ - **Neck:** Limited ROM (flexion/extension), tenderness at C5โC6 (no crepitus). โ โ โ - **Back:** Paraspinal tenderness T7โL1, no edema. โ โ โ - **Spine:** Positive **Bragardโs test** (suggests cervical myelopathy), **Spurlingโs โ โ โ test** positive R upper extremity. โ โ โ - **General:** Alert, anxious; notes "pain worse with movement." โ โ โ โ โ โ --- โ โ โ โ โ โ **ASSESSMENT:** โ โ โ 1. **Cervical spondylosis exacerbation** with **progressive myelopathy** (based on neuro โ โ โ deficits: weakness, hyperreflexia, gait instability, sensory level). โ โ โ 2. **New-onset chronic cough** (likely unrelated; rule out infection/inflammation). โ โ โ 3. **Osteoporosis with fall risk** (paraspinal tenderness + gait instability). โ โ โ 4. **Anxiety** (secondary to symptom burden; noted in HPI). โ โ โ โ โ โ --- โ โ โ โ โ โ **PLAN:** โ โ โ - **A. Immediate Referrals:** โ โ โ - **Neurology:** Urgent consult for cervical myelopathy evaluation (order **MRI cervical โ โ โ spine with/without contrast**). โ โ โ - **PT/OT:** Fall risk assessment + gait training (emphasize safety). โ โ โ - **B. Diagnostic Workup:** โ โ โ - **CBC/CMP:** Rule out inflammatory/other etiology for cough. โ โ โ - **Chest X-ray:** Evaluate cough etiology (rule out bronchitis/pneumonia). โ โ โ - **Vitamin D/B12:** Check for deficiencies contributing to weakness. โ โ โ - **C. Symptom Management:** โ โ โ - **Pain:** Continue naproxen 500mg BID (OTC) + apply heat/cold. *Avoid NSAIDs if renal โ โ โ risk*. โ โ โ - **Cough:** OTC dextromethorphan PRN (no antihistamines). โ โ โ - **Safety:** Home safety evaluation (grab bars, non-slip mats). โ โ โ - **D. Follow-up:** โ โ โ - **Neurology appointment:** Schedule within 7 days. โ โ โ - **Follow-up visit:** 4 weeks post-MRI results. โ โ โ - **Patient education:** Warn against neck hyperextension; avoid heavy lifting. โ โ โ - **E. Documentation:** โ โ โ - **"Bragardโs test positive"** noted; **Spurlingโs test positive** for radiculopathy. โ โ โ - **Emphasized urgency** for MRI due to gait instability/weakness. โ โ โ โ โ โ --- โ โ โ โ โ โ **SIGNATURE:** โ โ โ *A. Webster, MD* โ โ โ *Internal Medicine* โ โ โ *Date: 2024-04-16* โ โ โ โ โ โ --- โ โ โ **NOTE TO SELF:** *Prioritize MRI cervical spine before neurology follow-up. Monitor cough โ โ โ for progression.* โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [index: 0]
# The preview dataset is available as a pandas DataFrame.
preview.dataset
| diagnosis | patient_summary | patient_sampler | doctor_sampler | patient_id | symptom_onset_date | date_of_visit | first_name | last_name | dob | physician | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | cervical spondylosis | I've been having a lot of pain in my neck and ... | {'uuid': 'df05f8d2-ee3d-465d-8306-9aef508951eb... | {'uuid': 'f88ddd36-7f11-4f6b-88fd-d148a21c8107... | PT-E644C5D3 | 2024-03-25 | 2024-04-16 | Christine | Stewart | 1945-11-03 | Dr. Webster | **Visit Note - 2024-04-16** \n**Pt:** Christi... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'uuid': '40899dd6-f517-4bb4-a2a6-1320e8e06108... | {'uuid': 'e9b98717-b355-4289-8ed7-359710e96f3d... | PT-C34368F0 | 2024-08-13 | 2024-09-02 | Jessica | Baker | 1983-08-01 | Dr. Hayden | *2024-09-02 | J. Baker, 34F | Impetigo exacerb... |
๐ Analyze the generated dataยถ
Data Designer automatically generates a basic statistical analysis of the generated data.
This analysis is available via the
analysisproperty of generation result objects.
# Print the analysis as a table.
preview.analysis.to_report()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐จ Data Designer Dataset Profile โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Dataset Overview โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ number of records โ number of columns โ percent complete records โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ 2 โ 10 โ 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%) โ 122.0 +/- 4.0 โ 901.5 +/- 351.4 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ 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
createmethod to submit larger Data Designer generation jobs.
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-3")
[03:45:19] [INFO] ๐จ Creating Data Designer dataset
[03:45:19] [INFO] โ Validation passed
[03:45:19] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[03:45:19] [INFO] ๐ฉบ Running health checks for models...
[03:45:19] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[03:45:19] [INFO] |-- โ Passed!
[03:45:19] [INFO] โณ Processing batch 1 of 1
[03:45:19] [INFO] ๐ฑ Sampling 10 records from seed dataset
[03:45:19] [INFO] |-- seed dataset size: 820 records
[03:45:19] [INFO] |-- sampling strategy: ordered
[03:45:19] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[03:45:19] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[03:45:19] [INFO] ๐งฉ Generating column `first_name` from expression
[03:45:19] [INFO] ๐งฉ Generating column `last_name` from expression
[03:45:19] [INFO] ๐งฉ Generating column `dob` from expression
[03:45:19] [INFO] ๐งฉ Generating column `physician` from expression
[03:45:19] [INFO] ๐ llm-text model config for column 'physician_notes'
[03:45:19] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[03:45:19] [INFO] |-- model alias: 'nemotron-nano-v3'
[03:45:19] [INFO] |-- model provider: 'nvidia'
[03:45:19] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[03:45:19] [INFO] ๐ Processing llm-text column 'physician_notes' with 4 concurrent workers
[03:45:19] [INFO] ๐งญ llm-text column 'physician_notes' will report progress every 1 record(s).
[03:45:23] [INFO] |-- ๐ง๏ธ llm-text column 'physician_notes' progress: 1/10 (10%) complete, 1 ok, 0 failed, 0.31 rec/s, eta 29.4s
[03:45:27] [INFO] |-- ๐ง๏ธ llm-text column 'physician_notes' progress: 2/10 (20%) complete, 2 ok, 0 failed, 0.26 rec/s, eta 30.8s
[03:45:28] [INFO] |-- ๐ฆ๏ธ llm-text column 'physician_notes' progress: 3/10 (30%) complete, 3 ok, 0 failed, 0.35 rec/s, eta 20.3s
[03:45:28] [INFO] |-- ๐ฆ๏ธ llm-text column 'physician_notes' progress: 4/10 (40%) complete, 4 ok, 0 failed, 0.46 rec/s, eta 13.2s
[03:45:28] [INFO] |-- โ llm-text column 'physician_notes' progress: 5/10 (50%) complete, 5 ok, 0 failed, 0.55 rec/s, eta 9.1s
[03:45:34] [INFO] |-- โ llm-text column 'physician_notes' progress: 6/10 (60%) complete, 6 ok, 0 failed, 0.41 rec/s, eta 9.8s
[03:45:35] [INFO] |-- โ llm-text column 'physician_notes' progress: 7/10 (70%) complete, 7 ok, 0 failed, 0.46 rec/s, eta 6.5s
[03:45:36] [INFO] |-- ๐ค๏ธ llm-text column 'physician_notes' progress: 8/10 (80%) complete, 8 ok, 0 failed, 0.48 rec/s, eta 4.1s
[03:45:36] [INFO] |-- ๐ค๏ธ llm-text column 'physician_notes' progress: 9/10 (90%) complete, 9 ok, 0 failed, 0.53 rec/s, eta 1.9s
[03:45:41] [INFO] |-- โ๏ธ llm-text column 'physician_notes' progress: 10/10 (100%) complete, 10 ok, 0 failed, 0.47 rec/s, eta 0.0s
[03:45:41] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 1433,
"output_tokens": 9017,
"total_tokens": 10450
},
"request_usage": {
"successful_requests": 10,
"failed_requests": 0,
"total_requests": 10
},
"tokens_per_second": 483,
"requests_per_minute": 27
}
}
[03:45:41] [INFO] ๐ Measuring dataset column statistics:
[03:45:41] [INFO] |-- ๐ฒ column: 'patient_sampler'
[03:45:41] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[03:45:41] [INFO] |-- ๐ฒ column: 'patient_id'
[03:45:41] [INFO] |-- ๐งฉ column: 'first_name'
[03:45:41] [INFO] |-- ๐งฉ column: 'last_name'
[03:45:41] [INFO] |-- ๐งฉ column: 'dob'
[03:45:41] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[03:45:41] [INFO] |-- ๐ฒ column: 'date_of_visit'
[03:45:41] [INFO] |-- ๐งฉ column: 'physician'
[03:45:41] [INFO] |-- ๐ column: 'physician_notes'
# Load the generated dataset as a pandas DataFrame.
dataset = results.load_dataset()
dataset.head()
| diagnosis | patient_summary | patient_sampler | doctor_sampler | patient_id | symptom_onset_date | date_of_visit | first_name | last_name | dob | physician | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | cervical spondylosis | I've been having a lot of pain in my neck and ... | {'age': 44, 'bachelors_field': 'no_degree', 'b... | {'age': 28, 'bachelors_field': 'no_degree', 'b... | PT-9D293E48 | 2024-10-20 | 2024-11-17 | Tammy | Thomas | 1981-07-26 | Dr. Rodgers | **Dr. Denise Rodgers โ 2024-11-17 โ Clinic: Pr... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'age': 92, 'bachelors_field': 'no_degree', 'b... | {'age': 42, 'bachelors_field': 'business', 'bi... | PT-72CEDFA8 | 2024-08-02 | 2024-08-07 | Karen | Williams | 1933-12-03 | Dr. Vazquez | HALLPASS **Encounter:** New rash exacerbatio... |
| 2 | urinary tract infection | I have been urinating blood. I sometimes feel ... | {'age': 76, 'bachelors_field': 'no_degree', 'b... | {'age': 56, 'bachelors_field': 'no_degree', 'b... | PT-A9030AF9 | 2024-10-12 | 2024-10-17 | Aaron | Lane | 1949-05-26 | Dr. Cole | **Patient:** Aaron Lane **DOB:** 03/15/1992 ... |
| 3 | arthritis | I have been having trouble with my muscles and... | {'age': 78, 'bachelors_field': 'no_degree', 'b... | {'age': 92, 'bachelors_field': 'no_degree', 'b... | PT-99C6A54D | 2024-03-06 | 2024-03-23 | Kevin | Riggs | 1948-01-18 | Dr. Hale | **SOAP NOTE** **Patient:** Kevin Riggs **D... |
| 4 | dengue | I have been feeling really sick. My body hurts... | {'age': 56, 'bachelors_field': 'no_degree', 'b... | {'age': 108, 'bachelors_field': 'stem_related'... | PT-F2AE4540 | 2024-11-07 | 2024-11-10 | Jennifer | Jackson | 1969-11-07 | Dr. Summers | SOB: Malaise, 3-day low-grade fever (max 101.2... |
# Load the analysis results into memory.
analysis = results.load_analysis()
analysis.to_report()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐จ Data Designer Dataset Profile โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Dataset Overview โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ number of records โ number of columns โ percent complete records โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ 10 โ 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 โ 10 (100.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%) โ 118.5 +/- 5.8 โ 903.5 +/- 274.4 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ first_name โ string โ 10 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ string โ 10 (100.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: