Skip to content

Commit

Permalink
Fix prompts table benchmark (#1581)
Browse files Browse the repository at this point in the history
* add metrics to scigen

Signed-off-by: ShirApp <shirashury@gmail.com>

* improve the instructions in table benchmark datasets + add postprocessing for using first line

Signed-off-by: ShirApp <shirashury@gmail.com>

* rerun prepare

Signed-off-by: ShirApp <shirashury@gmail.com>

* add template index 0 to all benchmark recipes (so the prompt in the card will be used)

Signed-off-by: ShirApp <shirashury@gmail.com>

---------

Signed-off-by: ShirApp <shirashury@gmail.com>
  • Loading branch information
ShirApp authored Feb 6, 2025
1 parent 5f72b0d commit 85195fa
Show file tree
Hide file tree
Showing 353 changed files with 357 additions and 3 deletions.
7 changes: 5 additions & 2 deletions prepare/cards/wikitq.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
task="tasks.qa.extractive[metrics=[metrics.f1_strings, metrics.unsorted_list_exact_match]]",
templates=[
MultiReferenceTemplate(
instruction="Answer the question based on the provided table. Extract and output only the final answer—the exact phrase or data from the table that directly answers the question. Do not include any alterations, explanations, or introductory text"
+ "\nHere are some input-output examples. Read the examples carefully to figure out the mapping. The output of the last example is not given, and your job is to figure out what it is.",
instruction="Answer the question based on the provided table. "
"Extract and output only the final answer—the exact phrase or data from the table that directly answers the question. "
"Do not include any alterations, explanations, or introductory text."
"\nHere are some input-output examples. Read the examples carefully to figure out the mapping. "
"The output of the last example is not given, and your job is to figure out what it is.",
input_format="\nQuestion: {question}" "\nTable: {context}" "\nAnswer: ",
references_field="answers",
postprocessors=[
Expand Down
1 change: 1 addition & 0 deletions prepare/recipes/tables_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"num_demos": num_demos,
"demos_pool_size": DEMOS_POOL_SIZE,
"loader_limit": LOADER_LIMIT,
"template_card_index": 0,
"augmentor": [f"augmentors.table.{a!s}" for a in augment]
if augment
else None,
Expand Down
2 changes: 1 addition & 1 deletion src/unitxt/catalog/cards/wikitq.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"templates": [
{
"__type__": "multi_reference_template",
"instruction": "Answer the question based on the provided table. Extract and output only the final answer—the exact phrase or data from the table that directly answers the question. Do not include any alterations, explanations, or introductory text\nHere are some input-output examples. Read the examples carefully to figure out the mapping. The output of the last example is not given, and your job is to figure out what it is.",
"instruction": "Answer the question based on the provided table. Extract and output only the final answer—the exact phrase or data from the table that directly answers the question. Do not include any alterations, explanations, or introductory text.\nHere are some input-output examples. Read the examples carefully to figure out the mapping. The output of the last example is not given, and your job is to figure out what it is.",
"input_format": "\nQuestion: {question}\nTable: {context}\nAnswer: ",
"references_field": "answers",
"postprocessors": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_cols"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.shuffle_rows"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.transpose"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": [
"augmentors.table.insert_empty_rows[times=2]"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"num_demos": 5,
"demos_pool_size": -1,
"loader_limit": 10000,
"template_card_index": 0,
"augmentor": null
}
Loading

0 comments on commit 85195fa

Please sign in to comment.