-
-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the actual labels in the prompt
- Loading branch information
1 parent
ff8def6
commit 5e246b9
Showing
1 changed file
with
12 additions
and
23 deletions.
There are no files selected for viewing
35 changes: 12 additions & 23 deletions
35
integrations/prodigy_openai/openai/templates/ner_prompt.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
From the text below, extract the following entities in the following format: | ||
{# whitespace #} | ||
{%- for label in labels -%} | ||
{{label}}: <comma delimited list of strings> | ||
Cell: <comma delimited list of strings> | ||
Organism_substance: <comma delimited list of strings> | ||
Pathological_formation: <comma delimited list of strings> | ||
Multi-tissue_structure: <comma delimited list of strings> | ||
Organism_subdivision: <comma delimited list of strings> | ||
Organ: <comma delimited list of strings> | ||
Cellular_component: <comma delimited list of strings> | ||
Anatomical_system: <comma delimited list of strings> | ||
Tissue: <comma delimited list of strings> | ||
Developing_anatomical_structure: <comma delimited list of strings> | ||
Immaterial_anatomical_entity: <comma delimited list of strings> | ||
{# whitespace #} | ||
{%- endfor -%} | ||
{# whitespace #} | ||
Text: | ||
""" | ||
{{text}} | ||
""" | ||
{# whitespace #} | ||
{%- if examples -%} | ||
{# whitespace #} | ||
For example: | ||
{# whitespace #} | ||
{# whitespace #} | ||
{%- for example in examples -%} | ||
Text: | ||
""" | ||
{{ example.text }} | ||
""" | ||
{# whitespace #} | ||
{%- for label, substrings in example.entities.items() -%} | ||
{{ label }}: {{ ", ".join(substrings) }} | ||
{# whitespace #} | ||
{%- endfor -%} | ||
{# whitespace #} | ||
{% endfor -%} | ||
{%- endif -%} | ||
""" |