Spaces:
Sleeping
Sleeping
Update src/core/QuizEngine.py
Browse files- src/core/QuizEngine.py +18 -22
src/core/QuizEngine.py
CHANGED
|
@@ -85,28 +85,24 @@ class QuizEngine:
|
|
| 85 |
return None
|
| 86 |
|
| 87 |
def construct_question_generation_prompt(self, context_text):
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
f"If the text contains ANY examinable material, generate a difficult, scenario-based question.\n"
|
| 107 |
-
f"Do not ask 'What does the text say?'. Ask 'How would you apply this regulation...' or 'What are the implications of...'\n"
|
| 108 |
-
f"OUTPUT: Just the question text."
|
| 109 |
-
)
|
| 110 |
|
| 111 |
def construct_grading_prompt(self, question, answer, context_text):
|
| 112 |
return (
|
|
|
|
| 85 |
return None
|
| 86 |
|
| 87 |
def construct_question_generation_prompt(self, context_text):
|
| 88 |
+
"""
|
| 89 |
+
REVISED PROMPT: 'Action-Based' Generation.
|
| 90 |
+
Forces the model to generate a question for ANY valid information,
|
| 91 |
+
lowering the bar for what constitutes 'examinable'.
|
| 92 |
+
"""
|
| 93 |
+
return (
|
| 94 |
+
f"Act as a Navy Board Examiner.\n"
|
| 95 |
+
f"Here is a raw text excerpt from Navy documentation:\n"
|
| 96 |
+
f"'''{context_text}'''\n\n"
|
| 97 |
+
f"TASK: Generate a single question based on this text.\n\n"
|
| 98 |
+
f"RULES:\n"
|
| 99 |
+
f"1. If the text contains ANY facts (dates, definitions, locations, process steps, responsibilities), you MUST generate a question.\n"
|
| 100 |
+
f"2. Do not judge the 'quality' of the fact. If the text says 'The NSWC is in Maryland', ask 'Where is the NSWC located?'.\n"
|
| 101 |
+
f"3. Only output 'UNABLE' if the text is completely meaningless (e.g., a string of page numbers, a blank page, or garbled characters).\n\n"
|
| 102 |
+
f"OUTPUT FORMAT:\n"
|
| 103 |
+
f"- If valid: Just the question text.\n"
|
| 104 |
+
f"- If invalid: The word 'UNABLE'."
|
| 105 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
def construct_grading_prompt(self, question, answer, context_text):
|
| 108 |
return (
|