(line, subject, include_answer=True)
| 109 | |
| 110 | |
| 111 | def format_example(line, subject, include_answer=True): |
| 112 | example = f"以下是关于{task2desc[subject]}的单项选择题,请直接给出正确答案的选项。\n\n" |
| 113 | example = example + "题目:" + line["Question"] |
| 114 | for choice in choices: |
| 115 | example += f'\n{choice}. {line[f"{choice}"]}' |
| 116 | |
| 117 | if include_answer: |
| 118 | example += "\n答案:" + line["Answer"] + "\n\n" |
| 119 | else: |
| 120 | example += "\n答案:" |
| 121 | return example |
| 122 | |
| 123 | |
| 124 | def generate_few_shot_prompt(k, subject, dev_df): |
no outgoing calls
no test coverage detected