Skip to content

Commit beb35ea

Browse files
committed
refactored for 25.10
1 parent 7820e69 commit beb35ea

File tree

7 files changed

+985
-849
lines changed

7 files changed

+985
-849
lines changed

nemo/NeMo-Data-Designer/self-hosted-tutorials/community-contributions/forms/w2-dataset.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,10 +1033,10 @@
10331033
" LLMTextColumnConfig(\n",
10341034
" name=\"employer_business\",\n",
10351035
" model_alias=MODEL_ALIAS,\n",
1036-
" system_prompt=(\"You are assisting a user generate synthetic W-2 forms.\"\n",
1037-
" \"You must generate a realistic industry category for the employer\"\n",
1036+
" system_prompt=(\"You are assisting a user generate synthetic W-2 forms.\\n\"\n",
1037+
" \"You must generate a realistic industry category for the employer\\n\"\n",
10381038
" \"eg: software, health insurance, shoe store, restaurant, plumbing /no_think\"),\n",
1039-
" prompt=(\"Generate the industry category for the employer. Ensure it is consistent with the employer location\"\n",
1039+
" prompt=(\"Generate the industry category for the employer. Ensure it is consistent with the employer location\\n\"\n",
10401040
" \"City: {{ employer.city }}\\nState: {{ employer.state }}\"),\n",
10411041
" )\n",
10421042
")\n",

