diff --git a/promptsource/templates/trec/templates.yaml b/promptsource/templates/trec/templates.yaml index d3ebfe499..6c51bc20b 100644 --- a/promptsource/templates/trec/templates.yaml +++ b/promptsource/templates/trec/templates.yaml @@ -1,11 +1,11 @@ dataset: trec templates: 21d04668-c5b3-4418-bbb6-663f1ffdb97c: !Template - answer_choices: Description ||| Entity ||| Abbreviation ||| Person ||| Quantity - ||| Location + answer_choices: Abbreviation ||| Entity ||| Description ||| Person ||| Location + ||| Quantity id: 21d04668-c5b3-4418-bbb6-663f1ffdb97c jinja: "Categories: {{', '.join(answer_choices)}}\n\nWhat category best describes:\ - \ {{text}} \nAnswer: ||| {{ answer_choices [label_coarse] }}" + \ {{text}} \nAnswer: ||| {{ answer_choices [coarse_label] }}" metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -16,11 +16,9 @@ templates: name: what_category_best_describe reference: '' 2d4e0add-cfca-4f54-80a2-ddd8e91f9fd6: !Template - answer_choices: city ||| country ||| mountain ||| state ||| other location + answer_choices: city ||| country ||| mountain ||| other location ||| state id: 2d4e0add-cfca-4f54-80a2-ddd8e91f9fd6 - jinja: '{% set label_mapping = {21:0, 18:1, 24:2, 11:3, 14:4} %} - - {% if label_coarse == 5 %} + jinja: '{% if coarse_label == 4 %} Is this question asking for {{'', ''.join(answer_choices)}}? @@ -28,7 +26,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-32] }} {% endif %}' metadata: !TemplateMetadata @@ -41,14 +39,11 @@ templates: name: fine_grained_LOC reference: Fine grained labels with coarse-label `LOC`, context after question 309bf243-2185-4090-ac66-a24f44d89966: !Template - answer_choices: code ||| count ||| date ||| distance ||| price ||| order ||| period - of time ||| percentage ||| speed ||| temperature ||| size ||| weight ||| other - number + answer_choices: code ||| count ||| date ||| distance ||| price ||| order ||| other + number ||| period of time ||| percentage ||| speed ||| temperature ||| size + ||| weight id: 309bf243-2185-4090-ac66-a24f44d89966 - jinja: '{% set label_mapping = {39:0, 13:1, 8:2, 40:3, 25:4, 43:5, 27:6, 38:7, - 35:8, 41:9, 32:10, 45:11, 14:12} %} - - {% if label_coarse == 4 %} + jinja: '{% if coarse_label == 5 %} {{text}} @@ -57,7 +52,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-37] }} {% endif %}' metadata: !TemplateMetadata @@ -72,14 +67,10 @@ templates: 3aff84f3-e478-4598-abe8-40aa24cec1fa: !Template answer_choices: an animal ||| an organ of the body ||| a color ||| creative piece ||| currency ||| disease or medicine ||| event ||| food ||| musical instrument - ||| language ||| letter ||| plant ||| product ||| religion ||| sport ||| substance - ||| symbol ||| technique ||| term ||| vehicle ||| word ||| other entity + ||| language ||| letter ||| other entity ||| plant ||| product ||| religion + ||| sport ||| substance ||| symbol ||| technique ||| term ||| vehicle ||| word id: 3aff84f3-e478-4598-abe8-40aa24cec1fa - jinja: '{% set label_mapping = {2:0, 22:1, 19:2, 1:3, 46:3, 23:4, 10:5, 17:6, - 33:7, 37:8, 15:9, 30:10, 26:11, 16:12, 28:13, 42:14, 31:15, 20:16, 44:17, 36:18, - 14:19} %} - - {% if label_coarse == 1 %} + jinja: '{% if coarse_label == 1 %} Is this question asking for {{'', ''.join(answer_choices)}}? @@ -87,7 +78,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-2] }} {% endif %}' metadata: !TemplateMetadata @@ -100,14 +91,11 @@ templates: name: fine_grained_ENTY reference: Fine grained labels with coarse-label `ENTY`, context after question 43a188a2-b6dd-46a7-af2e-81a64b90b92a: !Template - answer_choices: code ||| count ||| date ||| distance ||| price ||| order ||| period - of time ||| percentage ||| speed ||| temperature ||| size ||| weight ||| other - number + answer_choices: code ||| count ||| date ||| distance ||| price ||| order ||| other + number ||| period of time ||| percentage ||| speed ||| temperature ||| size + ||| weight id: 43a188a2-b6dd-46a7-af2e-81a64b90b92a - jinja: '{% set label_mapping = {39:0, 13:1, 8:2, 40:3, 25:4, 43:5, 27:6, 38:7, - 35:8, 41:9, 32:10, 45:11, 14:12} %} - - {% if label_coarse == 4 %} + jinja: '{% if coarse_label == 5 %} Is this question asking for {{'', ''.join(answer_choices)}}? @@ -115,7 +103,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-37] }} {% endif %}' metadata: !TemplateMetadata @@ -128,8 +116,8 @@ templates: name: fine_grained_NUM reference: Fine grained labels with coarse-label `NUM` 6c391f4f-027b-4425-88de-1dbb6aa706ee: !Template - answer_choices: Description ||| Entity ||| Abbreviation ||| Person ||| Quantity - ||| Location + answer_choices: Abbreviation ||| Entity ||| Description ||| Person ||| Location + ||| Quantity id: 6c391f4f-027b-4425-88de-1dbb6aa706ee jinja: 'Question: {{text}} @@ -141,7 +129,7 @@ templates: ||| - {{answer_choices[label_coarse]}}' + {{answer_choices[coarse_label]}}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -152,14 +140,15 @@ templates: name: pick_the_best_descriptor reference: '' 71090d59-dd02-4cbd-8032-ad86179b9bd4: !Template - answer_choices: Manner ||| Creative Piece ||| Animal ||| Expression abbreviated - ||| Individual ||| Group ||| Title ||| Defintion ||| Date ||| Reason ||| Event - ||| State ||| Description ||| Count ||| Other ||| Letter ||| Religion ||| Food - ||| Country ||| Color ||| Term ||| City ||| Organ of the body ||| Disease or - medicine ||| Mountain ||| Price ||| Product ||| Period ||| Substance ||| Sport - ||| Plant ||| Technique ||| Size ||| Instrument ||| Abbreviation ||| Speed ||| - Word ||| Language ||| Percentage ||| Code ||| Distance ||| Temperature ||| Symbol - ||| Order ||| Vehicle ||| Weight ||| Currency + answer_choices: abbreviation ||| expression abbreviated ||| an animal ||| an organ + of the body ||| a color ||| creative piece ||| currency ||| disease or medicine + ||| event ||| food ||| musical instrument ||| language ||| letter ||| other + entity ||| plant ||| product ||| religion ||| sport ||| substance ||| symbol + ||| technique ||| term ||| vehicle ||| word ||| definition ||| description ||| + manner of action ||| reason ||| group ||| individual ||| title ||| description + ||| city ||| country ||| mountain ||| other location ||| state ||| code ||| + count ||| date ||| distance ||| price ||| order ||| other number ||| period + of time ||| percentage ||| speed ||| temperature ||| size ||| weight id: 71090d59-dd02-4cbd-8032-ad86179b9bd4 jinja: '{{text}} @@ -168,7 +157,7 @@ templates: ||| - {{answer_choices[label_fine] }}' + {{answer_choices[fine_label] }}' metadata: !TemplateMetadata choices_in_prompt: false languages: @@ -179,11 +168,9 @@ templates: name: fine_grained_open_context_first reference: Fine grained classes without providing choices, context first. 736b2629-ed57-48ce-a458-4cbc435c499b: !Template - answer_choices: city ||| country ||| mountain ||| state ||| other location + answer_choices: city ||| country ||| mountain ||| other location ||| state id: 736b2629-ed57-48ce-a458-4cbc435c499b - jinja: '{% set label_mapping = {21:0, 18:1, 24:2, 11:3, 14:4} %} - - {% if label_coarse == 5 %} + jinja: '{% if coarse_label == 4 %} {{text}} @@ -192,7 +179,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-32] }} {% endif %}' metadata: !TemplateMetadata @@ -205,12 +192,12 @@ templates: name: fine_grained_LOC_context_first reference: Fine grained labels with coarse-label `LOC`, context provided first 7a3ed4dd-af89-493c-8efb-c67622f63034: !Template - answer_choices: Description ||| Entity ||| Abbreviation ||| Person ||| Quantity - ||| Location + answer_choices: Abbreviation ||| Entity ||| Description ||| Person ||| Location + ||| Quantity id: 7a3ed4dd-af89-493c-8efb-c67622f63034 jinja: "Which category best describes the following question: {{text}} \n\nChoose\ \ from the following list: \n{{', '.join(answer_choices)}}\n ||| {{ answer_choices\ - \ [label_coarse] }}" + \ [coarse_label] }}" metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -223,9 +210,7 @@ templates: 7a9e6f3c-1dee-45b0-a315-1badaf59a7b8: !Template answer_choices: definition ||| description ||| manner of action ||| reason id: 7a9e6f3c-1dee-45b0-a315-1badaf59a7b8 - jinja: '{% set label_mapping={0:2, 7:1, 12:0, 9:3} %} - - {% if label_coarse == 0 %} + jinja: '{% if coarse_label == 2 %} Is this question asking for {{'', ''.join(answer_choices)}}? @@ -233,7 +218,7 @@ templates: ||| - {{ answer_choices[label_mapping[label_fine]] }} + {{ answer_choices[fine_label-24] }} {% endif %}' metadata: !TemplateMetadata @@ -246,8 +231,8 @@ templates: name: fine_grained_DESC reference: Fine grained labels with coarse-label `DESC`, context after question 861d1a48-1113-4f35-b777-2b2f12ab9d5d: !Template - answer_choices: Description ||| Entity ||| Abbreviation ||| Person ||| Quantity - ||| Location + answer_choices: Abbreviation ||| Entity ||| Description ||| Person ||| Location + ||| Quantity id: 861d1a48-1113-4f35-b777-2b2f12ab9d5d jinja: '{{text}} @@ -256,7 +241,7 @@ templates: ||| - {{ answer_choices [label_coarse] }}' + {{ answer_choices [coarse_label] }}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -269,9 +254,17 @@ templates: 93a06e72-2c15-4f8a-a46c-6a10919c4ea4: !Template answer_choices: abbreviation ||| expression abbreviated id: 93a06e72-2c15-4f8a-a46c-6a10919c4ea4 - jinja: "{% set label_mapping={34:0, 3:1} %} \n{% if label_coarse == 2 %}\nIs this\ - \ question asking for an {{', '.join(answer_choices)}}?\n{{text}}\n|||\n{{answer_choices[label_mapping[label_fine]]\ - \ }}\n{% endif %}" + jinja: '{% if coarse_label == 0 %} + + Is this question asking for an {{'', ''.join(answer_choices)}}? + + {{text}} + + ||| + + {{answer_choices[fine_label] }} + + {% endif %}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -284,9 +277,17 @@ templates: a0096044-3b4c-4c80-b139-25eac8fe692a: !Template answer_choices: abbreviation ||| expression abbreviated id: a0096044-3b4c-4c80-b139-25eac8fe692a - jinja: "{% set label_mapping = {34:0, 3:1} %} \n{% if label_coarse == 2 %}\n{{text}}\n\ - \nIs this question asking for an {{', '.join(answer_choices)}}?\n|||\n{{ answer_choices\ - \ [label_mapping[label_fine]] }}\n{% endif %}" + jinja: '{% if coarse_label == 0 %} + + {{text}} + + Is this question asking for an {{'', ''.join(answer_choices)}}? + + ||| + + {{answer_choices[fine_label] }} + + {% endif %}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -297,8 +298,8 @@ templates: name: fine_grained_ABBR_context_first reference: Fine grained labels with coarse-label `ABBR`, context provided first aad2def1-b694-40ee-9c26-3d1cf5c577da: !Template - answer_choices: Description ||| Entity ||| Abbreviation ||| Person ||| Quantity - ||| Location + answer_choices: Abbreviation ||| Entity ||| Description ||| Person ||| Location + ||| Quantity id: aad2def1-b694-40ee-9c26-3d1cf5c577da jinja: 'Is the following question asking about {{'', ''.join(answer_choices)}}? @@ -307,7 +308,7 @@ templates: ||| - {{ answer_choices [label_coarse] }}' + {{ answer_choices [coarse_label] }}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -320,9 +321,7 @@ templates: bc58ba18-24a5-4553-be0a-2dba60efdad6: !Template answer_choices: group ||| individual ||| title ||| description id: bc58ba18-24a5-4553-be0a-2dba60efdad6 - jinja: '{% set label_mapping = {5:0, 4:1, 6:2, 12:3} %} - - {% if label_coarse == 3 %} + jinja: '{% if coarse_label == 3 %} Is this question asking for {{'', ''.join(answer_choices)}}? @@ -330,7 +329,7 @@ templates: ||| - {{ answer_choices[label_mapping[label_fine]] }} + {{ answer_choices[fine_label-28] }} {% endif %}' metadata: !TemplateMetadata @@ -343,14 +342,15 @@ templates: name: fine_grained_HUM reference: Fine grained labels with coarse-label `HUM`, context after question cfa8fde0-8320-4050-8d6e-7619ab14adea: !Template - answer_choices: Manner ||| Creative Piece ||| Animal ||| Expression abbreviated - ||| Individual ||| Group ||| Title ||| Defintion ||| Date ||| Reason ||| Event - ||| State ||| Description ||| Count ||| Other ||| Letter ||| Religion ||| Food - ||| Country ||| Color ||| Term ||| City ||| Organ of the body ||| Disease or - medicine ||| Mountain ||| Price ||| Product ||| Period ||| Substance ||| Sport - ||| Plant ||| Technique ||| Size ||| Instrument ||| Abbreviation ||| Speed ||| - Word ||| Language ||| Percentage ||| Code ||| Distance ||| Temperature ||| Symbol - ||| Order ||| Vehicle ||| Weight ||| Currency + answer_choices: abbreviation ||| expression abbreviated ||| an animal ||| an organ + of the body ||| a color ||| creative piece ||| currency ||| disease or medicine + ||| event ||| food ||| musical instrument ||| language ||| letter ||| other + entity ||| plant ||| product ||| religion ||| sport ||| substance ||| symbol + ||| technique ||| term ||| vehicle ||| word ||| definition ||| description ||| + manner of action ||| reason ||| group ||| individual ||| title ||| description + ||| city ||| country ||| mountain ||| other location ||| state ||| code ||| + count ||| date ||| distance ||| price ||| order ||| other number ||| period + of time ||| percentage ||| speed ||| temperature ||| size ||| weight id: cfa8fde0-8320-4050-8d6e-7619ab14adea jinja: 'What is this question asking for? @@ -359,7 +359,7 @@ templates: ||| - {{ answer_choices[label_fine] }}' + {{ answer_choices[fine_label] }}' metadata: !TemplateMetadata choices_in_prompt: false languages: @@ -372,9 +372,7 @@ templates: e98b9294-76b4-4172-a78c-9c6e5fdfe73b: !Template answer_choices: group ||| individual ||| title ||| description id: e98b9294-76b4-4172-a78c-9c6e5fdfe73b - jinja: '{% set label_mapping = {5:0, 4:1, 6:2, 12:3} %} - - {% if label_coarse == 3 %} + jinja: '{% if coarse_label == 3 %} {{text}} @@ -383,7 +381,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }}{% endif %}' + {{ answer_choices [fine_label-28] }}{% endif %}' metadata: !TemplateMetadata choices_in_prompt: true languages: @@ -396,9 +394,7 @@ templates: fa588c55-5c69-4fd0-a0b1-edbfa092f710: !Template answer_choices: definition ||| description ||| manner of action ||| reason id: fa588c55-5c69-4fd0-a0b1-edbfa092f710 - jinja: '{% set label_mapping={0:2, 7:1, 12:0, 9:3} %} - - {% if label_coarse == 0 %} + jinja: '{% if coarse_label == 2 %} {{text}} @@ -407,7 +403,7 @@ templates: ||| - {{ answer_choices [label_mapping[label_fine]] }} + {{ answer_choices [fine_label-24] }} {% endif %}' metadata: !TemplateMetadata