Skip to content

Commit

Permalink
Include the actual labels in the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ljvmiranda921 committed Feb 21, 2023
1 parent ff8def6 commit 5e246b9
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions integrations/prodigy_openai/openai/templates/ner_prompt.jinja2
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 -%}
"""

0 comments on commit 5e246b9

Please sign in to comment.