Skip to content

Commit

Permalink
Tuning reference extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Dec 20, 2024
1 parent 54a65ba commit 508f826
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
29 changes: 18 additions & 11 deletions src/ontogpt/templates/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ class Document(NamedEntity):
'e.g., if the text indicates a reference '
'of (3), include it after the object in '
'the relationship, e.g., "Subject HAS '
'RELATIONSHIP WITH Object (3)". Do not '
'include newlines.'}},
'RELATIONSHIP WITH Object (3)". Delimit '
'multiple references with commas, e.g., '
'"(3, 4)". Do not include newlines.'}},
'domain_of': ['Document']} })
nutrient_to_phenotype_relationships: Optional[List[NutrientToPhenotypeRelationship]] = Field(None, description="""A list of relationships between nutrients and biological phenotypes.""", json_schema_extra = { "linkml_meta": {'alias': 'nutrient_to_phenotype_relationships',
'annotations': {'prompt': {'tag': 'prompt',
Expand Down Expand Up @@ -303,8 +304,9 @@ class Document(NamedEntity):
'e.g., if the text indicates a reference '
'of (3), include it after the object in '
'the relationship, e.g., "Subject HAS '
'RELATIONSHIP WITH Object (3)". Do not '
'include newlines.'}},
'RELATIONSHIP WITH Object (3)". Delimit '
'multiple references with commas, e.g., '
'"(3, 4)". Do not include newlines.'}},
'domain_of': ['Document']} })
nutrient_to_biological_process_relationships: Optional[List[NutrientToBiologicalProcessRelationship]] = Field(None, description="""A list of relationships between nutrients and biological processes.""", json_schema_extra = { "linkml_meta": {'alias': 'nutrient_to_biological_process_relationships',
'annotations': {'prompt': {'tag': 'prompt',
Expand Down Expand Up @@ -334,8 +336,9 @@ class Document(NamedEntity):
'e.g., if the text indicates a reference '
'of (3), include it after the object in '
'the relationship, e.g., "Subject HAS '
'RELATIONSHIP WITH Object (3)". Do not '
'include newlines.'}},
'RELATIONSHIP WITH Object (3)". Delimit '
'multiple references with commas, e.g., '
'"(3, 4)". Do not include newlines.'}},
'domain_of': ['Document']} })
nutrient_to_health_status_relationships: Optional[List[NutrientToHealthStatusRelationship]] = Field(None, description="""A list of relationships between nutrients and health of a specific part or system of the human body.""", json_schema_extra = { "linkml_meta": {'alias': 'nutrient_to_health_status_relationships',
'annotations': {'prompt': {'tag': 'prompt',
Expand Down Expand Up @@ -363,7 +366,9 @@ class Document(NamedEntity):
'indicates a reference of (3), include it '
'after the object in the relationship, '
'e.g., "Subject HAS RELATIONSHIP WITH '
'Object (3)". Do not include newlines.'}},
'Object (3)". Delimit multiple references '
'with commas, e.g., "(3, 4)". Do not '
'include newlines.'}},
'domain_of': ['Document']} })
nutrient_to_source_relationships: Optional[List[NutrientToSourceRelationship]] = Field(None, description="""A list of relationships between nutrients and their sources in food or supplements.""", json_schema_extra = { "linkml_meta": {'alias': 'nutrient_to_source_relationships',
'annotations': {'prompt': {'tag': 'prompt',
Expand All @@ -384,8 +389,9 @@ class Document(NamedEntity):
'e.g., if the text indicates a reference '
'of (3), include it after the object in '
'the relationship, e.g., "Subject HAS '
'RELATIONSHIP WITH Object (3)". Do not '
'include newlines.'}},
'RELATIONSHIP WITH Object (3)". Delimit '
'multiple references with commas, e.g., '
'"(3, 4)". Do not include newlines.'}},
'domain_of': ['Document']} })
nutrient_to_nutrient_relationships: Optional[List[NutrientToNutrientRelationship]] = Field(None, description="""A list of relationships between nutrients and other nutrients.""", json_schema_extra = { "linkml_meta": {'alias': 'nutrient_to_nutrient_relationships',
'annotations': {'prompt': {'tag': 'prompt',
Expand All @@ -406,8 +412,9 @@ class Document(NamedEntity):
'e.g., if the text indicates a reference '
'of (3), include it after the object in '
'the relationship, e.g., "Subject HAS '
'RELATIONSHIP WITH Object (3)". Do not '
'include newlines.'}},
'RELATIONSHIP WITH Object (3)". Delimit '
'multiple references with commas, e.g., '
'"(3, 4)". Do not include newlines.'}},
'domain_of': ['Document']} })
id: str = Field(..., description="""A unique identifier for the named entity""", json_schema_extra = { "linkml_meta": {'alias': 'id',
'annotations': {'prompt.skip': {'tag': 'prompt.skip', 'value': 'true'}},
Expand Down
18 changes: 12 additions & 6 deletions src/ontogpt/templates/mic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
nutrient_to_phenotype_relationships:
range: NutrientToPhenotypeRelationship
Expand Down Expand Up @@ -102,7 +103,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
nutrient_to_biological_process_relationships:
range: NutrientToBiologicalProcessRelationship
Expand Down Expand Up @@ -130,7 +132,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
nutrient_to_health_status_relationships:
range: NutrientToHealthStatusRelationship
Expand All @@ -157,7 +160,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
nutrient_to_source_relationships:
range: NutrientToSourceRelationship
Expand All @@ -180,7 +184,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
nutrient_to_nutrient_relationships:
range: NutrientToNutrientRelationship
Expand All @@ -203,7 +208,8 @@ classes:
corresponding reference(s) in parentheses after the
relationship; e.g., if the text indicates a reference
of (3), include it after the object in the relationship,
e.g., "Subject HAS RELATIONSHIP WITH Object (3)".
e.g., "Subject HAS RELATIONSHIP WITH Object (3)". Delimit
multiple references with commas, e.g., "(3, 4)".
Do not include newlines.
# references:
# range: string
Expand Down

0 comments on commit 508f826

Please sign in to comment.