"deploy/cpp/src/keypoint_detector.cc" did not exist on "dcc7bf4f1a243d90d6c4f7c51551cea3f256325f"
Commit 76e517d1 authored by Baber's avatar Baber
Browse files

add longbench

parent a8601618
tag:
- longbench
task: longbench_2wikimqa
dataset_path: THUDM/LongBench
test_split: test
dataset_name: 2wikimqa
doc_to_text: 'Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench_e
task: longbench_2wikimqa_e
dataset_path: THUDM/LongBench
test_split: test
dataset_name: 2wikimqa_e
doc_to_text: 'Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
import argparse
from jinja2 import Environment
dataset2maxlen = {
"narrativeqa": 128,
"qasper": 128,
"multifieldqa_en": 64,
"multifieldqa_zh": 64,
"hotpotqa": 32,
"2wikimqa": 32,
"musique": 32,
"dureader": 128,
"gov_report": 512,
"qmsum": 512,
"multi_news": 512,
"vcsum": 512,
"trec": 64,
"triviaqa": 32,
"samsum": 128,
"lsht": 64,
"passage_count": 32,
"passage_retrieval_en": 32,
"passage_retrieval_zh": 32,
"lcc": 64,
"repobench-p": 64,
}
dataset2prompt = {
"narrativeqa": "You are given a story, which can be either a novel or a movie script, and a question. Answer the question asconcisely as you can, using a single phrase if possible. Do not provide any explanation.\n\nStory: {context}\n\nNow, answer the question based on the story asconcisely as you can, using a single phrase if possible. Do not provide any explanation.\n\nQuestion: {input}\n\nAnswer:",
"qasper": 'You are given a scientific article and a question. Answer the question as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.\n\nArticle: {context}\n\n Answer the question based on the above article as concisely as you can, using a single phrase or sentence if possible. If the question cannot be answered based on the information in the article, write "unanswerable". If the question is a yes/no question, answer "yes", "no", or "unanswerable". Do not provide any explanation.\n\nQuestion: {input}\n\nAnswer:',
"multifieldqa_en": "Read the following text and answer briefly.\n\n{context}\n\nNow, answer the following question based on the above text, only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:",
"multifieldqa_zh": "阅读以下文字并用中文简短回答:\n\n{context}\n\n现在请基于上面的文章回答下面的问题,只告诉我答案,不要输出任何其他字词。\n\n问题:{input}\n回答:",
"hotpotqa": "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{context}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:",
"2wikimqa": "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{context}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:",
"musique": "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{context}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:",
"dureader": "请基于给定的文章回答下述问题。\n\n文章:{context}\n\n请基于上述文章回答下面的问题。\n\n问题:{input}\n回答:",
"gov_report": "You are given a report by a government agency. Write a one-page summary of the report.\n\nReport:\n{context}\n\nNow, write a one-page summary of the report.\n\nSummary:",
"qmsum": "You are given a meeting transcript and a query containing a question or instruction. Answer the query in one or more sentences.\n\nTranscript:\n{context}\n\nNow, answer the query based on the above meeting transcript in one or more sentences.\n\nQuery: {input}\nAnswer:",
"multi_news": "You are given several news passages. Write a one-page summary of all news. \n\nNews:\n{context}\n\nNow, write a one-page summary of all the news.\n\nSummary:",
"vcsum": "下面有一段会议记录,请你阅读后,写一段总结,总结会议的内容。\n会议记录:\n{context}\n\n会议总结:",
"trec": "Please determine the type of the question below. Here are some examples of questions.\n\n{context}\n{input}",
"triviaqa": "Answer the question based on the given passage. Only give me the answer and do not output any other words. The following are some examples.\n\n{context}\n\n{input}",
"samsum": "Summarize the dialogue into a few short sentences. The following are some examples.\n\n{context}\n\n{input}",
"lsht": "请判断给定新闻的类别,下面是一些例子。\n\n{context}\n{input}",
"passage_count": "There are some paragraphs below sourced from Wikipedia. Some of them may be duplicates. Please carefully read these paragraphs and determine how many unique paragraphs there are after removing duplicates. In other words, how many non-repeating paragraphs are there in total?\n\n{context}\n\nPlease enter the final count of unique paragraphs after removing duplicates. The output format should only contain the number, such as 1, 2, 3, and so on.\n\nThe final answer is: ",
"passage_retrieval_en": 'Here are 30 paragraphs from Wikipedia, along with an abstract. Please determine which paragraph the abstract is from.\n\n{context}\n\nThe following is an abstract.\n\n{input}\n\nPlease enter the number of the paragraph that the abstract is from. The answer format must be like "Paragraph 1", "Paragraph 2", etc.\n\nThe answer is: ',
"passage_retrieval_zh": '以下是若干段落文字,以及其中一个段落的摘要。请确定给定的摘要出自哪一段。\n\n{context}\n\n下面是一个摘要\n\n{input}\n\n请输入摘要所属段落的编号。答案格式必须是"段落1","段落2"等格式\n\n答案是:',
"lcc": "Please complete the code given below. \n{context}Next line of code:\n",
"repobench-p": "Please complete the code given below. \n{context}{input}Next line of code:\n",
}
dataset2metric = {
"narrativeqa": "qa_f1_score",
"qasper": "qa_f1_score",
"multifieldqa_en": "qa_f1_score",
"multifieldqa_zh": "qa_f1_zh_score",
"hotpotqa": "qa_f1_score",
"2wikimqa": "qa_f1_score",
"musique": "qa_f1_score",
"dureader": "rouge_zh_score",
"gov_report": "rouge_score",
"qmsum": "rouge_score",
"multi_news": "rouge_score",
"vcsum": "rouge_zh_score",
"trec": "classification_score",
"triviaqa": "qa_f1_score",
"samsum": "rouge_score",
"lsht": "classification_score",
"passage_retrieval_en": "retrieval_score",
"passage_count": "count_score",
"passage_retrieval_zh": "retrieval_zh_score",
"lcc": "code_sim_score",
"repobench-p": "code_sim_score",
}
DATASETS = [
"2wikimqa",
"2wikimqa_e",
"dureader",
"gov_report",
"gov_report_e",
"hotpotqa",
"hotpotqa_e",
"lcc",
"lcc_e",
"lsht",
"multi_news",
"multi_news_e",
"multifieldqa_en",
"multifieldqa_en_e",
"multifieldqa_zh",
"musique",
"narrativeqa",
"passage_count",
"passage_count_e",
"passage_retrieval_en",
"passage_retrieval_en_e",
"passage_retrieval_zh",
"qasper",
"qasper_e",
"qmsum",
"repobench-p",
"repobench-p_e",
"samsum",
"samsum_e",
"trec",
"trec_e",
"triviaqa",
"triviaqa_e",
"vcsum",
]
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--save_prefix_path", default="longbench")
return parser.parse_args()
# Create template string
template_str = """
tag:
- {{ tag[0] }}
task: {{ task }}
dataset_path: {{ dataset_path }}
test_split: {{ test_split }}
dataset_name: {{ dataset_name }}
doc_to_text: '{{ doc_to_text }}'
doc_to_target: '{{ doc_to_target }}'
generation_kwargs:
max_gen_toks: {{ generation_kwargs.max_gen_toks }}
temperature: {{ generation_kwargs.temperature }}
do_sample: {{ generation_kwargs.do_sample }}
metric_list:
- metric: {{ metric_list[0].metric }}
aggregation: {{ metric_list[0].aggregation }}
higher_is_better: {{ metric_list[0].higher_is_better }}
metadata:
version: {{ metadata.version }}
"""
if __name__ == "__main__":
args = parse_args()
env = Environment()
template = env.from_string(template_str)
for ds in DATASETS:
df = ds[:-2] if ds.endswith("_e") else ds
generation_kwargs = {
"max_gen_toks": dataset2maxlen[df],
"temperature": 1,
"do_sample": False,
}
raw_doc_to_text = (
dataset2prompt[df]
.replace("\n", "\\n")
.replace("{", "{{")
.replace("}", "}}")
)
metric_list = [
{
"metric": f"!function metrics.{dataset2metric[df]}",
"aggregation": "mean",
"higher_is_better": True,
}
]
data = {
"tag": [
"longbench_e" if ds.endswith("_e") else "longbench"
], # Now properly as a list
"task": f"longbench_{ds}",
"dataset_path": "THUDM/LongBench",
"test_split": "test",
"dataset_name": ds,
"doc_to_text": raw_doc_to_text,
"doc_to_target": "{{answers}}",
"generation_kwargs": generation_kwargs,
"metric_list": metric_list,
"metadata": {"version": "1.0"},
}
# Render template
rendered_yaml = template.render(**data)
# Save to file
with open(args.save_prefix_path + f"{ds}.yaml", "w") as f:
f.write(rendered_yaml)
# for ds in DATASETS:
# df = ds[:-2] if ds.endswith("_e") else ds
# generation_kwargs = {"max_gen_toks": dataset2maxlen[df], "temperature": 1, "do_sample": False}
# # Escape newlines and curly braces
# raw_doc_to_text = dataset2prompt[df].replace("\n", "\\n").replace("{", "{{").replace("}", "}}")
# metric_list = [
# {"metric": f"!function metrics.{dataset2metric[df]}", "aggregation": "mean", "higher_is_better": True}]
# yaml_dict = {
# "tag": ["longbench_e" if ds.endswith("_e") else "longbench"],
# "task": f"longbench_{ds}",
# "dataset_path": "THUDM/LongBench",
# "test_split": "test",
# "dataset_name": ds,
# "doc_to_text": raw_doc_to_text,
# "doc_to_target": "{{answers}}",
# "generation_kwargs": generation_kwargs,
# "metric_list": metric_list,
# "metadata": {"version": "1.0"}
# }
# template = env.from_string(yaml_dict)
#
#
# file_save_path = args.save_prefix_path + f"{ds}.yaml"
# with open(file_save_path, "w", encoding="utf-8") as yaml_file:
# yaml.dump(
# yaml_dict,
# yaml_file,
# allow_unicode=True,
# default_flow_style=False,
# sort_keys=False
# )
tag:
- longbench
task: longbench_dureader
dataset_path: THUDM/LongBench
test_split: test
dataset_name: dureader
doc_to_text: '请基于给定的文章回答下述问题。\n\n文章:{{context}}\n\n请基于上述文章回答下面的问题。\n\n问题:{{input}}\n回答:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 128
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.rouge_zh_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_gov_report
dataset_path: THUDM/LongBench
test_split: test
dataset_name: gov_report
doc_to_text: 'You are given a report by a government agency. Write a one-page summary of the report.\n\nReport:\n{{context}}\n\nNow, write a one-page summary of the report.\n\nSummary:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 512
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.rouge_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench_e
task: longbench_gov_report_e
dataset_path: THUDM/LongBench
test_split: test
dataset_name: gov_report_e
doc_to_text: 'You are given a report by a government agency. Write a one-page summary of the report.\n\nReport:\n{{context}}\n\nNow, write a one-page summary of the report.\n\nSummary:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 512
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.rouge_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_hotpotqa
dataset_path: THUDM/LongBench
test_split: test
dataset_name: hotpotqa
doc_to_text: 'Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
task: longbench
tag:
- longbench_e
task: longbench_hotpotqa_e
dataset_path: THUDM/LongBench
dataset_name: hotpotqa_e
output_type: generate_until
test_split: test
doc_to_text: "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:"
dataset_name: hotpotqa_e
doc_to_text: 'Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: "{{answers}}"
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: false
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: true
- metric: acc_norm
aggregation: mean
higher_is_better: true
metadata:
version: 1.0
tag:
- longbench
task: longbench_lcc
dataset_path: THUDM/LongBench
test_split: test
dataset_name: lcc
doc_to_text: 'Please complete the code given below. \n{{context}}Next line of code:\n'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.code_sim_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench_e
task: longbench_lcc_e
dataset_path: THUDM/LongBench
test_split: test
dataset_name: lcc_e
doc_to_text: 'Please complete the code given below. \n{{context}}Next line of code:\n'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.code_sim_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_lsht
dataset_path: THUDM/LongBench
test_split: test
dataset_name: lsht
doc_to_text: '请判断给定新闻的类别,下面是一些例子。\n\n{{context}}\n{{input}}'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.classification_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
......@@ -7,13 +7,13 @@ from fuzzywuzzy import fuzz
from rouge import Rouge
def normalize_answer(s: str):
def normalize_answer(s: str) -> str:
"""Lower text and remove punctuation, articles and extra whitespace."""
def remove_articles(text):
return re.sub(r"\b(a|an|the)\b", " ", text)
def white_space_fix(text: str):
def white_space_fix(text):
return " ".join(text.split())
def remove_punc(text):
......@@ -26,7 +26,7 @@ def normalize_answer(s: str):
return white_space_fix(remove_articles(remove_punc(lower(s))))
def normalize_zh_answer(s: str):
def normalize_zh_answer(s: str) -> str:
"""Lower text and remove punctuation, extra whitespace."""
def white_space_fix(text):
......@@ -43,7 +43,8 @@ def normalize_zh_answer(s: str):
return white_space_fix(remove_punc(lower(s)))
def count_score(prediction, ground_truth, **kwargs):
def count_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
numbers = re.findall(r"\d+", prediction)
right_num = 0
for number in numbers:
......@@ -53,7 +54,8 @@ def count_score(prediction, ground_truth, **kwargs):
return float(final_score)
def retrieval_score(prediction, ground_truth, **kwargs):
def retrieval_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
pattern = r"Paragraph (\d+)"
matches = re.findall(pattern, ground_truth)
ground_truth_id = matches[0]
......@@ -66,7 +68,10 @@ def retrieval_score(prediction, ground_truth, **kwargs):
return float(final_score)
def retrieval_zh_score(prediction, ground_truth, **kwargs):
def retrieval_zh_score(
predictions: list[str], references: list[str], **kwargs
) -> float:
prediction, ground_truth = predictions[0], references[0]
pattern = r"段落(\d+)"
matches = re.findall(pattern, ground_truth)
ground_truth_id = matches[0]
......@@ -79,7 +84,8 @@ def retrieval_zh_score(prediction, ground_truth, **kwargs):
return float(final_score)
def code_sim_score(prediction, ground_truth, **kwargs):
def code_sim_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
all_lines = prediction.lstrip("\n").split("\n")
prediction = ""
for line in all_lines:
......@@ -89,7 +95,10 @@ def code_sim_score(prediction, ground_truth, **kwargs):
return fuzz.ratio(prediction, ground_truth) / 100
def classification_score(prediction, ground_truth, **kwargs):
def classification_score(
predictions: list[str], references: list[str], **kwargs
) -> float:
prediction, ground_truth = predictions[0], references[0]
em_match_list = []
all_classes = kwargs["all_classes"]
for class_name in all_classes:
......@@ -105,7 +114,8 @@ def classification_score(prediction, ground_truth, **kwargs):
return score
def rouge_score(prediction, ground_truth, **kwargs):
def rouge_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
rouge = Rouge()
try:
scores = rouge.get_scores([prediction], [ground_truth], avg=True)
......@@ -115,14 +125,16 @@ def rouge_score(prediction, ground_truth, **kwargs):
return scores["rouge-l"]["f"]
def rouge_zh_score(prediction, ground_truth, **kwargs):
def rouge_zh_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
prediction = " ".join(list(jieba.cut(prediction, cut_all=False)))
ground_truth = " ".join(list(jieba.cut(ground_truth, cut_all=False)))
score = rouge_score(prediction, ground_truth)
score = rouge_score([prediction], [ground_truth])
return score
def f1_score(prediction, ground_truth, **kwargs):
def f1_score(predictions: list[str], references: list[str], **kwargs):
prediction, ground_truth = predictions[0], references[0]
common = Counter(prediction) & Counter(ground_truth)
num_same = sum(common.values())
if num_same == 0:
......@@ -133,17 +145,18 @@ def f1_score(prediction, ground_truth, **kwargs):
return f1
def qa_f1_score(*args):
gold_answer, result = args
normalized_prediction = normalize_answer(result)
normalized_ground_truth = normalize_answer(gold_answer)
def qa_f1_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
normalized_prediction = normalize_answer(prediction)
normalized_ground_truth = normalize_answer(ground_truth)
prediction_tokens = normalized_prediction.split()
ground_truth_tokens = normalized_ground_truth.split()
return f1_score(prediction_tokens, ground_truth_tokens)
def qa_f1_zh_score(prediction, ground_truth, **kwargs):
def qa_f1_zh_score(predictions: list[str], references: list[str], **kwargs) -> float:
prediction, ground_truth = predictions[0], references[0]
prediction_tokens = list(jieba.cut(prediction, cut_all=False))
ground_truth_tokens = list(jieba.cut(ground_truth, cut_all=False))
prediction_tokens = [normalize_zh_answer(token) for token in prediction_tokens]
......
tag:
- longbench
task: longbench_multi_news
dataset_path: THUDM/LongBench
test_split: test
dataset_name: multi_news
doc_to_text: 'You are given several news passages. Write a one-page summary of all news. \n\nNews:\n{{context}}\n\nNow, write a one-page summary of all the news.\n\nSummary:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 512
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.rouge_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench_e
task: longbench_multi_news_e
dataset_path: THUDM/LongBench
test_split: test
dataset_name: multi_news_e
doc_to_text: 'You are given several news passages. Write a one-page summary of all news. \n\nNews:\n{{context}}\n\nNow, write a one-page summary of all the news.\n\nSummary:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 512
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.rouge_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_multifieldqa_en
dataset_path: THUDM/LongBench
test_split: test
dataset_name: multifieldqa_en
doc_to_text: 'Read the following text and answer briefly.\n\n{{context}}\n\nNow, answer the following question based on the above text, only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench_e
task: longbench_multifieldqa_en_e
dataset_path: THUDM/LongBench
test_split: test
dataset_name: multifieldqa_en_e
doc_to_text: 'Read the following text and answer briefly.\n\n{{context}}\n\nNow, answer the following question based on the above text, only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_multifieldqa_zh
dataset_path: THUDM/LongBench
test_split: test
dataset_name: multifieldqa_zh
doc_to_text: '阅读以下文字并用中文简短回答:\n\n{{context}}\n\n现在请基于上面的文章回答下面的问题,只告诉我答案,不要输出任何其他字词。\n\n问题:{{input}}\n回答:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 64
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_zh_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_musique
dataset_path: THUDM/LongBench
test_split: test
dataset_name: musique
doc_to_text: 'Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{{context}}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {{input}}\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_narrativeqa
dataset_path: THUDM/LongBench
test_split: test
dataset_name: narrativeqa
doc_to_text: 'You are given a story, which can be either a novel or a movie script, and a question. Answer the question asconcisely as you can, using a single phrase if possible. Do not provide any explanation.\n\nStory: {{context}}\n\nNow, answer the question based on the story asconcisely as you can, using a single phrase if possible. Do not provide any explanation.\n\nQuestion: {{input}}\n\nAnswer:'
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 128
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.qa_f1_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
tag:
- longbench
task: longbench_passage_count
dataset_path: THUDM/LongBench
test_split: test
dataset_name: passage_count
doc_to_text: 'There are some paragraphs below sourced from Wikipedia. Some of them may be duplicates. Please carefully read these paragraphs and determine how many unique paragraphs there are after removing duplicates. In other words, how many non-repeating paragraphs are there in total?\n\n{{context}}\n\nPlease enter the final count of unique paragraphs after removing duplicates. The output format should only contain the number, such as 1, 2, 3, and so on.\n\nThe final answer is: '
doc_to_target: '{{answers}}'
generation_kwargs:
max_gen_toks: 32
temperature: 1
do_sample: False
metric_list:
- metric: !function metrics.count_score
aggregation: mean
higher_is_better: True
metadata:
version: 1.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment