Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add further context to dietitian notes schema #319

Merged
merged 15 commits into from
Feb 7, 2024
Merged

Add further context to dietitian notes schema #319

merged 15 commits into from
Feb 7, 2024

Conversation

caufieldjh
Copy link
Member

@caufieldjh caufieldjh commented Feb 2, 2024

This is primarily about leveraging acronyms and adding more diagnostic criteria.

@caufieldjh
Copy link
Member Author

Acronyms can be added with the gilda annotator:

That strategy isn't very flexible, though. How can we just nudge the LLM in the right direction?
Acronyms may need to be more contextualized in terms of the classes they're most relevant to.

@caufieldjh
Copy link
Member Author

This may be less of a job for annotation (e.g., with gilda) and more of a job for the LLM itself, since acronyms have meaning extending beyond a simple key-value pair. One option is to set up a custom GPT w/ OpenAI but I'd prefer this to be more model-agnostic. This may suggest that OntoGPT could use some functionality to pass system prompts or some kind of initial instructions.

For now, these details can go in the schema.

@caufieldjh
Copy link
Member Author

Improvements across the board here - but one recurring issue, more noticeable here due to involving more numerical value extractions than most: instances where the LLM adds extra formatting/punctuation tend to break things. Example:

  patient_weight:
    value: <45 kg; 35 kg>
    unit: AUTO:%3Ckg%3B%20kg%3E
    percentile: <46%; 6%>
    zscore: <-0.10; -1.55>

This will probably need to be handled in the SPIRES implementation itself as a post-processing step.

@caufieldjh
Copy link
Member Author

Further updates in a future PR, but for now this will get results like (named entities omitted):

extracted_object:
  id: 45f2657e-36ee-4762-98f9-01665dd13e17
  label: Baby Girl A
  is_pediatric: 'True'
  is_preterm: 'False'
  patient_height:
    value: '44'
    unit: UO:0000015
    percentile: 8%ile
    zscore: '-1.43'
  patient_weight:
    value: '2.79'
    unit: UO:0000009
    percentile: 46%
    zscore: '-0.10'
  head_circumference:
    value: '35'
    unit: UO:0000015
    percentile: 92%
    zscore: '1.42'
  malnutrition_status:
    malnutrition_presence: N/A
    malnutrition_risk: N/A
    severity: N/A
    acute_or_chronic: N/A
    diagnosis: AUTO:N/A
    etiology: AUTO:N/A
  diet_supplementation:
    - AUTO:Starter%20total%20parenteral%20nutrition%20at%2080%20milliliters%20per%20kilogram%20per%20day
    - AUTO:glucose%20infusion%20rate%3A%205.5%20milligrams%20per%20kilogram%20per%20minute
    - AUTO:amino%20acid%202.8%20grams%20per%20kilogram%20per%20day
    - AUTO:dextrose%2010%25
    - AUTO:Trophamine%203.5%25
  nutrition_support:
    - AUTO:Custom%20total%20parenteral%20nutrition%20via%20peripherally%20inserted%20central%20catheter%20at%20dextrose%2012%25%2C%20amino%20acid%203.5%20grams%20per%20kilogram%20per%20day%20and%20soy%20medium-chain%20triglycerides%20olive%20fish%20oil%20emulsion%202%20grams%20per%20kilogram%20per%20day

@caufieldjh caufieldjh marked this pull request as ready for review February 7, 2024 00:17
@caufieldjh caufieldjh merged commit 46f7e2b into main Feb 7, 2024
2 checks passed
@caufieldjh caufieldjh deleted the diet2 branch February 7, 2024 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant