4040
4141# Unique record ID
4242config_builder .add_column (
43- name = "record_id" ,
44- column_type = "sampler" ,
45- sampler_type = "uuid" ,
46- params = {"short_form" : True , "uppercase" : True }
43+ name = "record_id" , column_type = "sampler" , sampler_type = "uuid" , params = {"short_form" : True , "uppercase" : True }
4744)
4845
4946# ESI level (balanced sampling)
121118 SamplerColumnConfig (
122119 name = "writing_style" ,
123120 sampler_type = "category" ,
124- params = CategorySamplerParams (
125- values = ["Draft" , "Adequate" , "Polished" ]
126- ),
121+ params = CategorySamplerParams (values = ["Draft" , "Adequate" , "Polished" ]),
127122 )
128123)
129124
159154 "4" : "Note is well-aligned, with only minor details that might be slightly inconsistent." ,
160155 "3" : "Note is generally consistent, but some key clinical indicators are missing or don't fully match the ESI level." ,
161156 "2" : "Note shows significant inconsistency between the clinical details and the assigned ESI level." ,
162- "1" : "Note is clinically incoherent and does not reflect the assigned ESI level or scenario at all."
163- }
157+ "1" : "Note is clinically incoherent and does not reflect the assigned ESI level or scenario at all." ,
158+ },
164159)
165160
166161# Rubric: ESI level complexity (reduced to 3 levels: Simple, Moderate, Complex)
170165 options = {
171166 "Complex" : "Note contains subtle or conflicting information, requiring clinical reasoning to distinguish between ESI levels." ,
172167 "Moderate" : "Note requires some clinical inference; indicators are present but not always immediately obvious." ,
173- "Simple" : "Note uses clear, direct, or textbook indicators that make the ESI level obvious."
174- }
168+ "Simple" : "Note uses clear, direct, or textbook indicators that make the ESI level obvious." ,
169+ },
175170)
176171
177172jsonl_entry_template = {
183178 f" The possible levels are: { ', ' .join ([repr (level ) for level in ESI_LEVELS ])} ."
184179 " Carefully analyze the clinical details in the triage note, focusing on patient acuity, resource needs, and risk of rapid deterioration."
185180 " Respond with only the selected ESI level description, exactly matching one of the listed possibilities. Do not provide extra text or explanation."
186- )
181+ ),
187182 },
188183 {
189184 "role" : "user" ,
190185 "content" : (
191186 "Triage Note: {{ content }}\n "
192187 "Classify the ESI level for this note based on the provided definitions."
193- " Respond in JSON format only: { \" esi_level_description\" : \" ...\" }"
194- )
195- },
196- {
197- "role" : "assistant" ,
198- "content" : (
199- '{ "esi_level_description": "{{ esi_level_description }}" }'
200- )
188+ ' Respond in JSON format only: { "esi_level_description": "..." }'
189+ ),
201190 },
191+ {"role" : "assistant" , "content" : ('{ "esi_level_description": "{{ esi_level_description }}" }' )},
202192 ],
203193}
204194
213203 )
214204)
215205
216- dd = DataDesigner (artifact_path = "./artifacts" , blob_storage_path = "/Users/amanoel/Data/nemotron-personas-datasets_v0.0.6" )
217- preview = dd .preview (config_builder , num_records = 10 )
206+ dd = DataDesigner (
207+ artifact_path = "./artifacts" , blob_storage_path = "/Users/amanoel/Data/nemotron-personas-datasets_v0.0.6"
208+ )
209+ preview = dd .preview (config_builder , num_records = 10 )
0 commit comments