nemo/NeMo-Data-Designer/self-hosted-tutorials/community-contributions/healthcare-datasets/clinical-trials.ipynb

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -693,35 +693,35 @@
693693
" system_prompt=SYSTEM_PROMPT,\n",
694694
" model_alias=MODEL_ALIAS,\n",
695695
" prompt=(\n",
696-
" \"{% if documentation_style == 'Formal and Technical' %}\"\n",
697-
" \"Write formal and technical medical observations for participant {{ participant_first_name }} {{ participant_last_name }}\"\n",
698-
" \"(ID: {{ participant_id }}) in the clinical trial for {{ therapeutic_area }} (Study ID: {{ study_id }}).\"\n",
696+
" \"{% if documentation_style == 'Formal and Technical' %}\\n\"\n",
697+
" \"Write formal and technical medical observations for participant {{ participant_first_name }} {{ participant_last_name }}\\n\"\n",
698+
" \"(ID: {{ participant_id }}) in the clinical trial for {{ therapeutic_area }} (Study ID: {{ study_id }}).\\n\"\n",
699699
"\n",
700-
" \"Include observations related to their enrollment in the {{ dose_level }} dose group with {{ dose_frequency }} administration.\"\n",
700+
" \"Include observations related to their enrollment in the {{ dose_level }} dose group with {{ dose_frequency }} administration.\\n\"\n",
701701
" \"Baseline measurement was {{ baseline_measurement }} and final measurement was {{ final_measurement }}, representing a\"\n",
702-
" \"change of {{ percent_change }}%.\"\n",
702+
" \"change of {{ percent_change }}%.\\n\"\n",
703703
"\n",
704704
" \"Use proper medical terminology, maintain a highly formal tone, and structure the notes in a technical format with appropriate\"\n",
705-
" \"sections and subsections. Include at least one reference to the site investigator, Dr. {{ investigator_last_name }}.\"\n",
705+
" \"sections and subsections. Include at least one reference to the site investigator, Dr. {{ investigator_last_name }}.\\n\"\n",
706706
" \"{% elif documentation_style == 'Concise and Direct' %}\"\n",
707-
" \"Write brief, direct medical observations for patient {{ participant_first_name }} {{ participant_last_name }}\"\n",
708-
" \"({{ participant_id }}) in {{ therapeutic_area }} trial {{ study_id }}.\"\n",
707+
" \"Write brief, direct medical observations for patient {{ participant_first_name }} {{ participant_last_name }}\\n\"\n",
708+
" \"({{ participant_id }}) in {{ therapeutic_area }} trial {{ study_id }}.\\n\"\n",
709709
"\n",
710-
" \"Note: {{ dose_level }} dose, {{ dose_frequency }}. Baseline: {{ baseline_measurement }}. Final: {{ final_measurement }}.\"\n",
711-
" \"Change: {{ percent_change }}%.\"\n",
710+
" \"Note: {{ dose_level }} dose, {{ dose_frequency }}. Baseline: {{ baseline_measurement }}. Final: {{ final_measurement }}.\\n\"\n",
711+
" \"Change: {{ percent_change }}%.\\n\"\n",
712712
"\n",
713-
" \"Keep notes extremely concise, using abbreviations where appropriate. Mention follow-up needs and reference\"\n",
714-
" \"Dr. {{ investigator_last_name }} briefly.\"\n",
715-
" \"{% else %}\"\n",
716-
" \"Write detailed and descriptive medical observations for participant {{ participant_first_name }} {{ participant_last_name }}\"\n",
717-
" \"enrolled in the {{ therapeutic_area }} clinical trial ({{ study_id }}).\"\n",
713+
" \"Keep notes extremely concise, using abbreviations where appropriate. Mention follow-up needs and reference\\n\"\n",
714+
" \"Dr. {{ investigator_last_name }} briefly.\\n\"\n",
715+
" \"{% else %}\\n\"\n",
716+
" \"Write detailed and descriptive medical observations for participant {{ participant_first_name }} {{ participant_last_name }}\\n\"\n",
717+
" \"enrolled in the {{ therapeutic_area }} clinical trial ({{ study_id }}).\\n\"\n",
718718
"\n",
719-
" \"Provide a narrative description of their experience in the {{ dose_level }} dose group with {{ dose_frequency }} dosing.\"\n",
720-
" \"Describe how their measurements changed from baseline ({{ baseline_measurement }}) to final ({{ final_measurement }}),\"\n",
721-
" \"representing a {{ percent_change }}% change.\"\n",
719+
" \"Provide a narrative description of their experience in the {{ dose_level }} dose group with {{ dose_frequency }} dosing.\\n\"\n",
720+
" \"Describe how their measurements changed from baseline ({{ baseline_measurement }}) to final ({{ final_measurement }}),\\n\"\n",
721+
" \"representing a {{ percent_change }}% change.\\n\"\n",
722722
"\n",
723-
" \"Use a mix of technical terms and explanatory language. Include thorough descriptions of observed effects and subjective\"\n",
724-
" \"patient reports. Mention interactions with the investigator, Dr. {{ investigator_first_name }} {{ investigator_last_name }}.\"\n",
723+
" \"Use a mix of technical terms and explanatory language. Include thorough descriptions of observed effects and subjective \"\n",
724+
" \"patient reports. Mention interactions with the investigator, Dr. {{ investigator_first_name }} {{ investigator_last_name }}.\\n\"\n",
725725
" \"{% endif %}\"\n",
726726
" )\n",
727727
" )\n",
@@ -735,13 +735,13 @@
735735
" model_alias=MODEL_ALIAS,\n",
736736
" prompt=(\n",
737737
" \"{% if has_adverse_event == 1 %}\"\n",
738-
" \"[INSTRUCTIONS: Write a brief clinical description (1-2 sentences only) of the adverse event.\\\n",
739-
" Use formal medical language. Do not include meta-commentary or explain what you're doing.]\\\n",
740-
" {{adverse_event_type}}, {{adverse_event_severity}}. {{adverse_event_relatedness}} to study treatment.\"\n",
741-
" \"{% if adverse_event_resolved == 'Yes' %}Resolved.{% else %}Ongoing.{% endif %}\"\n",
742-
" \"{% else %}\"\n",
743-
" \"[INSTRUCTIONS: Output only the exact text 'No adverse events reported' without any additional commentary.]\\\n",
744-
" No adverse events reported.\"\n",
738+
" \"[INSTRUCTIONS: Write a brief clinical description (1-2 sentences only) of the adverse event. \"\n",
739+
" \"Use formal medical language. Do not include meta-commentary or explain what you're doing.] \"\n",
740+
" \"{{adverse_event_type}}, {{adverse_event_severity}}. {{adverse_event_relatedness}} to study treatment.\\n\"\n",
741+
" \"{% if adverse_event_resolved == 'Yes' %}Resolved.{% else %}Ongoing.{% endif %}\\n\"\n",
742+
" \"{% else %}\\n\"\n",
743+
" \"[INSTRUCTIONS: Output only the exact text 'No adverse events reported' without any additional commentary.] \"\n",
744+
" \"No adverse events reported.\\n\"\n",
745745
" \"{% endif %}\"\n",
746746
" )\n",
747747
" )\n",
@@ -756,40 +756,40 @@
756756
" prompt=(\n",
757757
" \"{% if compliance_rate < 0.85 %}\"\n",
758758
" \"{% if documentation_style == 'Formal and Technical' %}\"\n",
759-
" \"[FORMAT INSTRUCTIONS: Write in a direct documentation style. Do not use phrases like 'it looks like' or \\\n",
760-
" 'you've provided'. Begin with the protocol deviation details. Use formal terminology.]\"\n",
761-
"\n",
762-
" \"PROTOCOL DEVIATION REPORT\"\n",
763-
" \"Study ID: {{ study_id }}\"\n",
764-
" \"Participant: {{ participant_first_name }} {{ participant_last_name }} ({{ participant_id }})\"\n",
765-
" \"Compliance Rate: {{ compliance_rate }}\"\n",
766-
"\n",
767-
" \"[Continue with formal description of the deviation, impact on data integrity, and corrective actions. \\\n",
768-
" Reference coordinator {{ coordinator_first_name }} {{ coordinator_last_name }} and Dr. {{ investigator_last_name }}]\"\n",
769-
" \"{% elif documentation_style == 'Concise and Direct' %}\"\n",
770-
" \"[FORMAT INSTRUCTIONS: Use only brief notes and bullet points. No introductions or explanations.]\"\n",
771-
"\n",
772-
" \"PROTOCOL DEVIATION - {{ participant_id }}\"\n",
773-
" \"• Compliance: {{ compliance_rate }}\"\n",
774-
" \"• Impact: [severity level]\"\n",
775-
" \"• Actions: [list actions]\"\n",
776-
" \"• Coordinator: {{ coordinator_first_name }} {{ coordinator_last_name }}\"\n",
777-
" \"• PI: Dr. {{ investigator_last_name }}\"\n",
778-
" \"{% else %}\"\n",
779-
" \"[FORMAT INSTRUCTIONS: Write a narrative description. Begin directly with the deviation details. No meta-commentary.]\"\n",
780-
"\n",
781-
" \"During the {{ therapeutic_area }} study at {{ site_location }}, participant {{ participant_first_name }} \\\n",
782-
" {{ participant_last_name }} demonstrated a compliance rate of {{ compliance_rate }}, which constitutes a protocol deviation.\"\n",
783-
"\n",
784-
" \"[Continue with narrative about circumstances, discovery, impact, and team response. Include references to \\\n",
785-
" {{ coordinator_first_name }} {{ coordinator_last_name }} and Dr. {{ investigator_first_name }} {{ investigator_last_name }}]\"\n",
786-
" \"{% endif %}\"\n",
787-
" \"{% else %}\"\n",
788-
" \"[FORMAT INSTRUCTIONS: Write a simple direct statement. No meta-commentary or explanation.]\"\n",
789-
"\n",
790-
" \"PROTOCOL COMPLIANCE ASSESSMENT\"\n",
791-
" \"Participant: {{ participant_first_name }} {{ participant_last_name }} ({{ participant_id }})\"\n",
792-
" \"Finding: No protocol deviations. Compliance rate: {{ compliance_rate }}.\"\n",
759+
" \"[FORMAT INSTRUCTIONS: Write in a direct documentation style. Do not use phrases like 'it looks like' or \"\n",
760+
" \"'you've provided'. Begin with the protocol deviation details. Use formal terminology.]\\n\"\n",
761+
"\n",
762+
" \"PROTOCOL DEVIATION REPORT\\n\"\n",
763+
" \"Study ID: {{ study_id }}\\n\"\n",
764+
" \"Participant: {{ participant_first_name }} {{ participant_last_name }} ({{ participant_id }})\\n\"\n",
765+
" \"Compliance Rate: {{ compliance_rate }}\\n\"\n",
766+
"\n",
767+
" \"[Continue with formal description of the deviation, impact on data integrity, and corrective actions. \"\n",
768+
" \"Reference coordinator {{ coordinator_first_name }} {{ coordinator_last_name }} and Dr. {{ investigator_last_name }}]\\n\"\n",
769+
" \"{% elif documentation_style == 'Concise and Direct' %}\\n\"\n",
770+
" \"[FORMAT INSTRUCTIONS: Use only brief notes and bullet points. No introductions or explanations.]\\n\"\n",
771+
"\n",
772+
" \"PROTOCOL DEVIATION - {{ participant_id }}\\n\"\n",
773+
" \"• Compliance: {{ compliance_rate }}\\n\"\n",
774+
" \"• Impact: [severity level]\\n\"\n",
775+
" \"• Actions: [list actions]\\n\"\n",
776+
" \"• Coordinator: {{ coordinator_first_name }} {{ coordinator_last_name }}\\n\"\n",
777+
" \"• PI: Dr. {{ investigator_last_name }}\\n\"\n",
778+
" \"{% else %}\\n\"\n",
779+
" \"[FORMAT INSTRUCTIONS: Write a narrative description. Begin directly with the deviation details. No meta-commentary.]\\n\"\n",
780+
"\n",
781+
" \"During the {{ therapeutic_area }} study at {{ site_location }}, participant {{ participant_first_name }} \"\n",
782+
" \"{{ participant_last_name }} demonstrated a compliance rate of {{ compliance_rate }}, which constitutes a protocol deviation.\\n\"\n",
783+
"\n",
784+
" \"[Continue with narrative about circumstances, discovery, impact, and team response. Include references to \"\n",
785+
" \"{{ coordinator_first_name }} {{ coordinator_last_name }} and Dr. {{ investigator_first_name }} {{ investigator_last_name }}]\\n\"\n",
786+
" \"{% endif %}]\\n\"\n",
787+
" \"{% else %}\\n\"\n",
788+
" \"[FORMAT INSTRUCTIONS: Write a simple direct statement. No meta-commentary or explanation.]\\n\"\n",
789+
"\n",
790+
" \"PROTOCOL COMPLIANCE ASSESSMENT\\n\"\n",
791+
" \"Participant: {{ participant_first_name }} {{ participant_last_name }} ({{ participant_id }})\\n\"\n",
792+
" \"Finding: No protocol deviations. Compliance rate: {{ compliance_rate }}.\\n\"\n",
793793
" \"{% endif %}\"\n",
794794
" )\n",
795795
" )\n",
@@ -1015,7 +1015,7 @@
10151015
"job_results.download_artifacts(\n",
10161016
" output_path=TUTORIAL_OUTPUT_PATH,\n",
10171017
" artifacts_folder_name=\"artifacts-community-contributions-healthcare-datasets-clinical-trials\",\n",
1018-
")"
1018+
");"
10191019
]
10201020
}
10211021
],

