Skip to content

Commit

Permalink
Tuning the anatomy extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Aug 26, 2024
1 parent b85522d commit 9b7247b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ontogpt/templates/pathology.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class PathologyStatement(ConfiguredBaseModel):
"""
linkml_meta: ClassVar[LinkMLMeta] = LinkMLMeta({'from_schema': 'http://w3id.org/ontogpt/pathology'})

diagnosis: Optional[str] = Field(None, description="""The diagnosis or pathology being described, for example, \"colitis\", \"inflammation\", or \"dysplasia\". If not specified or cannot be identified (e.g., due to lack of tissue sample), this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'diagnosis',
diagnosis: Optional[str] = Field(None, description="""The diagnosis or pathology being described. This may include full diagnoses or observations, for example, \"colitis\", \"inflammation\", \"dysplasia\", \"polyp\". If not specified or cannot be identified (e.g., due to lack of tissue sample), this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'diagnosis',
'annotations': {'prompt.example': {'tag': 'prompt.example',
'value': 'colitis, inflammation, '
'dysplasia'}},
Expand All @@ -224,7 +224,7 @@ class PathologyStatement(ConfiguredBaseModel):
'annotations': {'prompt.example': {'tag': 'prompt.example',
'value': 'mild, moderate, severe'}},
'domain_of': ['PathologyStatement']} })
anatomical_entities: Optional[List[str]] = Field(None, description="""Semicolon-delimited list of anatomical locations or tissues the pathology is measured in. This may need to be inferred from the text, for example, \"colitis\" means the entity should be \"colon\". If this is not specified or cannot be inferred then this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'anatomical_entities',
anatomical_entities: Optional[List[str]] = Field(None, description="""Semicolon-delimited list of anatomical locations or tissues the pathology is measured in. This may need to be inferred from the text, for example, \"colitis\" means the entity should be \"colon\". A statement of \"gastric antral-type mucosa\" should be changed to include only the anatomical entity, in this case \"gastric mucosa\". If this is not specified or cannot be inferred then this value must be \"N/A\".""", json_schema_extra = { "linkml_meta": {'alias': 'anatomical_entities',
'annotations': {'prompt.example': {'tag': 'prompt.example',
'value': 'duodenum, colonic mucosa, '
'liver'}},
Expand Down
9 changes: 7 additions & 2 deletions src/ontogpt/templates/pathology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ imports:
# TODO: Tune the anatomy extraction; it seems to miss many instances
# TODO: Try to be more specific about SNOMED terms, e.g., hemosiderin deposition
# grounds to SNOMEDCT:70748002 but that's specific to "Hemosiderin measurement, urine"
# This may require instructions to reprocess the text to be more like SNOMED, e.g.,
# "hepatitis" doesn't have a specific term but maybe inflammation is appropriate

classes:

Expand Down Expand Up @@ -55,8 +57,9 @@ classes:
attributes:
diagnosis:
description: >-
The diagnosis or pathology being described, for example, "colitis",
"inflammation", or "dysplasia". If not specified or cannot be
The diagnosis or pathology being described. This may include
full diagnoses or observations, for example, "colitis",
"inflammation", "dysplasia", "polyp". If not specified or cannot be
identified (e.g., due to lack of tissue sample), this value must be
"N/A".
range: Diagnosis
Expand All @@ -82,6 +85,8 @@ classes:
Semicolon-delimited list of anatomical locations or tissues
the pathology is measured in. This may need to be inferred from the
text, for example, "colitis" means the entity should be "colon".
A statement of "gastric antral-type mucosa" should be changed to
include only the anatomical entity, in this case "gastric mucosa".
If this is not specified or cannot be inferred then this value must
be "N/A".
range: AnatomicalEntity
Expand Down

0 comments on commit 9b7247b

Please sign in to comment.