exppanded second distractors brainstorm prompt
Browse files- app.py +6 -6
- config/templates.py +20 -7
- utils/auth.py +3 -3
app.py
CHANGED
|
@@ -198,7 +198,7 @@ with gr.Blocks() as interface:
|
|
| 198 |
gr.HTML(
|
| 199 |
"""
|
| 200 |
<div style="margin-bottom: 10px;">
|
| 201 |
-
<span style="font-size: 1.5em; cursor: help;" title="Diagnoses exercise for their 4 most common issues.\n\nThe
|
| 202 |
ℹ️ <i>←</i>
|
| 203 |
</span>
|
| 204 |
</div>
|
|
@@ -214,9 +214,9 @@ with gr.Blocks() as interface:
|
|
| 214 |
interactive=True,
|
| 215 |
)
|
| 216 |
exercise_format_validate = gr.Dropdown(
|
| 217 |
-
choices=["Markdown", "XML", "Plaintext", "Raw (input
|
| 218 |
value="Markdown",
|
| 219 |
-
label="Exercise
|
| 220 |
interactive=True,
|
| 221 |
)
|
| 222 |
sampling_count_validate = gr.Dropdown(
|
|
@@ -273,9 +273,9 @@ with gr.Blocks() as interface:
|
|
| 273 |
interactive=True,
|
| 274 |
)
|
| 275 |
exercise_format_distractors = gr.Dropdown(
|
| 276 |
-
choices=["Markdown", "XML", "Plaintext", "Raw (
|
| 277 |
value="Plaintext",
|
| 278 |
-
label="Exercise
|
| 279 |
interactive=True,
|
| 280 |
)
|
| 281 |
intermediate_distractors_specification = gr.Dropdown(
|
|
@@ -367,7 +367,7 @@ with gr.Blocks() as interface:
|
|
| 367 |
|
| 368 |
distractors_button.click(
|
| 369 |
fn=run_distractors,
|
| 370 |
-
inputs=[distractors_input, model_choice_distractors_1, model_choice_distractors_2, exercise_format_distractors, sampling_count_distractors],
|
| 371 |
outputs=[
|
| 372 |
distractors_response_1,
|
| 373 |
distractors_response_2,
|
|
|
|
| 198 |
gr.HTML(
|
| 199 |
"""
|
| 200 |
<div style="margin-bottom: 10px;">
|
| 201 |
+
<span style="font-size: 1.5em; cursor: help;" title="Diagnoses exercise for their 4 most common issues.\n\nThe exercise format dropdown decides into what standardized format the exercise is converted initially for intermediate processing, to ensure reliable performance irrespective of source format.\nAnthropic models typically work better with XML, OpenAI's with markdown.\n\nResponse count is the amount of times a final response will be generated in the fields below (5-6 LLM queries for each).">
|
| 202 |
ℹ️ <i>←</i>
|
| 203 |
</span>
|
| 204 |
</div>
|
|
|
|
| 214 |
interactive=True,
|
| 215 |
)
|
| 216 |
exercise_format_validate = gr.Dropdown(
|
| 217 |
+
choices=["Markdown", "XML", "Plaintext", "Raw (input not reformatted)"],
|
| 218 |
value="Markdown",
|
| 219 |
+
label="Exercise Reformat",
|
| 220 |
interactive=True,
|
| 221 |
)
|
| 222 |
sampling_count_validate = gr.Dropdown(
|
|
|
|
| 273 |
interactive=True,
|
| 274 |
)
|
| 275 |
exercise_format_distractors = gr.Dropdown(
|
| 276 |
+
choices=["Markdown", "XML", "Plaintext", "Raw (input not reformatted)"],
|
| 277 |
value="Plaintext",
|
| 278 |
+
label="Exercise Reformat",
|
| 279 |
interactive=True,
|
| 280 |
)
|
| 281 |
intermediate_distractors_specification = gr.Dropdown(
|
|
|
|
| 367 |
|
| 368 |
distractors_button.click(
|
| 369 |
fn=run_distractors,
|
| 370 |
+
inputs=[distractors_input, model_choice_distractors_1, model_choice_distractors_2, model_choice_distractors_3, exercise_format_distractors, sampling_count_distractors],
|
| 371 |
outputs=[
|
| 372 |
distractors_response_1,
|
| 373 |
distractors_response_2,
|
config/templates.py
CHANGED
|
@@ -189,8 +189,8 @@ diagnose_scorecard_template = ChatPromptTemplate(
|
|
| 189 |
|
| 190 |
template_distractors_brainstorm_1 = ChatPromptTemplate(
|
| 191 |
messages=[
|
| 192 |
-
("system", "
|
| 193 |
-
"alternative answer options that are not correct, yet
|
| 194 |
("human", "{standardized_exercise}")
|
| 195 |
],
|
| 196 |
input_variables=["standardized_exercise", "intermediate_distractors_specification"]
|
|
@@ -198,10 +198,23 @@ template_distractors_brainstorm_1 = ChatPromptTemplate(
|
|
| 198 |
|
| 199 |
template_distractors_brainstorm_2 = ChatPromptTemplate(
|
| 200 |
messages=[
|
| 201 |
-
("system", "
|
| 202 |
-
"alternative answer options that are not correct, yet
|
| 203 |
-
"
|
| 204 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
("human", "{standardized_exercise}")
|
| 206 |
],
|
| 207 |
input_variables=["standardized_exercise", "intermediate_distractors_specification"]
|
|
@@ -214,7 +227,7 @@ template_consolidate_distractors = ChatPromptTemplate(
|
|
| 214 |
"Filter out duplicates, do some logical sorting, and just return one plain list{final_distractors_specification}. "
|
| 215 |
"Only focus on the distractors (answer options) themselves, ignore any reasoning about them. Return only the list, nothing else. Format the list without numbering or bullet points, just put every distractor on its own line. Use the same language as the existing exercise. "),
|
| 216 |
("human", "For context, this is the exercise that the distractors are about:\n "
|
| 217 |
-
"{standardized_exercise}
|
| 218 |
"Here are the lists:\n "
|
| 219 |
"{brainstorm_outputs} ")
|
| 220 |
],
|
|
|
|
| 189 |
|
| 190 |
template_distractors_brainstorm_1 = ChatPromptTemplate(
|
| 191 |
messages=[
|
| 192 |
+
("system", "Help me brainstorm. Based on the given multiple choice exercise, come up with{intermediate_distractors_specification}additional distractors: "
|
| 193 |
+
"alternative answer options that are not correct answers to the question, yet neither so implausible that even poorly informed students could immediately dismiss and eliminate them. (use the same language as the existing exercise)."),
|
| 194 |
("human", "{standardized_exercise}")
|
| 195 |
],
|
| 196 |
input_variables=["standardized_exercise", "intermediate_distractors_specification"]
|
|
|
|
| 198 |
|
| 199 |
template_distractors_brainstorm_2 = ChatPromptTemplate(
|
| 200 |
messages=[
|
| 201 |
+
("system", "Help me brainstorm answer options for a multiple choice exercise. Based on the given question, come up with{intermediate_distractors_specification}additional alternative distractors: "
|
| 202 |
+
"alternative answer options that are not correct, yet neither so implausible that even poorly informed students could immediately dismiss and eliminate them.\n\n"
|
| 203 |
+
"You can think about this as a spectrum between 'too correct' & 'too obviously false'. Or, in other words, a spectrum between two extreme ends that could be described as: "
|
| 204 |
+
"'An answer option that is not the correct answer to the question, yet extremely similar in meaning and scope to the correct answer, such that it's very debatable whether this answer option is not in fact actually also correct' & "
|
| 205 |
+
"'An answer option that is exceedingly unlikely, fantastical, off-base or ridiculous and therefore maximally obviously incorrect, such that no one who can read would think this could ever be the correct answer to the question'\n"
|
| 206 |
+
"Whether any particular distractor falls on the 'too correct' or 'too obviously incorrect' part of the spectrum, is highly context-dependent. "
|
| 207 |
+
"This often depends on many aspects to do with the exact context of the question, for example its phrasing, specific (background) domain-knowledge around the subject, "
|
| 208 |
+
"and assumptions about what test takers in the target group for this exercise already can be assumed to know or not know, and their intelligence. In other words, it is not easy to pick distractors that are positioned inside the acceptable range on this spectrum. "
|
| 209 |
+
"Therefore, really try to go about your task here methodically: first establish the borders of the acceptable range of distractors by lingering there for a bit; taking into account the specific context of the given question, as follows.\n\n"
|
| 210 |
+
"Before drafting the final list, first come up with one or two faulty distractors, that are faulty in the sense that they would be júst too much on the 'too correct' side of the aforementioned spectrum.\n"
|
| 211 |
+
"Then, come up with one or two distractors that are júst faulty on the other side of that spectrum: júst too much on the side of 'too obviously false'.\n"
|
| 212 |
+
"As an intuition pump for the first category (distractors that are júst too correct), try to imagine experts in the question's domain discussing the answer option, and some of them arguing that the distractor would also be a valid answer to the given question. "
|
| 213 |
+
"As an intuition pump for the second category (distractors that are júst too obviously incorrect), try to image a student who is both generally stupid (bottom of his class) ánd uninformed about the given topic (didn't prepare for the test). Would even they just so find it easy to eliminate the faulty distractors as clearly false?\n\n"
|
| 214 |
+
"Through the above process of picking the júst faulty distractors in the context of the given question, you've established the two boundaries of acceptable distractors to brainstorm between. Don't play it safe though, when in doubt, just list the distractor you come up with anyway.\n"
|
| 215 |
+
"Next, in the brainstorming phase, it's most important that you get really creative and really try to think outside the box, to come up with the required potential alternative answer options to the exercise. We want to approach this task from all different angles."
|
| 216 |
+
"to arrive at varied options, to serve as inspiration for a later stage of final selection (not now). For now, carry out the above-described prep in writing, then draft the list of{intermediate_distractors_specification} alternative distractors (in the same language as the existing exercise)."
|
| 217 |
+
""),
|
| 218 |
("human", "{standardized_exercise}")
|
| 219 |
],
|
| 220 |
input_variables=["standardized_exercise", "intermediate_distractors_specification"]
|
|
|
|
| 227 |
"Filter out duplicates, do some logical sorting, and just return one plain list{final_distractors_specification}. "
|
| 228 |
"Only focus on the distractors (answer options) themselves, ignore any reasoning about them. Return only the list, nothing else. Format the list without numbering or bullet points, just put every distractor on its own line. Use the same language as the existing exercise. "),
|
| 229 |
("human", "For context, this is the exercise that the distractors are about:\n "
|
| 230 |
+
"{standardized_exercise}\n\n"
|
| 231 |
"Here are the lists:\n "
|
| 232 |
"{brainstorm_outputs} ")
|
| 233 |
],
|
utils/auth.py
CHANGED
|
@@ -12,11 +12,11 @@ async def login(password: str):
|
|
| 12 |
elif password == "hunter2":
|
| 13 |
# Temporarily show the app
|
| 14 |
yield gr.update(visible=False), gr.update(visible=True), ""
|
| 15 |
-
await asyncio.sleep(
|
| 16 |
yield gr.update(visible=True), gr.update(visible=False), "Nice try ❤️"
|
| 17 |
-
await asyncio.sleep(
|
| 18 |
yield gr.update(visible=True), gr.update(visible=False), ""
|
| 19 |
else:
|
| 20 |
yield gr.update(visible=True), gr.update(visible=False), "❌ Incorrect password. Please try again or contact Ben."
|
| 21 |
-
await asyncio.sleep(
|
| 22 |
yield gr.update(visible=True), gr.update(visible=False), ""
|
|
|
|
| 12 |
elif password == "hunter2":
|
| 13 |
# Temporarily show the app
|
| 14 |
yield gr.update(visible=False), gr.update(visible=True), ""
|
| 15 |
+
await asyncio.sleep(2)
|
| 16 |
yield gr.update(visible=True), gr.update(visible=False), "Nice try ❤️"
|
| 17 |
+
await asyncio.sleep(6)
|
| 18 |
yield gr.update(visible=True), gr.update(visible=False), ""
|
| 19 |
else:
|
| 20 |
yield gr.update(visible=True), gr.update(visible=False), "❌ Incorrect password. Please try again or contact Ben."
|
| 21 |
+
await asyncio.sleep(6)
|
| 22 |
yield gr.update(visible=True), gr.update(visible=False), ""
|