nemo/NeMo-Data-Designer/self-hosted-tutorials/community-contributions/healthcare-datasets/insurance-claims.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@
868868
"job_results.download_artifacts(\n",
869869
" output_path=TUTORIAL_OUTPUT_PATH,\n",
870870
" artifacts_folder_name=\"artifacts-community-contributions-healthcare-datasets-insurance-claims\",\n",
871-
")"
871+
");"
872872
]
873873
}
874874
],

nemo/NeMo-Data-Designer/self-hosted-tutorials/community-contributions/healthcare-datasets/physician-notes-with-realistic-personal-details.ipynb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,20 +389,19 @@
389389
" model_alias=MODEL_ALIAS,\n",
390390
" prompt=(\n",
391391
" \"<context>\"\n",
392-
" \"You are a primary-care physician who just had an appointment with {{first_name}} {{last_name}},\"\n",
393-
" \"who has been struggling with symptoms from {{diagnosis}} since {{symptom_onset_date}}.\"\n",
394-
" \"The date of today's visit is {{date_of_visit}}.\"\n",
395-
" \"</context>\"\n",
392+
" \"You are a primary-care physician who just had an appointment with {{first_name}} {{last_name}}, \"\n",
393+
" \"who has been struggling with symptoms from {{diagnosis}} since {{symptom_onset_date}}.\\n\"\n",
394+
" \"The date of today's visit is {{date_of_visit}}.\\n\"\n",
395+
" \"</context>\\n\"\n",
396396
"\n",
397-
" \"<patient_summary_of_symptoms>\"\n",
398-
" \"{{patient_summary}}\"\n",
399-
" \"</patient_summary_of_symptoms>\"\n",
397+
" \"<patient_summary_of_symptoms>\\n\"\n",
398+
" \"{{patient_summary}}\\n\"\n",
399+
" \"</patient_summary_of_symptoms>\\n\"\n",
400400
"\n",
401-
" \"<task>\"\n",
402-
" \"Write careful notes about your visit with {{first_name}},\"\n",
403-
" \"as {{physician}}.\"\n",
401+
" \"<task>\\n\"\n",
402+
" \"Write careful notes about your visit with {{first_name}}, as {{physician}}.\\n\"\n",
404403
"\n",
405-
" \"Format the notes as a busy doctor might.\"\n",
404+
" \"Format the notes as a busy doctor might.\\n\"\n",
406405
" \"</task>\"\n",
407406
" )\n",
408407
" )\n",
@@ -524,7 +523,7 @@
524523
"job_results.download_artifacts(\n",
525524
" output_path=TUTORIAL_OUTPUT_PATH,\n",
526525
" artifacts_folder_name=\"artifacts-community-contributions-healthcare-datasets-physician-notes\",\n",
527-
")"
526+
");"
528527
]
529528
}
530529
],

