Skip to content

add prompts for conceptnet, squad, and google re subset - Lama Dataset #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions promptsource/templates/lama/conceptnet/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
dataset: lama
subset: conceptnet
templates:
4d978798-0225-485a-9f27-b2a913572907: !Template
answer_choices: null
id: 4d978798-0225-485a-9f27-b2a913572907
jinja: "{{masked_sentence}} \nWhat is a right word to replace the [MASK]? Please\
\ answer with one word. ||| {{obj_label}}"
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: label
reference: ''
5117fa1a-c866-42a6-843f-af66c8768554: !Template
answer_choices: null
id: 5117fa1a-c866-42a6-843f-af66c8768554
jinja: '{{masked_sentence}}

What is a correct word to replace the [MASK]? ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: replace_with_word
reference: ''
a307ab2a-4b41-4b79-a7f4-5c5ea99e3393: !Template
answer_choices: null
id: a307ab2a-4b41-4b79-a7f4-5c5ea99e3393
jinja: '{{masked_sentence}} Fill the mask with the missing word. ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: fill_mask
reference: ''
a7d3f617-ed71-4292-9fb2-b0af08794854: !Template
answer_choices: null
id: a7d3f617-ed71-4292-9fb2-b0af08794854
jinja: 'Can you infer from the following statement the correct word to replace
[MASK]: {{masked_sentence}} ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: infer_from
reference: ''
e567c640-5e4b-4e57-b359-381321ede481: !Template
answer_choices: null
id: e567c640-5e4b-4e57-b359-381321ede481
jinja: 'Given the following fact statement: {{masked_sentence}} What is the missing
word to fill at [MASK]? ||| {{obj_label}}

'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: fact_statement
reference: ''
80 changes: 80 additions & 0 deletions promptsource/templates/lama/google_re/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
dataset: lama
subset: google_re
templates:
89ba7edc-d980-4431-8f82-9c07d28d1089: !Template
answer_choices: null
id: 89ba7edc-d980-4431-8f82-9c07d28d1089
jinja: 'Given the following sentence: {{masked_sentence | replace(''[MASK]'',
obj_label) }} Rewrite the following template with replacing X and Y with the
correct words. {{template}} ||| {{template | replace(''[X]'', sub_label) |
replace(''[Y]'', obj_label)}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
- BLEU
original_task: false
name: X_and_Y
reference: ''
9f787820-5443-4778-ba23-5fd9f894233c: !Template
answer_choices: null
id: 9f787820-5443-4778-ba23-5fd9f894233c
jinja: '{{masked_sentence | replace("[MASK]", "_") }} Fill in the blank with a
correct word ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: after_fill_blank
reference: ''
b7cf6ce2-0036-41eb-8658-9afa89a0a497: !Template
answer_choices: null
id: b7cf6ce2-0036-41eb-8658-9afa89a0a497
jinja: 'Fill in the blank in the following sentence with suitable word: {{ template
| replace("[X]", sub_label) | replace("[Y]" ,"_" ) }} ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: fill_blank
reference: ''
dc08c925-a9fa-4cad-938f-a6e3ec83871a: !Template
answer_choices: null
id: dc08c925-a9fa-4cad-938f-a6e3ec83871a
jinja: 'Given the following sentence: {{masked_sentence}}

