(self, df, idx, include_answer=True)
| 168 | return s |
| 169 | |
| 170 | def format_example(self, df, idx, include_answer=True): |
| 171 | prompt = df.iloc[idx, 0] |
| 172 | k = df.shape[1] - 2 |
| 173 | for j in range(k): |
| 174 | prompt += "\n{}. {}".format(self.CHOICES[j], df.iloc[idx, j + 1]) |
| 175 | prompt += "\nAnswer:" |
| 176 | if include_answer: |
| 177 | prompt += " {}\n\n".format(df.iloc[idx, k + 1]) |
| 178 | return prompt |
| 179 | |
| 180 | def gen_prompt(self, train_df, subject, k=-1): |
| 181 | prompt = "The following are multiple choice questions (with answers) about {}.\n\n".format( |
no outgoing calls
no test coverage detected