lcsts_gen_9b0b89.py 979 Bytes
Newer Older
tonysy's avatar
tonysy committed
1
2
3
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
4
from opencompass.openicl.icl_evaluator import JiebaRougeEvaluator
Leymore's avatar
Leymore committed
5
from opencompass.datasets import LCSTSDataset, lcsts_postprocess
tonysy's avatar
tonysy committed
6
7
8
9
10
11
12
13
14
15

lcsts_reader_cfg = dict(input_columns=['content'], output_column='abst')

lcsts_infer_cfg = dict(
    prompt_template=dict(
        type=PromptTemplate, template='阅读文章:{content}\n根据上文,给出简短的单个摘要:'),
    retriever=dict(type=ZeroRetriever),
    inferencer=dict(type=GenInferencer))

lcsts_eval_cfg = dict(
16
    evaluator=dict(type=JiebaRougeEvaluator),
Leymore's avatar
Leymore committed
17
    pred_postprocessor=dict(type=lcsts_postprocess),
tonysy's avatar
tonysy committed
18
19
20
21
22
23
24
25
26
27
28
)

lcsts_datasets = [
    dict(
        type=LCSTSDataset,
        abbr='lcsts',
        path='./data/LCSTS',
        reader_cfg=lcsts_reader_cfg,
        infer_cfg=lcsts_infer_cfg,
        eval_cfg=lcsts_eval_cfg)
]