OpenCompass/configs/datasets/siqa/siqa_gen_e78df3.py

42 lines
1.2 KiB
Python
Raw Normal View History

2023-07-04 22:11:33 +08:00
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 EDAccEvaluator
2023-07-04 22:11:33 +08:00
from opencompass.datasets import siqaDataset_V2
siqa_reader_cfg = dict(
2024-05-14 15:35:58 +08:00
input_columns=['context', 'question', 'answerA', 'answerB', 'answerC'],
output_column='all_labels',
test_split='validation')
2023-07-04 22:11:33 +08:00
siqa_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template=dict(
round=[
dict(
2024-05-14 15:35:58 +08:00
role='HUMAN',
2023-07-04 22:11:33 +08:00
prompt=
2024-05-14 15:35:58 +08:00
'{context}\nQuestion: {question}\nA. {answerA}\nB. {answerB}\nC. {answerC}\nAnswer:'
2023-07-04 22:11:33 +08:00
)
], ),
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer),
)
siqa_eval_cfg = dict(
evaluator=dict(type=EDAccEvaluator),
2024-05-14 15:35:58 +08:00
pred_role='BOT',
2023-07-04 22:11:33 +08:00
)
siqa_datasets = [
dict(
2024-05-14 15:35:58 +08:00
abbr='siqa',
2023-07-04 22:11:33 +08:00
type=siqaDataset_V2,
path='./data/siqa',
2023-07-04 22:11:33 +08:00
reader_cfg=siqa_reader_cfg,
infer_cfg=siqa_infer_cfg,
eval_cfg=siqa_eval_cfg)
]