What is {{sub_label}} {{ pred | replace("/people/person/","") | replace("/people/deceased_person/","")
| replace("_"," ")|replace("date","year")}} ? ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: what_is
reference: ''
e9e7b8e6-2ad8-4f62-a11d-6fa7f2cad8d3: !Template
answer_choices: null
id: e9e7b8e6-2ad8-4f62-a11d-6fa7f2cad8d3
jinja: 'Given the following sentence: {{template | replace(''[X]'',sub_label)
| replace(''[Y]'',''[MASK]'') }} find the correct word to fill at [MASK]. |||
{{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: find_word
reference: ''
f813bf03-135c-44dc-b974-5a942201e8dc: !Template
answer_choices: null
id: f813bf03-135c-44dc-b974-5a942201e8dc
jinja: '{{masked_sentence}} Fill the mask with a correct word. ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: fill_the_mask
reference: ''
62 changes: 62 additions & 0 deletions promptsource/templates/lama/squad/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
dataset: lama
subset: squad
templates:
5df3ac5b-2968-4f64-9427-4ee2705ad4d9: !Template
answer_choices: null
id: 5df3ac5b-2968-4f64-9427-4ee2705ad4d9
jinja: '{{masked_sentence}} Write one word to replace the [MASK]. ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: single word
reference: ''
9068e083-4037-475a-a17f-1370d1d965cf: !Template
answer_choices: null
id: 9068e083-4037-475a-a17f-1370d1d965cf
jinja: 'Fill the [MASK] with a word consistent in the following sentence: "{{masked_sentence}}"
||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: consistent
reference: ''
9c4bc2f5-2eb6-4ccb-8c7d-5b387c066e31: !Template
answer_choices: null
id: 9c4bc2f5-2eb6-4ccb-8c7d-5b387c066e31
jinja: 'Given the following context, what is a correct word to replace [MASK]?
{{masked_sentence}} ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: given_context
reference: ''
a27a9d7e-ddad-4944-a0f8-df5f26b55316: !Template
answer_choices: null
id: a27a9d7e-ddad-4944-a0f8-df5f26b55316
jinja: 'Given the following masked sentence: {{masked_sentence}} What is the correct
answer to fill the mask? ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: what_is
reference: ''
af58d7b9-6e15-4e82-b5d4-5e51cbac7196: !Template
answer_choices: null
id: af58d7b9-6e15-4e82-b5d4-5e51cbac7196
jinja: 'Suggest a right word to fill at [MASK] in the following sentence: {{masked_sentence}}
||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: Suggest
reference: ''
48 changes: 44 additions & 4 deletions promptsource/templates/lama/trex/templates.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
dataset: lama
subset: trex
templates:
26661371-8a11-46a9-bd70-b781bf749c24: !Template
answer_choices: null
id: 26661371-8a11-46a9-bd70-b781bf749c24
jinja: "The following sentence is given with blank to be filled with an appropriate\
\ word. Choose the correct word. \n{{template | replace('[X]',sub_label) | replace('[Y]','_')\
\ }} ||| {{obj_label}}"
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: sentance_blank
reference: ''
27c2da31-bd1a-48d4-9e34-c530e42c9f00: !Template
answer_choices: null
id: 27c2da31-bd1a-48d4-9e34-c530e42c9f00
jinja: '{{masked_sentence}} Fill the mask with the missing word. ||| {{obj_label}}'
jinja: '{{template | replace(''[X]'',sub_label) | replace(''[Y]'',''[MASK]'')
}} Fill the mask with the missing word. ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: false
original_task: true
name: fill_mask
reference: ''
33dbf202-0144-4f6e-a298-a2c99475fbbc: !Template
answer_choices: null
id: 33dbf202-0144-4f6e-a298-a2c99475fbbc
jinja: 'Choose an appropriate word to fill the blank in the following sentence:

{{template | replace("[X]",sub_label) | replace("[Y]","_")}} ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: choose_word
reference: ''
52469d4c-6c46-4686-a36b-7af1801e1eec: !Template
answer_choices: null
id: 52469d4c-6c46-4686-a36b-7af1801e1eec
Expand All @@ -28,15 +55,28 @@ templates:
original_task: false
name: find_relation
reference: ''
8709d0a0-eb30-4cad-9ab9-f01daba2fddd: !Template
answer_choices: null
id: 8709d0a0-eb30-4cad-9ab9-f01daba2fddd
jinja: '{{template | replace(''[X]'',sub_label)| replace(''[Y]'',''_'')}} Please
fill in the blank. ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: true
name: fill_blank
reference: ''
8cb6ee9d-bcf7-4d82-9acf-b93072c7384b: !Template
answer_choices: null
id: 8cb6ee9d-bcf7-4d82-9acf-b93072c7384b
jinja: 'Replace the mask with the correct word: {{masked_sentence}} ||| {{obj_label}}'
jinja: 'Replace the mask with the correct word: {{template | replace(''[X]'',sub_label)
| replace(''[Y]'',''[MASK]'') }} ||| {{obj_label}}'
metadata: !TemplateMetadata
choices_in_prompt: false
metrics:
- Accuracy
original_task: false
original_task: true
name: replace_mask
reference: ''
cc07e0dc-b970-4f9d-b76a-05e72a86490e: !Template
Expand Down