nemo/NeMo-Data-Designer/self-hosted-tutorials/community-contributions/multi-turn-chat/multi-turn-conversation.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"\n",
1010
"> ⚠️ **Warning**: NeMo Data Designer is currently in Early Release and is not recommended for production use.\n",
1111
"\n",
12-
"#### 📚 What you'll learn\n",
12+
"### 📚 What you'll learn\n",
1313
"\n",
1414
"- This notebook demonstrates how to use the NeMo Data Designer to build a synthetic data generation pipeline step-by-step.\n",
1515
"\n",
@@ -301,7 +301,7 @@
301301
" values=[\"happy\", \"silly\", \"sarcastic\", \"combative\", \"disappointed\", \"toxic\"]\n",
302302
" )\n",
303303
" )\n",
304-
")\n"
304+
")"
305305
]
306306
},
307307
{
@@ -409,10 +409,10 @@
409409
")\n",
410410
"\n",
411411
"TOXICITY_PROMPT_TEMPLATE = (\n",
412-
" \"You are an expert in content moderation and digital communication ethics. \\\n",
413-
" You are evaluating the toxicity level in user messages.\\n\"\n",
414-
" \"Take a deep breath and carefully analyze the conversation provided. \\\n",
415-
" Use the rubric to score the level of toxicity in the USER'S messages only.\\n\"\n",
412+
" \"You are an expert in content moderation and digital communication ethics. \"\n",
413+
" \"You are evaluating the toxicity level in user messages.\\n\"\n",
414+
" \"Take a deep breath and carefully analyze the conversation provided. \\n\"\n",
415+
" \"Use the rubric to score the level of toxicity in the USER'S messages only.\\n\"\n",
416416
"\n",
417417
" \"Consider:\\n\"\n",
418418
" \"- Focus primarily on harassment, hate, or harmful language\\n\"\n",
@@ -560,7 +560,7 @@
560560
"job_results.download_artifacts(\n",
561561
" output_path=TUTORIAL_OUTPUT_PATH,\n",
562562
" artifacts_folder_name=\"artifacts-community-contributions-multi-turn-chat\",\n",
563-
")"
563+
");"
564564
]
565565
}
566566
],

0 commit comments

Comments
 (0)