Spaces:
Sleeping
Sleeping
Update src/core/QuizEngine.py
Browse files- src/core/QuizEngine.py +9 -14
src/core/QuizEngine.py
CHANGED
|
@@ -115,8 +115,8 @@ class QuizEngine:
|
|
| 115 |
|
| 116 |
def construct_question_generation_prompt(self, context_text):
|
| 117 |
"""
|
| 118 |
-
REVISED PROMPT:
|
| 119 |
-
Includes
|
| 120 |
"""
|
| 121 |
return (
|
| 122 |
f"Act as a Navy Board Examiner.\n"
|
|
@@ -124,36 +124,31 @@ class QuizEngine:
|
|
| 124 |
f"'''{context_text}'''\n\n"
|
| 125 |
f"TASK: Generate a single question based on this text.\n\n"
|
| 126 |
|
| 127 |
-
f"EXAMPLES OF DESIRED QUALITY:\n"
|
| 128 |
-
f"1. [Simple Fact]
|
| 129 |
f" Text: 'The NSWC is in Maryland.'\n"
|
| 130 |
f" Good Question: 'Where are the Naval Surface Warfare Centers located?'\n"
|
| 131 |
f"2. [Process/Order]\n"
|
| 132 |
f" Text: 'There are five acquisition phases.'\n"
|
| 133 |
f" Good Question: 'What are the five acquisition phases?'\n"
|
| 134 |
f"3. [Scenario/Application]\n"
|
| 135 |
-
f" Text: 'A significant Nunn-McCurdy Unit Cost Breach is defined as cost growth of 15% over current baseline
|
| 136 |
f" Good Question: 'What conditions trigger a significant Nunn-McCurdy Unit Cost Breach?'\n\n"
|
| 137 |
|
| 138 |
f"EXAMPLES OF POOR QUALITY (AVOID THIS):\n"
|
| 139 |
f"1. [Lazy/Meta-Reference]\n"
|
| 140 |
f" Bad Question: 'What does the text say about the budget?'\n"
|
| 141 |
f" Critique: Do not reference 'the text'. Ask about the subject matter directly.\n"
|
| 142 |
-
f"2. [Yes/No
|
| 143 |
f" Bad Question: 'Is the budget cycle annual?'\n"
|
| 144 |
-
f" Critique: Too easy. Ask 'What is the duration of the budget cycle?' instead.\n"
|
| 145 |
-
f"3. [Administrative Trivia]\n"
|
| 146 |
-
f" Bad Question: 'What document number is listed in the header?'\n"
|
| 147 |
-
f" Critique: Irrelevant to professional qualification.\n\n"
|
| 148 |
|
| 149 |
f"STRICT RULES:\n"
|
| 150 |
f"1. You must base your question on a SPECIFIC SENTENCE in the text.\n"
|
| 151 |
-
f"2.
|
| 152 |
-
f"3. If the text is meaningless or 'Intentionally Left Blank', output 'UNABLE'.\n\n"
|
| 153 |
|
| 154 |
f"OUTPUT FORMAT:\n"
|
| 155 |
-
f"
|
| 156 |
-
f"QUOTE: [The exact text snippet used]"
|
| 157 |
)
|
| 158 |
|
| 159 |
def construct_grading_prompt(self, question, answer, context_text):
|
|
|
|
| 115 |
|
| 116 |
def construct_question_generation_prompt(self, context_text):
|
| 117 |
"""
|
| 118 |
+
REVISED PROMPT: 'Board-Style' Questions (No Spoilers).
|
| 119 |
+
Includes Examples for quality, but output is strictly the question text.
|
| 120 |
"""
|
| 121 |
return (
|
| 122 |
f"Act as a Navy Board Examiner.\n"
|
|
|
|
| 124 |
f"'''{context_text}'''\n\n"
|
| 125 |
f"TASK: Generate a single question based on this text.\n\n"
|
| 126 |
|
| 127 |
+
f"EXAMPLES OF DESIRED QUALITY (DO THIS):\n"
|
| 128 |
+
f"1. [Simple Fact]\n"
|
| 129 |
f" Text: 'The NSWC is in Maryland.'\n"
|
| 130 |
f" Good Question: 'Where are the Naval Surface Warfare Centers located?'\n"
|
| 131 |
f"2. [Process/Order]\n"
|
| 132 |
f" Text: 'There are five acquisition phases.'\n"
|
| 133 |
f" Good Question: 'What are the five acquisition phases?'\n"
|
| 134 |
f"3. [Scenario/Application]\n"
|
| 135 |
+
f" Text: 'A significant Nunn-McCurdy Unit Cost Breach is defined as cost growth of 15% over current baseline.'\n"
|
| 136 |
f" Good Question: 'What conditions trigger a significant Nunn-McCurdy Unit Cost Breach?'\n\n"
|
| 137 |
|
| 138 |
f"EXAMPLES OF POOR QUALITY (AVOID THIS):\n"
|
| 139 |
f"1. [Lazy/Meta-Reference]\n"
|
| 140 |
f" Bad Question: 'What does the text say about the budget?'\n"
|
| 141 |
f" Critique: Do not reference 'the text'. Ask about the subject matter directly.\n"
|
| 142 |
+
f"2. [Yes/No]\n"
|
| 143 |
f" Bad Question: 'Is the budget cycle annual?'\n"
|
| 144 |
+
f" Critique: Too easy. Ask 'What is the duration of the budget cycle?' instead.\n\n"
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
f"STRICT RULES:\n"
|
| 147 |
f"1. You must base your question on a SPECIFIC SENTENCE in the text.\n"
|
| 148 |
+
f"2. If the text is meaningless or 'Intentionally Left Blank', output 'UNABLE'.\n\n"
|
|
|
|
| 149 |
|
| 150 |
f"OUTPUT FORMAT:\n"
|
| 151 |
+
f"Output ONLY the question text. Do NOT output the answer or the quote."
|
|
|
|
| 152 |
)
|
| 153 |
|
| 154 |
def construct_grading_prompt(self, question, answer, context_text):
|