(df, idx, include_answer=True)
| 40 | |
| 41 | |
| 42 | def format_example(df, idx, include_answer=True): |
| 43 | prompt = df.iloc[idx, 0] |
| 44 | k = df.shape[1] - 2 |
| 45 | for j in range(k): |
| 46 | prompt += "\n{}. {}".format(choices[j], df.iloc[idx, j + 1]) |
| 47 | prompt += "\nAnswer:" |
| 48 | if include_answer: |
| 49 | prompt += " {}\n\n".format(df.iloc[idx, k + 1]) |
| 50 | return prompt |
| 51 | |
| 52 | |
| 53 | def gen_prompt(train_df, subject, k=-1): |
no outgoing calls
no test coverage detected