File size: 10,610 Bytes
c32ee7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
dataset: docred
templates:
  02af700c-e9e9-4a84-b75c-5fb29a5b7993: !Template
    answer_choices: null
    id: 02af700c-e9e9-4a84-b75c-5fb29a5b7993
    jinja: "Read the following text and answer the questions.\n\nText:\n{% for sent\
      \ in sents -%}\n{{ sent | join(\" \") }}\n{%- endfor %} \n\nQuestion:\nFrom\
      \ the above text, find people, locations, organizations, times, numbers, and\
      \ miscellaneous.\n|||\n{%- set people = [] -%} \n{%- for ners in vertexSet -%}\n\
      {%- for ner in ners if ner['type'] == 'PER' -%}\n{{people.append(ner['name'])\
      \ | default(\"\", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if people %}\n\
      {{\"People: \"}}{{ people | unique | join(\", \")}}{{\".\"}}\n{% endif %}\n\n\
      {%- set locations = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner in ners\
      \ if ner['type'] == 'LOC' -%}\n{{locations.append(ner['name']) | default(\"\"\
      , True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if locations %}\n{{\"Locations:\
      \ \"}}{{ locations | unique | join(\", \")}}{{\".\"}}\n{% endif %}\n\n{%- set\
      \ orgs = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner in ners if ner['type']\
      \ == 'ORG' -%}\n{{orgs.append(ner['name']) | default(\"\", True)}}\n{%- endfor\
      \ -%}\n{%- endfor -%}\n{% if orgs %}\n{{\"Organizations: \"}}{{ orgs | unique\
      \ | join(\", \")}}{{\".\"}}\n{% endif %}\n\n{%- set times = [] -%} \n{%- for\
      \ ners in vertexSet -%}\n{%- for ner in ners if ner['type'] == 'TIME' -%}\n\
      {{times.append(ner['name']) | default(\"\", True)}}\n{%- endfor -%}\n{%- endfor\
      \ -%}\n{% if times %}\n{{\"Times: \"}}{{ times | unique | join(\", \")}}{{\"\
      .\"}}\n{% endif %}\n\n{%- set numbers = [] -%} \n{%- for ners in vertexSet -%}\n\
      {%- for ner in ners if ner['type'] == 'NUM' -%}\n{{numbers.append(ner['name'])\
      \ | default(\"\", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if numbers %}\n\
      {{\"Numbers: \"}}{{ numbers | unique | join(\", \")}}{{\".\"}}\n{% endif %}\n\
      \n{%- set miscs = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner in ners\
      \ if ner['type'] == 'MISC' -%}\n{{miscs.append(ner['name']) | default(\"\",\
      \ True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if miscs %}\n{{\"Miscellaneous:\
      \ \"}}{{ miscs | unique | join(\", \")}}{{\".\"}}\n{% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: type-to-entity
    reference: ''
  3ab9cfc9-3ba3-41dd-959c-60182def11af: !Template
    answer_choices: null
    id: 3ab9cfc9-3ba3-41dd-959c-60182def11af
    jinja: "Read the following text and answer the questions.\n\nText:\n{% for sent\
      \ in sents -%}\n{{ sent | join(\" \") }}\n{%- endfor %} \n\nQuestion:\nAssign\
      \ an entity type to the following entities. The choices are PER (Person), LOC\
      \ (Location), ORG (Organization), TIME (Time), NUM (Number), and MISC (Miscellaneous).\n\
      \nExample: \n{%- set names = [] -%}\n{%- set types = [] -%}\n{% for ners in\
      \ vertexSet[:1] %}\n{% for ner in ners if ner['name'] not in names %}\n{{ names.append(ner['name'])\
      \ | default(\"\", True) }} \n{{ types.append(ner['type']) | default(\"\", True)\
      \ }} \n{% endfor %}\n{% endfor %}\n{% for name, type in zip(names, types) %}\n\
      {{name}}{{\": \"}}{{type}}\n{% endfor %}\n\nNow do the same with below:\n\n\
      {%- set names = [] -%}\n{%- set types = [] -%}\n{% for ners in vertexSet[1:]\
      \ %}\n{% for ner in ners if ner['name'] not in names %}\n{{ names.append(ner['name'])\
      \ | default(\"\", True) }} \n{{ types.append(ner['type']) | default(\"\", True)\
      \ }} \n{% endfor %}\n{% endfor %}\n{% for name, type in zip(names, types) %}\n\
      {{name}}{{\": \"}}\n{% endfor %}\n|||\n{% for name, type in zip(names, types)\
      \ %}\n{{name}}{{\": \"}}{{type}}\n{% endfor %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: true
    name: ner-type
    reference: ''
  412b482e-185b-48da-8aef-4a93a42e779d: !Template
    answer_choices: null
    id: 412b482e-185b-48da-8aef-4a93a42e779d
    jinja: "{%- set locations = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner\
      \ in ners if ner['type'] == 'LOC' -%}\n{{locations.append(ner['name']) | default(\"\
      \", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if locations %}\nFind all of\
      \ the locations in the text below. \n\n{% for sent in sents -%}\n{{ sent | join(\"\
      \ \") }}\n{%- endfor -%} \n|||\n{{ locations| unique | join(\", \")}}{{\".\"\
      }}\n{% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: find-all-locations
    reference: ''
  5361a8ba-8ced-4417-be21-ba13fa319e9f: !Template
    answer_choices: null
    id: 5361a8ba-8ced-4417-be21-ba13fa319e9f
    jinja: "{%- set organizations = [] -%} \n{%- for ners in vertexSet -%}\n{%- for\
      \ ner in ners if ner['type'] == 'ORG' -%}\n{{organizations.append(ner['name'])\
      \ | default(\"\", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if organizations\
      \ %}\nFind all of the organizations in the text below.\n\n{% for sent in sents\
      \ -%}\n{{ sent | join(\" \") }}\n{%- endfor -%} \n|||\n{{ organizations| unique\
      \ | join(\", \")}}{{\".\"}}\n{% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: find-all-organizations
    reference: ''
  6efa4d1a-3368-4b12-9e30-588b53801077: !Template
    answer_choices: null
    id: 6efa4d1a-3368-4b12-9e30-588b53801077
    jinja: "{% if labels['relation_text'] %}\nGiven the following entities and relations,\
      \ make a creative text. The types are PER (Person), LOC (Location), ORG (Organization),\
      \ TIME (Time), NUM (Number), and MISC (Miscellaneous).\n\n{% for  head, tail,\
      \ relation in zip(labels['head'], labels['tail'], labels['relation_text']) %}\n\
      head: {{vertexSet[head][0]['name']}}, tail: {{vertexSet[tail][0]['name']}},\
      \ relation: {{relation}}\n{% endfor %}\n|||\n{% for sent in sents -%}\n{{ sent\
      \ | join(\" \") }}\n{%- endfor -%} \n{% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: relation-to-text
    reference: ''
  7458c4ed-b527-4ad5-8a04-7c87d887d5e6: !Template
    answer_choices: null
    id: 7458c4ed-b527-4ad5-8a04-7c87d887d5e6
    jinja: "Given the following entities and their types, make a creative text. The\
      \ types are PER (Person), LOC (Location), ORG (Organization), TIME (Time), NUM\
      \ (Number), and MISC (Miscellaneous).\n\n{%- set names = [] -%}\n{%- set types\
      \ = [] -%}\n{% for ners in vertexSet %}\n{% for ner in ners if ner['name'] not\
      \ in names %}\n{{ names.append(ner['name']) | default(\"\", True) }} \n{{ types.append(ner['type'])\
      \ | default(\"\", True) }} \n{% endfor %}\n{% endfor %}\n{% for name, type in\
      \ zip(names, types) %}\n{{name}}{{\": \"}}{{type}}\n{% endfor %}\n|||\n{% for\
      \ sent in sents -%}\n{{ sent | join(\" \") }}\n{%- endfor -%} "
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: ner-to-text
    reference: ''
  7f6bb96c-3661-4369-8d75-6eca07f15e6d: !Template
    answer_choices: null
    id: 7f6bb96c-3661-4369-8d75-6eca07f15e6d
    jinja: "{%- set times = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner in\
      \ ners if ner['type'] == 'TIME' -%}\n{{times.append(ner['name']) | default(\"\
      \", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if times %}\nFind all of the\
      \ times in the text below. \n\n{% for sent in sents -%}\n{{ sent | join(\" \"\
      ) }}\n{%- endfor -%} \n|||\n{{ times| unique | join(\", \")}}{{\".\"}}\n{% endif\
      \ %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: find-all-times
    reference: ''
  9ca601e9-bf97-4fba-90c9-ca502247d034: !Template
    answer_choices: null
    id: 9ca601e9-bf97-4fba-90c9-ca502247d034
    jinja: "{%- set people = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner in\
      \ ners if ner['type'] == 'PER' -%}\n{{people.append(ner['name']) | default(\"\
      \", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if people %}\nFind all of the\
      \ people in the text below. \n\n{% for sent in sents -%}\n{{ sent | join(\"\
      \ \") }}\n{%- endfor -%} \n|||\n{{ people| unique | join(\", \")}}{{\".\"}}\n\
      {% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: find-all-people
    reference: ''
  9effc9d0-bf50-4dbb-9813-02a021e8da33: !Template
    answer_choices: null
    id: 9effc9d0-bf50-4dbb-9813-02a021e8da33
    jinja: "{% if labels['relation_text'] %}\n\nRead the following text and answer\
      \ the questions.\n\nText:\n{%- for sent in sents -%}\n{{ sent | join(\" \")\
      \ }}\n{%- endfor -%} \n\nQuestion: Find the named entities above and their relationships.\n\
      \n{{\"For example, \"}}\n\n{% for  head, tail, relation in zip(labels['head'][:1],\
      \ labels['tail'][:1], labels['relation_text'][:1]) -%}\nhead: {{vertexSet[head][0]['name']}},\
      \ tail: {{vertexSet[tail][0]['name']}}, relation: {{relation}}\n{%- endfor -%}\n\
      {{\".\"}}\n|||\n{% for  head, tail, relation in zip(labels['head'][1:], labels['tail'][1:],\
      \ labels['relation_text'][1:]) %}\nhead: {{vertexSet[head][0]['name']}}, tail:\
      \ {{vertexSet[tail][0]['name']}}, relation: {{relation}}\n{% endfor %}\n{% endif\
      \ %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: true
    name: relation
    reference: ''
  a31dc527-a5b9-4411-a600-ea2bbe22a9d3: !Template
    answer_choices: null
    id: a31dc527-a5b9-4411-a600-ea2bbe22a9d3
    jinja: "{%- set numbers = [] -%} \n{%- for ners in vertexSet -%}\n{%- for ner\
      \ in ners if ner['type'] == 'NUM' -%}\n{{numbers.append(ner['name']) | default(\"\
      \", True)}}\n{%- endfor -%}\n{%- endfor -%}\n{% if numbers %}\nFind all of the\
      \ numbers in the text below. Please do not include years.\n\n{% for sent in\
      \ sents -%}\n{{ sent | join(\" \") }}\n{%- endfor -%} \n|||\n{{ numbers| unique\
      \ | join(\", \")}}{{\".\"}}\n{% endif %}"
    metadata: !TemplateMetadata
      choices_in_prompt: null
      metrics: []
      original_task: false
    name: find-all-numbers
    reference: ''