OpenCompass/configs/datasets/FewCLUE_csl/FewCLUE_csl_gen_1b0c02.py
2023-07-05 03:15:31 +00:00

51 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import CslDataset_V2
csl_reader_cfg = dict(
input_columns=["abst", "keywords"],
output_column="label",
)
csl_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(round=[
dict(
role="HUMAN",
prompt=
"摘要:{abst}\n关键词:{keywords}\n上述关键词出现在学术期刊中是否恰当?\nA. 否\nB. 是\n请从”A“”B“中进行选择。\n答:"
)
]),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
csl_eval_cfg = dict(
evaluator=dict(type=AccEvaluator),
pred_role="BOT",
pred_postprocessor=dict(type="first-capital"),
)
csl_datasets = [
dict(
abbr="csl_dev",
type=CslDataset_V2,
path="./data/FewCLUE/csl/dev_few_all.json",
reader_cfg=csl_reader_cfg,
infer_cfg=csl_infer_cfg,
eval_cfg=csl_eval_cfg,
),
dict(
abbr="csl_test",
type=CslDataset_V2,
path="./data/FewCLUE/csl/test_public.json",
reader_cfg=csl_reader_cfg,
infer_cfg=csl_infer_cfg,
eval_cfg=csl_eval_cfg,
),
]