(line, subject, include_answer=True)
| 88 | |
| 89 | |
| 90 | def format_example(line, subject, include_answer=True): |
| 91 | example = f"以下是中国关于{task2desc[subject]}考试的单项选择题,请选出其中的正确答案。\n\n" |
| 92 | example = example + line["question"] |
| 93 | for choice in choices: |
| 94 | example += f'\n{choice}. {line[f"{choice}"]}' |
| 95 | |
| 96 | if include_answer: |
| 97 | example += "\n答案:" + line["answer"] + "\n\n" |
| 98 | else: |
| 99 | example += "\n答案:" |
| 100 | return example |
| 101 | |
| 102 | |
| 103 | def generate_few_shot_prompt(k, subject, dev_df): |
no outgoing calls
no test coverage detected