๐จ 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 the essentialsยถ
- The
essentialsmodule provides quick access to the most commonly used objects.
from data_designer.essentials import (
ChatCompletionInferenceParams,
DataDesigner,
DataDesignerConfigBuilder,
LocalFileSeedSource,
ModelConfig,
)
โ๏ธ 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 = [
ModelConfig(
alias=MODEL_ALIAS,
model=MODEL_ID,
provider=MODEL_PROVIDER,
inference_parameters=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 = 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 = 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)
[21:54:28] [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)
[21:54:28] [INFO] ๐ Preview generation in progress
[21:54:28] [INFO] โ Validation passed
[21:54:28] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:54:28] [INFO] ๐ฉบ Running health checks for models...
[21:54:28] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:54:28] [INFO] |-- โ Passed!
[21:54:28] [INFO] ๐ฑ Sampling 2 records from seed dataset
[21:54:28] [INFO] |-- seed dataset size: 820 records
[21:54:28] [INFO] |-- sampling strategy: ordered
[21:54:28] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[21:54:28] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[21:54:28] [INFO] ๐งฉ Generating column `first_name` from expression
[21:54:28] [INFO] ๐งฉ Generating column `last_name` from expression
[21:54:28] [INFO] ๐งฉ Generating column `dob` from expression
[21:54:28] [INFO] ๐งฉ Generating column `physician` from expression
[21:54:28] [INFO] ๐ llm-text model config for column 'physician_notes'
[21:54:28] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:28] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:28] [INFO] |-- model provider: 'nvidia'
[21:54:28] [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
[21:54:28] [INFO] ๐ Processing llm-text column 'physician_notes' with 4 concurrent workers
[21:54:34] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 291,
"output_tokens": 2436,
"total_tokens": 2727
},
"request_usage": {
"successful_requests": 2,
"failed_requests": 0,
"total_requests": 2
},
"tokens_per_second": 492,
"requests_per_minute": 21
}
}
[21:54:34] [INFO] ๐ Measuring dataset column statistics:
[21:54:34] [INFO] |-- ๐ฒ column: 'patient_sampler'
[21:54:34] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[21:54:34] [INFO] |-- ๐ฒ column: 'patient_id'
[21:54:34] [INFO] |-- ๐งฉ column: 'first_name'
[21:54:34] [INFO] |-- ๐งฉ column: 'last_name'
[21:54:34] [INFO] |-- ๐งฉ column: 'dob'
[21:54:34] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[21:54:34] [INFO] |-- ๐ฒ column: 'date_of_visit'
[21:54:34] [INFO] |-- ๐งฉ column: 'physician'
[21:54:34] [INFO] |-- ๐ column: 'physician_notes'
[21:54:34] [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': '56aa27d8-c859-40d4-bea8-54314990bd7c', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Carly', โ โ โ 'last_name': 'Cooper', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Female', โ โ โ 'street_number': '48657', โ โ โ 'street_name': 'Steele Mission', โ โ โ 'city': 'South Jorgeton', โ โ โ 'state': 'Connecticut', โ โ โ 'postcode': '96386', โ โ โ 'age': 58, โ โ โ 'birth_date': '1967-08-25', โ โ โ 'country': 'Sierra Leone', โ โ โ 'marital_status': 'never_married', โ โ โ 'education_level': 'graduate', โ โ โ 'unit': '', โ โ โ 'occupation': 'Child psychotherapist', โ โ โ 'phone_number': '2515908672', โ โ โ 'bachelors_field': 'stem' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ { โ โ โ 'uuid': '3bbe30a9-3925-4219-94de-ed8e57d5d72d', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Brandon', โ โ โ 'last_name': 'Powell', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '558', โ โ โ 'street_name': 'Watson Ramp', โ โ โ 'city': 'Lake James', โ โ โ 'state': 'Maine', โ โ โ 'postcode': '56228', โ โ โ 'age': 81, โ โ โ 'birth_date': '1944-07-25', โ โ โ 'country': 'Nicaragua', โ โ โ 'marital_status': 'never_married', โ โ โ 'education_level': 'some_college', โ โ โ 'unit': '', โ โ โ 'occupation': 'Social research officer, government', โ โ โ 'phone_number': '4544036768', โ โ โ 'bachelors_field': 'no_degree' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ PT-A754975F โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ 2024-05-19 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ 2024-06-13 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ first_name โ Carly โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ Cooper โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ 1967-08-25 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ Dr. Powell โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician_notes โ **Patient:** Carly Cooper โ โ โ **DOB:** [Insert DOB] โ โ โ **MRN:** [Insert MRN] โ โ โ **Visit Date:** 2024โ06โ13 โ โ โ **Reason for Visit:** Followโup cervical spondylosis โ โ โ โ โ โ --- โ โ โ โ โ โ **Chief Complaint:** โ โ โ - Neck and back pain โ โ โ - New onset balance & coordination difficulty โ โ โ - Chronic cough exacerbation โ โ โ - Progressive limb weakness โ โ โ โ โ โ **History of Present Illness (HPI):** โ โ โ - **Onset:** 2024โ05โ19 (initial neck/back discomfort) โ โ โ - **Course:** Gradual worsening; recent increase in severity. โ โ โ - **Pain:** Described as dullโachy, worse with movement; VAS 7/10. โ โ โ - **Neurologic:** Reports โunsteadyโ gait, frequent nearโfalls; difficulty with fine motor โ โ โ tasks. โ โ โ - **Weakness:** Noted subjective weakness in upper extremities; difficulty lifting โ โ โ objects. โ โ โ - **Cough:** Persistent dry cough for 2โฏmonths; no wheeze or sputum. โ โ โ - **Medications:** Current regimen โ ibuprofen 600โฏmg TID, gabapentin 300โฏmg QHS, cough โ โ โ syrup PRN. โ โ โ - **Triggers/Aggravating factors:** Prolonged sitting, overhead reaching. โ โ โ - **Relieving factors:** Rest, gentle stretching, heat application. โ โ โ - **Associated symptoms:** Occasional numbness in fingertips; no bowel/bladder changes. โ โ โ โ โ โ **Past Medical History (PMH):** โ โ โ - Cervical spondylosis (diagnosed 2023) โ โ โ - Hypertension (controlled) โ โ โ - GERD โ โ โ โ โ โ **Past Surgical History (PSH):** โ โ โ - None โ โ โ โ โ โ **Family History (FH):** โ โ โ - Mother: Hypertension, osteoarthritis โ โ โ - Father: Deceased (MI at 68) โ โ โ - Siblings: No known genetic disorders โ โ โ โ โ โ **Social History (SH):** โ โ โ - **Tobacco:** Never smoker โ โ โ - **Alcohol:** 1โ2 glasses wine/week โ โ โ - **Illicit drugs:** Denies use โ โ โ - **Occupation:** Graphic designer (sedentary, prolonged computer use) โ โ โ - **Exercise:** Walks 2โฏtimes/week; limited by pain โ โ โ โ โ โ **Review of Systems (ROS):** โ โ โ - **Neurologic:** Balance issues, hand weakness, occasional tingling. โ โ โ - **Respiratory:** Chronic cough; no dyspnea, fever, chest pain. โ โ โ - **Musculoskeletal:** Neck/back pain, stiffness; improves with rest. โ โ โ - **Skin:** No rashes. โ โ โ - **GI/ GU:** No changes. โ โ โ โ โ โ **Physical Examination:** โ โ โ - **General:** Alert, oriented ร3, wellโgroomed. โ โ โ - **Vitals:** BP 128/78โฏmmHg, HR 72โฏbpm, RR 16, Temp 98.4โฏยฐF, SpOโ 98% RA. โ โ โ - **HEENT:** Normocephalic, atraumatic; no cervical lymphadenopathy. โ โ โ - **Neck:** Limited flexion/extension due to pain; no crepitus. โ โ โ - **Thoracic Spine:** Tenderness over C5โC7; paravertebral muscle spasm. โ โ โ - **Extremities:** โ โ โ - Upper: 4/5 strength in shoulder abductors; 4/5 in elbow flexion. โ โ โ - Lower: 5/5 strength, normal reflexes. โ โ โ - **Neurologic:** โ โ โ - Cranial nerves IIโXII intact. โ โ โ - Positive Romberg sign; mild dysmetria on fingerโnose testing. โ โ โ - Decreased sensation to light touch in C5 dermatome bilaterally. โ โ โ - **Cardiovascular:** Regular rate/rhythm; no murmurs. โ โ โ - **Respiratory:** Clear to auscultation bilaterally; no wheezes. โ โ โ โ โ โ **Assessment / Differential Diagnosis:** โ โ โ 1. **Progressive cervical spondylosis with emerging myelopathic features** โ new balance โ โ โ impairment, upper extremity weakness, sensation changes. โ โ โ 2. **Neurogenic cough** โ possible irritation of upper airway/pharyngeal structures โ โ โ secondary to cervical spine pathology. โ โ โ 3. **Medicationโrelated side effects** โ gabapentin may contribute to dizziness/balance โ โ โ issues. โ โ โ 4. **Ruleโout:** Early cervical myelopathy, demyelinating disease, inflammatory โ โ โ arthropathy. โ โ โ โ โ โ **Plan / Orders:** โ โ โ - **Imaging:** Cervical MRI (soft tissue & cord) โ STAT. โ โ โ - **Labs:** CBC, CMP (baseline), Vitamin B12 level. โ โ โ - **Medication adjustments:** โ โ โ - Increase gabapentin to 300โฏmg TID if tolerated (monitor for sedation). โ โ โ - Continue ibuprofen 600โฏmg TID PRN for pain. โ โ โ - Add lowโdose oral corticosteroid (prednisone 10โฏmg daily ร5โฏdays) pending MRI results, โ โ โ to reduce inflammation if indicated. โ โ โ - **Physical therapy referral:** Focus on cervical stabilization, gait training, โ โ โ proprioceptive exercises. โ โ โ - **Occupational therapy:** Ergonomic assessment of workstation; adaptive tools for fine โ โ โ motor tasks. โ โ โ - **Followโup:** Return in 2โฏweeks with MRI results; earlier if symptoms acutely worsen โ โ โ (e.g., new weakness, urinary dysfunction). โ โ โ - **Patient education:** โ โ โ - Maintain neutral neck posture; avoid prolonged overhead activity. โ โ โ - Use supportive cervical pillow during sleep. โ โ โ - Monitor for bowel/bladder changes or escalating weakness โ seek urgent care if โ โ โ present. โ โ โ โ โ โ **Signature:** โ โ โ Dr. Brandon Powell, MD โ โ โ BoardโCertified Primary Care Physician โ โ โ [Contact Information] โ โ โ **Date/Time:** 2024โ06โ13 10:45โฏAM โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [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': '56aa27d8-c859-40d4-bea8-54314990bd7c... | {'uuid': '3bbe30a9-3925-4219-94de-ed8e57d5d72d... | PT-A754975F | 2024-05-19 | 2024-06-13 | Carly | Cooper | 1967-08-25 | Dr. Powell | **Patient:** Carly Cooper \n**DOB:** [Insert ... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'uuid': '0a150989-90ed-4d81-bab9-fd9febe71b1e... | {'uuid': 'd1e864ec-72c1-42ef-b4f8-926dd67c90db... | PT-C41625B3 | 2024-02-17 | 2024-02-28 | Christine | Thompson | 1972-06-09 | Dr. Phillips | **Visit: 2024-02-28 | Patient: Christine Thomp... |
๐ 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 โ 1132.0 +/- 172.5 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ 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")
[21:54:34] [INFO] ๐จ Creating Data Designer dataset
[21:54:34] [INFO] โ Validation passed
[21:54:34] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:54:34] [INFO] ๐ฉบ Running health checks for models...
[21:54:34] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:54:34] [INFO] |-- โ Passed!
[21:54:34] [INFO] โณ Processing batch 1 of 1
[21:54:35] [INFO] ๐ฑ Sampling 10 records from seed dataset
[21:54:35] [INFO] |-- seed dataset size: 820 records
[21:54:35] [INFO] |-- sampling strategy: ordered
[21:54:35] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[21:54:35] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[21:54:35] [INFO] ๐งฉ Generating column `first_name` from expression
[21:54:35] [INFO] ๐งฉ Generating column `last_name` from expression
[21:54:35] [INFO] ๐งฉ Generating column `dob` from expression
[21:54:35] [INFO] ๐งฉ Generating column `physician` from expression
[21:54:35] [INFO] ๐ llm-text model config for column 'physician_notes'
[21:54:35] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:35] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:35] [INFO] |-- model provider: 'nvidia'
[21:54:35] [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
[21:54:35] [INFO] ๐ Processing llm-text column 'physician_notes' with 4 concurrent workers
[21:54:49] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 1434,
"output_tokens": 10414,
"total_tokens": 11848
},
"request_usage": {
"successful_requests": 10,
"failed_requests": 0,
"total_requests": 10
},
"tokens_per_second": 806,
"requests_per_minute": 40
}
}
[21:54:49] [INFO] ๐ Measuring dataset column statistics:
[21:54:49] [INFO] |-- ๐ฒ column: 'patient_sampler'
[21:54:49] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[21:54:49] [INFO] |-- ๐ฒ column: 'patient_id'
[21:54:49] [INFO] |-- ๐งฉ column: 'first_name'
[21:54:49] [INFO] |-- ๐งฉ column: 'last_name'
[21:54:49] [INFO] |-- ๐งฉ column: 'dob'
[21:54:49] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[21:54:49] [INFO] |-- ๐ฒ column: 'date_of_visit'
[21:54:49] [INFO] |-- ๐งฉ column: 'physician'
[21:54:49] [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': 89, 'bachelors_field': 'no_degree', 'b... | {'age': 93, 'bachelors_field': 'stem_related',... | PT-D7A046C9 | 2024-05-23 | 2024-06-06 | Donald | Bowman | 1936-03-30 | Dr. Mason | **Patient:** Donald Bowman **DOB:** 04/12/19... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'age': 48, 'bachelors_field': 'no_degree', 'b... | {'age': 42, 'bachelors_field': 'no_degree', 'b... | PT-32E3F5F2 | 2024-04-02 | 2024-04-09 | Jay | Keller | 1977-09-24 | Dr. Adams | **Visit Note โ 2024-04-09** **Patient:** Jay... |
| 2 | urinary tract infection | I have been urinating blood. I sometimes feel ... | {'age': 87, 'bachelors_field': 'stem_related',... | {'age': 106, 'bachelors_field': 'stem', 'birth... | PT-41DC7182 | 2024-12-12 | 2024-12-23 | Brandon | Moore | 1938-07-26 | Dr. Velez | **Patient:** Brandon Moore **DOB:** 03/15/19... |
| 3 | arthritis | I have been having trouble with my muscles and... | {'age': 24, 'bachelors_field': 'no_degree', 'b... | {'age': 103, 'bachelors_field': 'no_degree', '... | PT-54FB351B | 2024-01-19 | 2024-02-06 | Amanda | Myers | 2001-04-03 | Dr. Pratt | **Visit Summary: Amanda Myers | 2024-02-06 | P... |
| 4 | dengue | I have been feeling really sick. My body hurts... | {'age': 86, 'bachelors_field': 'stem', 'birth_... | {'age': 102, 'bachelors_field': 'no_degree', '... | PT-04820BC4 | 2024-03-03 | 2024-04-01 | Darryl | Torres | 1939-05-12 | Dr. Holmes | **Patient:** Darryl Torres **DOB:** 1992-06-... |
# 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.5 โ 929.5 +/- 198.8 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ 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: