Skip to content

Add SCROLLS long-form generation prompts #818

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

Open
wants to merge 3 commits into
base: eval-hackathon
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion promptsource/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@
# These are users whose datasets should be included in the results returned by
# filter_english_datasets (regardless of their metadata)

INCLUDED_USERS = {"Zaid", "craffel", "GEM", "aps", "khalidalt", "shanya", "rbawden", "BigScienceBiasEval", "gsarti"}
INCLUDED_USERS = {
"Zaid",
"craffel",
"GEM",
"aps",
"khalidalt",
"shanya",
"rbawden",
"BigScienceBiasEval",
"gsarti",
"tau",
}

# These are the metrics with which templates can be tagged
METRICS = {
Expand Down
63 changes: 63 additions & 0 deletions promptsource/templates/tau/scrolls/contract_nli/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
dataset: tau/scrolls
subset: contract_nli
templates:
243c496c-4cae-46d7-b94d-91c946fbd98c: !Template
answer_choices: Not mentioned ||| Entailment ||| Contradiction
id: 243c496c-4cae-46d7-b94d-91c946fbd98c
jinja: 'The following is an NDA:

{{input.split("\n\n", 1)[1]}}

Here is a statement about that NDA: {{input.split("\n\n", 1)[0]}}

Based on this NDA, is the statement "Not mentioned", an "Entailment", or a "Contradiction"?
||| {{output}}'
metadata: !TemplateMetadata
choices_in_prompt: true
languages:
- en
metrics:
- Accuracy
- Other
original_task: true
name: statement after
reference: ''
8082ee08-d6ae-4d5d-9fbf-3dae04e9b7ec: !Template
answer_choices: null
id: 8082ee08-d6ae-4d5d-9fbf-3dae04e9b7ec
jinja: '{{input.split("\n\n", 1)[0]}}

Please write a non-disclosure agreement with the relation of "{{output}}" to
the previous statement: ||| {{input.split("\n\n", 1)[1]}}

'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: write_nda
reference: ''
b1ba1f3b-7eba-4bf2-aa21-a2d899d05e40: !Template
answer_choices: Not mentioned ||| Entailment ||| Contradiction
id: b1ba1f3b-7eba-4bf2-aa21-a2d899d05e40
jinja: 'The following is a statement followed by a non-disclosure agreement:

{{input}}

Based on this NDA, is the statement "Not mentioned", an "Entailment", or a "Contradiction"?
||| {{output}}

'
metadata: !TemplateMetadata
choices_in_prompt: true
languages:
- en
metrics:
- Other
original_task: true
name: nli_labelsgiven
reference: ''
87 changes: 87 additions & 0 deletions promptsource/templates/tau/scrolls/gov_report/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
dataset: tau/scrolls
subset: gov_report
templates:
2edf0297-e3d4-4870-bd95-178411e52e09: !Template
answer_choices: null
id: 2edf0297-e3d4-4870-bd95-178411e52e09
jinja: 'Summary: {{ output }}

Full Document: ||| {{ input }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- ROUGE
- BLEU
original_task: false
name: summary_doc
reference: ''
3bd082cb-4e28-4eb7-1ea2-dd03f1f86219: !Template
answer_choices: null
id: 3bd082cb-4e28-4eb7-1ea2-dd03f1f86219
jinja: 'Read the following document:

{{ output }}

The following is a concise summary of the document: ||| {{ input }}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still weirded out that you can have trailing "\n"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry where's the trailing "\n"? Maybe I'm missing something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry *can't I would expect the generation to be "below" the "The following is a concise summary of the document:" instead of to the right.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Yeah does promptsource allow for that? Not too familiar with the convention in PS / why it can't have a trailing "\n"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't allow for it; \n & whitespace is stripped

metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: read_following
reference: ''
52ffecee-4298-4611-a3dd-cc0ee3856259: !Template
answer_choices: null
id: 52ffecee-4298-4611-a3dd-cc0ee3856259
jinja: 'The following is a summary taken from a government report.

Summary: {{ output }}

The contents of that report were likely as follows: ||| {{ input }}'
Comment on lines +41 to +45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what that brings compared to previous prompt

metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: reconstruct_report
reference: ''
af4d550e-54b8-471e-97af-2b2c50a1382e: !Template
answer_choices: null
id: af4d550e-54b8-471e-97af-2b2c50a1382e
jinja: 'Document: {{ input }}

Summary: ||| {{ output }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: true
name: doc_summary
reference: ''
af4d550e-54b8-471e-97af-2b2c50a1382e: !Template
answer_choices: null
id: af4d550e-54b8-471e-97af-2b2c50a1382e
jinja: 'Here is a government report: {{ input }}

I will now summarize it: ||| {{ output }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: true
name: summarize_report
reference: ''
74 changes: 74 additions & 0 deletions promptsource/templates/tau/scrolls/qmsum/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
dataset: tau/scrolls
subset: qmsum
templates:
2edf0197-e3d4-4870-bd95-178411e52e09: !Template
answer_choices: null
id: 2edf0197-e3d4-4870-bd95-178411e52e09
jinja: 'This is a summary of a meeting based on a query.

Summary: {{ output }}

The query given and the original meeting transcript\ are as follows: ||| {{
input }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- ROUGE
- BLEU
original_task: false
name: write_meeting
reference: ''
8c3d956e-320b-4800-8dd1-552330b7f3dc: !Template
answer_choices: null
id: 8c3d956e-320b-4800-8dd1-552330b7f3dc
jinja: 'Given the following meeting transcript: {{ input.split("?", 1)[1][1:]
}}

What is a question you could ask about the meeting? ||| {{ input.split("?",
1)[0] }}?'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: Generate question
reference: ''
af4d550e-54b8-471e-97af-2b2c50a1382e: !Template
answer_choices: null
id: af4d550e-54b8-471e-97af-2b2c50a1382e
jinja: 'The following is a question followed by a meeting transcript:

{{ input }}

How would you best summarize the meeting based on the question? ||| {{ output
}}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: true
name: summarize_by_query
reference: ''
cd5f9c35-1074-41bd-b362-d152b8d51894: !Template
answer_choices: null
id: cd5f9c35-1074-41bd-b362-d152b8d51894
jinja: '{{ input.split("?", 1)[1][1:] }}

{{ input.split("?", 1)[0] }}?

Answer: ||| {{ output }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages: []
metrics: []
original_task: false
name: question_last
reference: ''
75 changes: 75 additions & 0 deletions promptsource/templates/tau/scrolls/summ_screen_fd/templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
dataset: tau/scrolls
subset: summ_screen_fd
templates:
2edf0197-e3d4-4870-bd95-178411e52e09: !Template
answer_choices: null
id: 2edf0197-e3d4-4870-bd95-178411e52e09
jinja: 'Given the following television episode recap, please write a transcript of the episode.

Recap: {{ output }}

Transcript: ||| {{ input }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- ROUGE
- BLEU
original_task: false
name: write_transcript
reference: ''
3bd082cb-4e28-4eb7-9fa2-dd03f1f86219: !Template
answer_choices: null
id: 3bd082cb-4e28-4eb7-9fa2-dd03f1f86219
jinja: 'Here is a summary of a TV episode:

{{ output }}

The following is the full screenplay of that TV episode: ||| {{ input }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: provide screenplay
reference: ''
52ffecee-4298-4611-a3dd-cc0ee3856259: !Template
answer_choices: null
id: 52ffecee-4298-4611-a3dd-cc0ee3856259
jinja: 'I will provide a TV episode synopsis below.

Synopsis: {{ output }}

I will now start writing that TV episode from scratch: ||| {{ input }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: false
name: write_from_synopsis
reference: ''
af4d550e-54b8-471e-97af-2b2c50a1382e: !Template
answer_choices: null
id: af4d550e-54b8-471e-97af-2b2c50a1382e
jinja: 'The following is a television episode transcript:

{{ input }}

How would you best summarize the above episode? ||| {{ output }}'
metadata: !TemplateMetadata
choices_in_prompt: false
languages:
- en
metrics:
- BLEU
- ROUGE
original_task: true
name: summarize episode
reference: ''